Small Cisco patch

Hugo van der Kooij <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Hi,

Bjorn has helped me out to improve the sorting of the results in the 
Cisco module. The small patch that resulted is included. In fact most of 
it is created by Bjorn.

It works for me and won't hurt as far as I can tell.

Hugo.

-- 
 	[email protected]	http://hugo.vanderkooij.org/
 	    This message is using 100% recycled electrons.

 	Some men see computers as they are and say "Windows"
 	I use computers with Linux and say "Why Windows?"
 		(Thanks JFK, for the insight.)

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
cisco.patch (text/plain, 1.4 KB)
--- cisco.SHIPPED	2007-05-08 22:01:36.000000000 +0200
+++ cisco	2007-05-14 20:40:11.000000000 +0200
@@ -1072,7 +1072,7 @@
 
 if (keys %ACL) {
    print "\nAccess Control Lists:\n";
-   foreach $ThisOne (sort keys %ACL) {
+   foreach $ThisOne (sort {($a =~/\/(\d+)/)[0] <=> ($b =~ /\/(\d+)/)[0]} keys %ACL) {
       print "   " . $ThisOne . " : " . $ACL{$ThisOne} . " Hit(s)\n";
    }
    print "   Total : " . $packets . " Hit(s)\n";
@@ -1094,7 +1094,7 @@
 
 if (keys %dropsmtphost) {
    print "  SMTP servers:\n";
-   foreach $ThisOne (sort keys %dropsmtphost) {
+   foreach $ThisOne (sort SortIP keys %dropsmtphost) {
       if ($dropsmtphost{$ThisOne} > 1) {
          print "   " . $ThisOne . " : " . $dropsmtphost{$ThisOne} . " Drops\n";
       }
@@ -1104,7 +1104,7 @@
 
 if (keys %drophttphost) {
    print "  HTTP servers:\n";
-   foreach $ThisOne (sort keys %drophttphost) {
+   foreach $ThisOne (sort SortIP keys %drophttphost) {
       if ($drophttphost{$ThisOne} > 1) {
          print "   " . $ThisOne . " : " . $drophttphost{$ThisOne} . " Drop(s)\n";
       }
@@ -1118,7 +1118,7 @@
 
 if (keys %SSH) {
    print "\nSSH access:\n";
-   foreach $ThisOne (sort keys %SSH) {
+   foreach $ThisOne (sort SortIP keys %SSH) {
       print "   " . $ThisOne . " : " . $SSH{$ThisOne} . " Hit(s)\n";
    }
    print "   Total : " . $SSH_packets . " Hit(s)\n";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.