(RADIATOR) radiator hooks

Hugh Irvine hugh at open.com.au
Thu Jun 2 18:44:14 CDT 2005


Hello Jason -

What exactly are you trying to do with the Stop record? If it is just  
to update an SQL table you can use an AcctSQLStatement directly in  
your AuthBy SQL clause. If you do want to use a hook, you should  
realise that there are two different things happening with the radius  
protocol - the first is authentication and the second is accounting.  
You will want your hook code to check that it is in fact dealing with  
a Stop (Acct-Status-Type = Stop) and then do whatever you wish.

The best way to debug your hook code is to add "print ..." statements  
then run radiusd from the command line like this:

         perl radiusd -foreground -log_stdout -trace 4 - 
config_file .....

I wrote most of the example hooks so if you have any questions please  
ask.

BTW - the best documentation is in the Radiator source code - I  
suggest you start by reading "radiusd", then the relevant modules in  
the "Radius" subdirectory (start with Client.pm, Handler.pm and  
AuthGeneric.pm).

regards

Hugh



On 3 Jun 2005, at 09:30, Jason Stechschulte wrote:

> We are getting ready to a sputnik control center system on our  
> network,
> and as a result of this, I need to be able to update a user's
> information when an Acct-Status-Type = Stop is received.  Which of the
> hooks should I use to accomplish this?
>
> I have tried preauth and postauth.  They seem to run when a stop  
> record
> is sent, but I can't get any useful information.  I have even tried
> using excerpts from th examples with no luck.  Right now I have  
> this as
> a PostAuthHook:
>
> sub {
>    my $p = ${$_[0]};
>    my $rp = ${$_[1]};
>    my $result = ${$_[2]};
>
>    my $identifier;
>
>    if (($result == $main::ACCEPT) && ($identifier = $p->{Client}-> 
> {Identifier})) {
>       &main::log($main::LOG_DEBUG, "Jason's Client Identifier =  
> $identifier");
>    }
>
>    return;
> }
>
>
> This snippet came for the goodies/hooks.txt file.  I'm not seeing
> anything enter the log file even though I have trace set to 5.  Is  
> there
> something specific I need to set to be able to write to logs within  
> the
> hook?
>
> Instead of having it log, I have tried to just get it to write to a  
> file
> in the /tmp dir.  When I do this, It simply writes:
>
> Jason's Client Identifier =
>
> And $identifier is always blank.  I have it simply append to the  
> file so
> I can see every time it is ran what the results are, and I'm always
> unsuccessful at filling $identifier.
>
> I'm hoping this is just something simple I'm overlooking.  By the way
> are there any docs that cover writing hooks for radiator?  The only
> thing I have found besides the goodies/hooks.txt file is this:
>
> http://www.open.com.au/radiator/ref.html#pgfId=319543
>
> The examples in goodies/hooks.txt I can't seem to get working and the
> information at the page above doesn't really explain what variables  
> are
> available.  Just wondering if there is somewhere that it explains it a
> little more in depth.
>
> -- 
> Jason Stechschulte
> Network Administrator
> West Central Ohio Internet Link
> Lima, OH USA
>
> --
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>


NB:

Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/ 
radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.


--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list