On Mon, 20 Jan 2003 05:38 pm, Peter Nixon wrote:
> On Sat, 18 Jan 2003 01:59 am, Andy Melton wrote:
> > I have recently installed a Free Radius server to collect accounting
> > output from a Cisco AS5350.  Up until today, it was working fine, but at
> > 4:00 pst yesterday, the timestamps from the accounting record are
> > prepended by an *.
> >
> > I'm not sure if this was caused by the AS5350, which I'm guessing it is,
> > but has anyone seen this and do you know how to strip off that *?
> >
> > Thanks for your help.
>
> Yes. I have had this problem in the past. It happens when your ciscos loose
> NTP timesync. I have fixed it in two ways.
> a) I run multiple local NTP servers
> b) I use Postgres 7.3 as my backend DB. I have an embeded regexp perl
> function that strips out the asterix if there is one before inserting into
> the DB field.

OK. Here is the Postgres functions I use if anyone is interested.

/*
 * --- Peter Nixon [ [EMAIL PROTECTED] ]
 * Remove . from the start of time fields (routers that have lost ntp timesync 
temporarily)
 *  * Used as:
 *      insert into mytable values (strip_dot('.16:46:02.356 EET Wed Dec 11 
2002'));
 */

/*
 * On SuSE do..
 * # ln -s /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so 
/usr/lib/libperl.so
 * # createlang -U postgres plperl radius
 */

CREATE OR REPLACE function strip_dot (text) returns timestamp as '
        my $datetime = $_[0];
        $datetime =~ s/^\\.*//;
        return $datetime;
' language 'plperl';


-Peter

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to