(RADIATOR) Radonline flushing every 2 hours

Hugh Irvine hugh at open.com.au
Thu Feb 28 02:31:03 CST 2002


Hello Frank, Hello Anton -

The special accounting requests of Accounting-On and Accounting-Off are used 
for this, as are a couple of other special cases.

Here is the relevant code from Handler.pm (sub handle_request):


 if ($status_type eq 'Start')
        {
            # Some Ciscos dont send accounting-on, so we will
            # detect a reboot with the first session (ID 00000001)
            $sessdb->clearNas($nas_id, $p)
                if    $session_id eq '00000000'
                   || (   $session_id eq '00000001'
                       && $p->{Client}->{NasType} eq 'Cisco');

            $sessdb->add($original_username, $nas_id, $nas_port, $p);
        }
        elsif ($status_type eq 'Alive')
        {
            # When Cisco sends an Alive, we are going to do an update,
            # not an insert.
            $sessdb->update($original_username, $nas_id, $nas_port, $p);
        }
        elsif ($status_type eq 'Stop')
        {
            $sessdb->delete($original_username, $nas_id, $nas_port, $p,
                            $session_id, $framed_ip_address);
        }
        elsif ($status_type eq 'Accounting-On'
            || $status_type eq 'Accounting-Off')
        {
            # Detect the various kinds of NAS reboots
            # Remove all session entries for a given NAS.
            $sessdb->clearNas($nas_id, $p);
        }


As you can see, an Accounting-On or an Accounting-Off will clear the NAS, as 
will an accounting start with a session identifier of '00000000', as will an 
accounting start from a Client with a NasType of Cisco with a session 
identifier of '00000001'.

And here is the code for clearNas() in SessSQL.pm:


sub clearNas
{
    my ($self, $nas_id, $p) = @_;

    # query is optional
    return unless $self->{ClearNasQuery};

    # (Re)-connect to the database if necessary,
    return undef unless $self->reconnect;

    &main::log($main::LOG_DEBUG,
               "$self->{Identifier} Deleting all sessions for $nas_id");
    my $q = &Radius::Util::format_special($self->{ClearNasQuery}, $p);
    $self->do($q);
}


There is indeed a LOG_DEBUG message to indicate when it is called.


regards

Hugh


On Wed, 27 Feb 2002 16:34, Anton Krall wrote:
> Also when radiator does this.. Is there a log entry to show the action?
>
> Saludos
>
> Anton Krall
> Director de Tecnología
> Inter.net México / Panamá
>
> Tel; 5241-7609 Directo
> Tel: 5241-7600 Conmutador
> Celular: 0445-105-5160 Mobile
> ICQ: 4979450
> email:  akrall at team.inter.net
> web: http://www.mx.inter.net
>
> Outside Mexico:
> Office: +52(555)241-7609
> PBX: +52(555)241-7600
> Mobile: +52(555)105-5160
>
>
> Original > -----Original Message-----
> Original > From: owner-radiator at open.com.au
> Original > [mailto:owner-radiator at open.com.au] On Behalf Of
> Original > Frank Danielson
> Original > Sent: Martes, 26 de Febrero de 2002 06:47 p.m.
> Original > To: radiator at open.com.au; hugh at open.com.au
> Original > Subject: RE: (RADIATOR) Radonline flushing every 2 hours
> Original >
> Original >
> Original > Hugh-
> Original >
> Original > For general education purposes could you elaborate
> Original > on Radiator clearing entries for a NAS if it sees a
> Original > NAS restart? I'm not sure how Radiator would detect
> Original > that event and if some certain Client config is
> Original > needed support this.
> Original >
> Original > Thanks.
> Original >
> Original > -----Original Message-----
> Original > From: Hugh Irvine [mailto:hugh at open.com.au]
> Original > Sent: Tuesday, February 26, 2002 5:33 PM
> Original > To: akrall at team.inter.net; radiator at open.com.au
> Original > Subject: Re: (RADIATOR) Radonline flushing every 2 hours
> Original >
> Original >
> Original >
> Original > Hello Anton -
> Original >
> Original > Please send me a copy of your configuration file (no
> Original > secrets) together with a
> Original > trace 4 debug showing what is happening.
> Original >
> Original > Radiator will automatically remove all entries for a
> Original > NAS if it sees a NAS
> Original > restart, but I can't think of any reason why the
> Original > entire RADONLINE table would
> Original > be cleared.
> Original >
> Original > regards
> Original >
> Original > Hugh
> Original >
> Original >
> Original > On Wed, 27 Feb 2002 08:45, Anton Krall wrote:
> Original > > Guys.. Im having problems with my radonline table
> Original > on mysql.. Seems
> Original > > that every 2 hours.. The ocntents flush and start
> Original > from 0... Anybody
> Original > > has any problems like this?
> Original > >
> Original > > I noticed this because Im graphing the radonline
> Original > total user count
> Original > > every 5 minute from MRTG, and I noticed that every
> Original > 2 hours.. The
> Original > > database flushes and the graph on MRTG looks
> Original > funny... Like restarted
> Original > > from 0 every 2 hours..
> Original > >
> Original > > Anybody has any ideas?
> Original > >
> Original > > Saludos
> Original > >
> Original > > Anton Krall
> Original > > Director de Tecnología
> Original > > Inter.net México / Panamá
> Original > >
> Original > > Tel; 5241-7609 Directo
> Original > > Tel: 5241-7600 Conmutador
> Original > > Celular: 0445-105-5160 Mobile
> Original > > ICQ: 4979450
> Original > > email:  akrall at team.inter.net
> Original > > web: http://www.mx.inter.net
> Original > >
> Original > > Outside Mexico:
> Original > > Office: +52(555)241-7609
> Original > > PBX: +52(555)241-7600
> Original > > Mobile: +52(555)105-5160
> Original > >
> Original > > ===
> Original > > Archive at http://www.open.com.au/archives/radiator/
> Original > > Announcements on radiator-announce at open.com.au
> Original > > To unsubscribe, email 'majordomo at open.com.au' with
> Original > 'unsubscribe
> Original > > radiator' in the body of the message.
> Original >
> Original > --
> Original > Radiator: the most portable, flexible and
> Original > configurable RADIUS server anywhere. Available on
> Original > *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
> Original > -
> Original > Nets: internetwork inventory and management -
> Original > graphical, extensible, flexible with hardware,
> Original > software, platform and database independence. ===
> Original > Archive at http://www.open.com.au/archives/radiator/
> Original > Announcements on radiator-announce at open.com.au
> Original > To unsubscribe, email 'majordomo at open.com.au' with
> Original > 'unsubscribe radiator' in the body of the message.
> Original > ===
> Original > Archive at http://www.open.com.au/archives/radiator/
> Original > Announcements on radiator-announce at open.com.au
> Original > To unsubscribe, email 'majordomo at open.com.au' with
> Original > 'unsubscribe radiator' in the body of the message.
> Original >
> Original >

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
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