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.


In reply to LWP UserAgent by Andrew Precht

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.