File: sshd2

package info (click to toggle)
logwatch 5.2.2-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,112 kB
  • ctags: 42
  • sloc: perl: 9,032; sh: 65; makefile: 54
file content (47 lines) | stat: -rwxr-xr-x 1,376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl -w
##########################################################################
# $Id: sshd2,v 1.5 2003/12/15 18:09:23 kirk Exp $
##########################################################################

########################################################
# This was written and is maintained by:
#    Gerald Teschl <gerald@esi.ac.at>
#
# Please send all comments, suggestions, bug reports,
#    etc, to and kirk@kaybee.org.
########################################################

$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;

while (defined($ThisLine = <STDIN>)) {
   if ( ($ThisLine =~ /^Daemon is running.$/) or
         ($ThisLine =~ /^Listener created on port .*$/) or
         ($ThisLine =~ /^sshd2$/) ) {
      # don't care about these
   }
   elsif ( $ThisLine =~ /^Starting sshd2: $/ ) {
      $Started++;
   }
   else {
      # Report any unmatched entries...
      chomp($ThisLine);
      $OtherList{$ThisLine}++;
   }
}

if ( ($Detail >= 10) and ($Started) ) {
   print "\nStatistics:\n";
   print "   Sshd2 started: $Started Time(s)\n";
}

if (keys %OtherList) {
   print "\n**Unmatched Entries**\n";
   foreach $ThisOne (keys %OtherList) {
      print "$ThisOne: $OtherList{$ThisOne} Time(s)\n";
   }
}                                                                                       
    
exit(0);

# vi: shiftwidth=3 tabstop=3 et