2 ##########################################################################
4 ##########################################################################
8 $Debug = ValueOrDefault($ENV{'LOGWATCH_DEBUG'}, 0);
9 $Detail = ValueOrDefault($ENV{'LOGWATCH_DETAIL_LEVEL'}, 0);
11 # Avoid "Use of uninitialized value" warning messages.
13 my ($value, $default) = @_;
14 return ($value ? $value : $default);
18 print STDERR "\n\nDEBUG: Inside DIALUP Filter \n\n";
22 while (defined($ThisLine = <STDIN>)) {
24 print STDERR "DEBUG($DebugCounter): $ThisLine";
29 if ( $ThisLine =~ /^pppd (\d+).(\d+).(\d+) started by root, uid (\d+)/ )
33 print STDERR "DEBUG: Found PPP start\n";
37 elsif ( $ThisLine =~ /^Connection terminated./ )
41 print STDERR "DEBUG: Found PPP down\n";
45 elsif ( $ThisLine =~ /^PPP session is (\d+)/ )
49 print STDERR "DEBUG: Found PPP connect\n";
53 elsif ( $ThisLine =~ /^Connect time (\d+).(\d+) minutes./ )
57 print STDERR "DEBUG: Found PPP connecttime $1\n";
59 $Uptime += $1 + ($2 / 10);
63 ###########################################################
67 print "PPP Dial attempts: " . $Starts . " Time(s)\n";
72 print "PPP Connected: " . $Ups . " Time(s)\n";
77 print "PPP Disconnected: " . $Downs . " Time(s)\n";
82 print "Total connect time: " . $Uptime . " Minutes\n";
87 # vi: shiftwidth=3 tabstop=3 syntax=perl et