Andrew Precht has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I have no knowledge of perl, so please forgive... I've been asked to rebuild a RADIUS server. The guys at FreeRadius.org have really helped me get it up and running. However, my next issue is getting this perl script to run. Where do I start in tracking down this error: Can't locate object method "new" via package "LWP::UserAgent" (perhaps you forgot to load "LWP::UserAgent"?) at /etc/raddb/sjpl.pl line 94.
here is the offending code in line 94
my $ua = LWP::UserAgent->new;here is all the code added to the default Radius script
sub authenticate { # my $logfile = "/var/log/patron/sign-on.log"; my $logfile = "/dev/null"; my $testfile = "/etc/raddb/test.text"; my $date = `/bin/date`; chomp $date; my $url = "https://10.151.4.3:54620/PATRONAPI/" . $RAD_REQUEST{'User-N +ame'} . "/" . $RAD_REQUEST{'User-Password'} . "/pintest"; my $ua = LWP::UserAgent->new; my $output1 = $ua->get($url); my $output = $output1->as_string; # For debugging purposes only # &log_request_attributes; if ($output =~ /RETCOD=0/) { `echo "$date : SUCCESS via SSL $RAD_REQUEST{'User-Name +'} - $RAD_REQUEST{'User-Password'}" >> $logfile`; $RAD_REPLY{'Reply-Message'} = "Success"; return RLM_MODULE_OK; } else { `echo "$date : FAIL via SSL $RAD_REQUEST{'User-Name'} +- $RAD_REQUEST{'User-Password'}" >> $logfile`; $RAD_REPLY{'Reply-Message'} = "Denied access by RADIUS +"; return RLM_MODULE_REJECT; } }
Thanks for any help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP UserAgent
by blue_cowdawg (Monsignor) on Oct 10, 2012 at 20:10 UTC | |
|
Re: LWP UserAgent
by toolic (Bishop) on Oct 10, 2012 at 20:01 UTC | |
|
Re: LWP UserAgent
by Andrew Precht (Initiate) on Oct 10, 2012 at 20:52 UTC | |
by Tanktalus (Canon) on Oct 10, 2012 at 22:24 UTC | |
by Old_Gray_Bear (Bishop) on Oct 11, 2012 at 15:35 UTC |