SF.net SVN: logwatch:[325] trunk

[email protected] Sat, 20 Feb 2016 21:13:23 +0000
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Revision: 325
          http://sourceforge.net/p/logwatch/code/325
Author:   stefjakobs
Date:     2016-02-20 21:13:23 +0000 (Sat, 20 Feb 2016)
Log Message:
-----------
Bug #46: make path to ifconfig configurable

Modified Paths:
--------------
    trunk/conf/services/zz-network.conf
    trunk/scripts/services/zz-network

Modified: trunk/conf/services/zz-network.conf
===================================================================
--- trunk/conf/services/zz-network.conf	2016-02-20 20:57:10 UTC (rev 324)
+++ trunk/conf/services/zz-network.conf	2016-02-20 21:13:23 UTC (rev 325)
@@ -26,6 +26,7 @@
 # $pathto_sysctl_conf=/etc/sysctl.conf
 # $pathto_routeadm=/usr/sbin/routeadm
 # $pathto_ip=/sbin/ip
+# $pathto_ifconfig=/sbin/ifconfig
 
 ########################################################
 # Please send all comments, suggestions, bug reports,

Modified: trunk/scripts/services/zz-network
===================================================================
--- trunk/scripts/services/zz-network	2016-02-20 20:57:10 UTC (rev 324)
+++ trunk/scripts/services/zz-network	2016-02-20 21:13:23 UTC (rev 325)
@@ -1,26 +1,4 @@
 ##########################################################################
-# $Id$
-##########################################################################
-# $Log: zz-network,v $
-# Revision 1.6  2008/06/30 23:07:51  kirk
-# fixed copyright holders for files where I know who they should be
-#
-# Revision 1.5  2008/03/24 23:31:27  kirk
-# added copyright/license notice to each script
-#
-# Revision 1.4  2007/03/13 22:07:59  mike
-# Solaris 11 patch from Attila Csaba Marosi -mgt
-#
-# Revision 1.3  2006/02/24 16:05:27  bjorn
-# Corrected syntax, by Markus Lude.
-#
-# Revision 1.2  2006/02/02 22:08:49  bjorn
-# Clean-up (removed unused functions, fixed typos).  No functional changes.
-#
-# Revision 1.1  2005/05/04 15:54:56  bjorn
-# zz-network submitted by Laurent Dufour
-#
-##########################################################################
 
 #######################################################
 ## Copyright (c) 2008 Laurent Dufour
@@ -55,6 +33,7 @@
 my $pathto_vtysh = $ENV{'pathto_vtysh'} || '/usr/bin/vtysh';
 my $pathto_routeadm = $ENV{'pathto_routeadm'} || '/usr/sbin/routeadm';
 my $pathto_ip = $ENV{'pathto_ip'} || '/sbin/ip';
+my $pathto_ifconfig = $ENV{'pathto_ifconfig'} || '/sbin/ifconfig';
 
 my @ethernet_iface_list;
 my @other_iface_list;
@@ -265,7 +244,7 @@
         }
         else
         {
-         $cmd_to_show_int="/sbin/ifconfig -a";
+         $cmd_to_show_int="$pathto_ifconfig -a";
         }
 
                 open(NET, "$cmd_to_show_int |")  || die "can't run $cmd_to_show_int: $!";
@@ -305,7 +284,7 @@
 sub IfconfigIface {
 
         my ($iface) = $_[0];
-                open(NET, "ifconfig $iface |")  || die "can't run ifconfig: $!";
+                open(NET, "$pathto_ifconfig $iface |")  || die "can't run ifconfig: $!";
                 while (<NET>)
                  {
                    print $_;
@@ -364,7 +343,7 @@
 
 	my $cmd_to_show_int="";
 
-        $cmd_to_show_int="/sbin/ifconfig -a";
+        $cmd_to_show_int="$pathto_ifconfig -a";
 
         open(NET, "$cmd_to_show_int |")  || die "can't use $cmd_to_show_int: $!";
         while (<NET>)
@@ -414,7 +393,7 @@
 	# Run through twice; a single interface plumbed with both IPv4 and IPv6
 	# can be listed separately, but shouldn't count as two interfaces
 	foreach my $ip (qw( 4 6 )) {
-	    open(NET, "/usr/sbin/ifconfig -a$ip |")  || die "can't run '/usr/sbin/ifconfig -a$ip': $!";
+	    open(NET, "$pathto_ifconfig -a$ip |")  || die "can't run '$pathto_ifconfig -a$ip': $!";
 	    while (<NET>)
 	     {
 	       if ($_ =~ /^(\w+\d+(?::\d+)?): flags=\d+<[^>]+> mtu (\d+)/) {
@@ -435,7 +414,7 @@
 			}
 		}
 	      }
-	    close(NET)                    || die "can't use '/usr/sbin/ifconfig -a$ip': $!";
+	    close(NET)                    || die "can't use '$pathto_ifconfig -a$ip': $!";
 	}
 
         }
@@ -468,7 +447,7 @@
                  }
             }
           }
-        close(NET)                    || die "can't run ifconfig: $!";
+        close(NET)                    || die "can't run fconfig: $!";
 
         }
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140