Two patches for free space monitors, to give them the same feature: the
ability to specify an SNMP community name in the environment, and thus
not display it in the command line for peering eyes to see in the Mon
interface (with the name of the monitor program in the details view).

        -- Ed

--- snmpdiskspace.monitor       2004/05/05 13:34:42     1.1
+++ snmpdiskspace.monitor       2005/01/12 01:32:13
@@ -130,7 +130,7 @@


 # Read in defaults
-my $COMM               = $opt{"community"} || "public";
+my $COMM               = $opt{"community"} || $ENV{"COMMUNITY"} || "public";
 my $TIMEOUT    = $opt{"timeout"} * 100000 || 2000000;   #default timeout is 20 
seconds
 my $RETRIES    = $opt{"retries"} || 5;
 my $CONFIG     = $opt{"config"} || (-d "/etc/mon" ? "/etc/mon" : 
"/usr/lib/mon/mon.d")


------------------------------------------------------
--- netsnmp-freespace.monitor   2005/01/12 01:46:25     1.1
+++ netsnmp-freespace.monitor   2005/01/12 01:46:36
@@ -43,7 +43,7 @@
 $ENV{'MIBS'} = "UCD-SNMP-MIB";

 getopts("c:");
-$community = $opt_c || 'public';
+$community = $opt_c || $ENV{'COMMUNITY'} || 'public';

 $RETVAL = 0;

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to