|
Packit Bot |
ea69bd |
#########################################################################
|
|
Packit Bot |
ea69bd |
# $Id$
|
|
Packit Bot |
ea69bd |
##########################################################################
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
########################################################
|
|
Packit Bot |
ea69bd |
# This was written and is maintained by:
|
|
Packit Bot |
ea69bd |
# Laurent DUFOUR <laurent.dufour@havas.com>,<dufour_l@hotmail.com>
|
|
Packit Bot |
ea69bd |
# based on the work of
|
|
Packit Bot |
ea69bd |
# Kirk Bauer <kirk@kaybee.org>
|
|
Packit Bot |
ea69bd |
#
|
|
Packit Bot |
ea69bd |
# Please send all comments, suggestions, bug reports,
|
|
Packit Bot |
ea69bd |
# etc, to laurent.dufour@havas.com
|
|
Packit Bot |
ea69bd |
########################################################
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
#####################################################
|
|
Packit Bot |
ea69bd |
## Copyright (c) 2008 Laurent DUFOUR
|
|
Packit Bot |
ea69bd |
## Covered under the included MIT/X-Consortium License:
|
|
Packit Bot |
ea69bd |
## http://www.opensource.org/licenses/mit-license.php
|
|
Packit Bot |
ea69bd |
## All modifications and contributions by other persons to
|
|
Packit Bot |
ea69bd |
## this script are assumed to have been donated to the
|
|
Packit Bot |
ea69bd |
## Logwatch project and thus assume the above copyright
|
|
Packit Bot |
ea69bd |
## and licensing terms. If you want to make contributions
|
|
Packit Bot |
ea69bd |
## under your own copyright or a different license this
|
|
Packit Bot |
ea69bd |
## must be explicitly stated in the contribution an the
|
|
Packit Bot |
ea69bd |
## Logwatch project reserves the right to not accept such
|
|
Packit Bot |
ea69bd |
## contributions. If you have made significant
|
|
Packit Bot |
ea69bd |
## contributions to this script and want to claim
|
|
Packit Bot |
ea69bd |
## copyright please contact logwatch-devel@lists.sourceforge.net.
|
|
Packit Bot |
ea69bd |
#########################################################
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
use Logwatch ':all';
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
$Debug = ValueOrDefault($ENV{'LOGWATCH_DEBUG'}, 0);
|
|
Packit Bot |
ea69bd |
$Detail = ValueOrDefault($ENV{'LOGWATCH_DETAIL_LEVEL'}, 0);
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
# Avoid "Use of uninitialized value" warning messages.
|
|
Packit Bot |
ea69bd |
sub ValueOrDefault {
|
|
Packit Bot |
ea69bd |
my ($value, $default) = @_;
|
|
Packit Bot |
ea69bd |
return ($value ? $value : $default);
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( $Debug >= 5 ) {
|
|
Packit Bot |
ea69bd |
print STDERR "\n\nDEBUG: Inside NETOPIA Filter \n\n";
|
|
Packit Bot |
ea69bd |
$DebugCounter = 1;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
my ($month,$day,$time,$host_ip,$host,$conn,$msg,$message);
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
while (defined($ThisLine = <STDIN>)) {
|
|
Packit Bot |
ea69bd |
if ( $Debug >= 30 ) {
|
|
Packit Bot |
ea69bd |
print STDERR "DEBUG($DebugCounter): $ThisLine";
|
|
Packit Bot |
ea69bd |
$DebugCounter++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
($month,$day,$time,$host_ip,$host,$msg)=split(/ +/,$ThisLine,7);
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ($ThisLine =~ /traffic/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /Copyright/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /removed due to simultaneous rekey/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /Responded to the first peer message/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /NBR change/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /accept udp/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /accept tcp/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /accept icmp/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /accept ip/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /denied udp/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /denied tcp/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /denied icmp/ ) or
|
|
Packit Bot |
ea69bd |
($ThisLine =~ /denied ip/ )
|
|
Packit Bot |
ea69bd |
) {
|
|
Packit Bot |
ea69bd |
# don't care about this, will code this later
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($src_ip,$dst_ip) = ($ThisLine =~ /IP: Demand call requested by (\d+\.\d+\.\d+\.\d+) to IP destination (\d+\.\d+\.\d+\.\d+)/) ) {
|
|
Packit Bot |
ea69bd |
$IPDemandCall{$host}{$src_ip," ",$dst_ip}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPP: NCP up, (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPNcpUp{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPP: IPCP down, (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPIpCpDown{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPP: MSCHAP-v2 we accepted remote, (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPAccepted{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPP: MSCHAP-v2 remote accepted us, (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPAccepted{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPP: CCP negotiated, (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPCcpNeg{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPP: IPCP negotiated, (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPIpCpNeg{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($dst_ip,$msg) = ($ThisLine =~ /PPP: Channel (.+) up, Dialout Profile name: (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPChannelUp{$host}{$dst_ip}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($dst_ip,$msg) = ($ThisLine =~ /PPP: Channel (.+) up, Answer Profile name: (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPPChannelUp{$host}{$dst_ip}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPTP-1 down: (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPTP1Down{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /PPTP-2 down: (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPTP2Down{$host}{$interface}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($dst_ip,$msg) = ($ThisLine =~ /PPTP: IP down, rem: (\d+\.\d+\.\d+\.\d+) (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPTPIpDown{$host}{$dst_ip}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($dst_ip,$msg) = ($ThisLine =~ /PPTP: IP up, rem: (\d+\.\d+\.\d+\.\d+), (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$PPTPIpUp{$host}{$dst_ip}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($dst_ip,$msg) = ($ThisLine =~ /System Config saved from host (\d+\.\d+\.\d+\.\d+) (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$SysCfgSaved{$host}{LookupIP($dst_ip)}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($dst_ip,$msg) = ($ThisLine =~ /The system configuration was saved from host (\d+\.\d+\.\d+\.\d+) by (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$SysCfgSaved{$host}{LookupIP($dst_ip)}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /Compiled/) ) {
|
|
Packit Bot |
ea69bd |
$Started{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /DNS entries have been automatically refreshed./) ) {
|
|
Packit Bot |
ea69bd |
$DNSRefreshed{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /DNS has been refreshed./) ) {
|
|
Packit Bot |
ea69bd |
$DNSRefreshed{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /Syslog host domain name has been changed/) ) {
|
|
Packit Bot |
ea69bd |
$SyslogHost{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /Syslog facility has been changed/) ) {
|
|
Packit Bot |
ea69bd |
$SyslogFacility{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /Syslog security facility has been changed/) ) {
|
|
Packit Bot |
ea69bd |
$SyslogFacility{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /The system clock has been updated through NTP./) ) {
|
|
Packit Bot |
ea69bd |
$NTPUpdated{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($ThisLine =~ /failed to get clock through NTP/) ) {
|
|
Packit Bot |
ea69bd |
$NTPFailed{$host}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($message) = ($ThisLine =~ /RELOAD: (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$ReloadRequested{$host}{$message}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($message) = ($ThisLine =~ /RESTART: (.*)/) ) {
|
|
Packit Bot |
ea69bd |
$Restarted{$host}{$message}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( ($interface) = ($ThisLine =~ /Admin User "(\S+)" logged in for Web\((\S+)\) management \(port (\d+)\) from (.+):(.+). (.*)/) ) {
|
|
Packit Bot |
ea69bd |
if ($Debug >= 5) {
|
|
Packit Bot |
ea69bd |
print STDERR "DEBUG: Found -$1 logged in from $4 using $2\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
if ($Detail >= 20) {
|
|
Packit Bot |
ea69bd |
$Users{$host}{$2}{$4}{$1}++;
|
|
Packit Bot |
ea69bd |
} else {
|
|
Packit Bot |
ea69bd |
$Users{$host}{$2}{$4}{"(all)"}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( $ThisLine =~ m/Admin user (\S+) login attempt for (\S+) management \(port (\d+)\) from (.+):(.+). failed. (.*)/ ) {
|
|
Packit Bot |
ea69bd |
if ( $Debug >= 5 ) {
|
|
Packit Bot |
ea69bd |
print STDERR "DEBUG: Found -Failed login- line\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
my $name = LookupIP($4);
|
|
Packit Bot |
ea69bd |
$BadLogins{$host}{"$1/$2 from $name"}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
elsif ( $ThisLine =~ m/SSH client at (.+) has attempted to make an SCS connection to interface untrust with IP (.+) but failed (.*)/ ) {
|
|
Packit Bot |
ea69bd |
my $name = LookupIP($2);
|
|
Packit Bot |
ea69bd |
$Temp = "SSH from $name";
|
|
Packit Bot |
ea69bd |
$BadLogins{$host}{$Temp}++;
|
|
Packit Bot |
ea69bd |
$IllegalUsers{$host}{$Temp}++;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
else {
|
|
Packit Bot |
ea69bd |
# Report any unmatched entries...
|
|
Packit Bot |
ea69bd |
push @OtherList,$ThisLine;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %Started) {
|
|
Packit Bot |
ea69bd |
print "\nDevice started :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %Started) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$Started{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t Started" .$ThatOne . "\t: " . $Started{$ThisOne}{$ThatOne} . "{ Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %IPDemandCall) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where ip demand call have been requested :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %IPDemandCall) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$IPDemandCall{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $IPDemandCall{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPPNcpUp) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPP Ncp UP :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPPNcpUp) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPPNcpUp{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPPNcpUp{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPPCcpUp) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPP CCP NEGOTIATED :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPPCcpNeg) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPPCcpNeg{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPPCcpNeg{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPPIpCpDown) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPP IPCP down :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPPIpCpDown) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPPIpCpDown{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPPIpCpDown{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPPIpCpNeg) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPP IPCP NEGOTIATED :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPPIpCpNeg) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPPIpCpNeg{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPPIpCpNeg{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %NTPUpdated) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where The system clock has been updated through NTP :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %NTPUpdated) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$NTPUpdated{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $NTPUpdated{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %NTPFailed) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where failed to get clock through NTP :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %NTPFailed) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$NTPFailed{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $NTPFailed{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %DNSRefreshed) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where DNS have been refreshed :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %DNSRefreshed) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$DNSRefreshed{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $DNSRefreshed{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %DNSRefreshed) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where DNS have been refreshed :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %DNSRefreshed) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$DNSRefreshed{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $DNSRefreshed{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPPAccepted) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPP is accepted :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPPAccepted) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPPAccepted{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPPAccepted{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPTP1Down) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPTP-1 is down :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPTP1Down) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPTP1Down{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPTP1Down{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPTP2Down) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPTP-2 is down :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPTP2Down) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPTP2Down{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPTP2Down{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %SyslogFacility) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where Syslog facility has been changed :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %SyslogFacility) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$SyslogFacility{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $SyslogFacility{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %SyslogHost) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where Syslog host has been changed :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %SyslogHost) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$SyslogHost{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $SyslogHost{$ThisOne}{$ThisOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %Restarted) {
|
|
Packit Bot |
ea69bd |
print "\nDevice restarted :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %Restarted) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$Restarted{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $Restarted{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %ReloadRequested) {
|
|
Packit Bot |
ea69bd |
print "\nDevice reload requested :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %ReloadRequested) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$ReloadRequested{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $ReloadRequested{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %PPPChannelUp) {
|
|
Packit Bot |
ea69bd |
print "\nVPN Up PPP Channel :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPPChannelUp) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPPChannelUp{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPPChannelUp{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %PPTPIpDown) {
|
|
Packit Bot |
ea69bd |
print "\nVPN Down on :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPTPIpDown) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPTPIpDown{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPTPIpDown{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ( ( $Detail >= 15 ) and (keys %PPTPIpUp) ) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where PPTP is UP :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %PPTPIpUp) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$PPTPIpUp{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $PPTPIpUp{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %SysCfgSaved) {
|
|
Packit Bot |
ea69bd |
print "\nDevice where system config have been saved :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %SysCfgSaved) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
foreach $ThatOne (keys %{$SysCfgSaved{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t " .$ThatOne . "\t: " . $SysCfgSaved{$ThisOne}{$ThatOne} . " Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %BadLogins) {
|
|
Packit Bot |
ea69bd |
print "\nFailed logins from these:\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %BadLogins) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
for (sort keys %{$BadLogins{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t $_: $BadLogins{$ThisOne}{$_} Time(s)\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %IllegalUsers) {
|
|
Packit Bot |
ea69bd |
print "\nIllegal users from these:\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %IllegalUsers) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
for (sort keys %{$IllegalUsers{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print "\t $_: $IllegalUsers{$ThisOne}{$_} Time(s)\n";
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if (keys %Users) {
|
|
Packit Bot |
ea69bd |
print "\nUsers logging in through :\n";
|
|
Packit Bot |
ea69bd |
foreach $ThisOne (keys %Users) {
|
|
Packit Bot |
ea69bd |
print " " . $ThisOne . ":\n";
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
foreach $user (sort {$a cmp $b} keys %{$Users{$ThisOne}}) {
|
|
Packit Bot |
ea69bd |
print " $user:\n";
|
|
Packit Bot |
ea69bd |
my $totalSort = TotalCountOrder(%{$Users{$ThisOne}{$user}}, \&SortIP);
|
|
Packit Bot |
ea69bd |
foreach my $ip (sort $totalSort keys %{$Users{$ThisOne}{$user}}) {
|
|
Packit Bot |
ea69bd |
my $name = LookupIP($ip);
|
|
Packit Bot |
ea69bd |
if ($Detail >= 20) {
|
|
Packit Bot |
ea69bd |
print " $name:\n";
|
|
Packit Bot |
ea69bd |
my $sort = CountOrder(%{$Users{$ThisOne}{$user}{$ip}});
|
|
Packit Bot |
ea69bd |
foreach my $method (sort $sort keys %{$Users{$ThisOne}{$user}{$ip}}) {
|
|
Packit Bot |
ea69bd |
my $val = $Users{$ThisOne}{$user}{$ip}{$method};
|
|
Packit Bot |
ea69bd |
my $plural = ($val > 1) ? "s" : "";
|
|
Packit Bot |
ea69bd |
print " $method: $val time$plural\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
} else {
|
|
Packit Bot |
ea69bd |
my $val = (values %{$Users{$ThisOne}{$user}{$ip}})[0];
|
|
Packit Bot |
ea69bd |
my $plural = ($val > 1) ? "s" : "";
|
|
Packit Bot |
ea69bd |
print " $name: $val time$plural\n";
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
if ($#OtherList >= 0) {
|
|
Packit Bot |
ea69bd |
print "\n**Unmatched Entries**\n";
|
|
Packit Bot |
ea69bd |
print @OtherList;
|
|
Packit Bot |
ea69bd |
}
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
exit(0);
|
|
Packit Bot |
ea69bd |
|
|
Packit Bot |
ea69bd |
# vi: shiftwidth=3 tabstop=3 syntax=perl et
|
|
Packit Bot |
ea69bd |
# Local Variables:
|
|
Packit Bot |
ea69bd |
# mode: perl
|
|
Packit Bot |
ea69bd |
# perl-indent-level: 3
|
|
Packit Bot |
ea69bd |
# indent-tabs-mode: nil
|
|
Packit Bot |
ea69bd |
# End:
|