[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2235] nagiosplug/trunk/plugins/check_snmp.c

dermoth at users.sourceforge.net dermoth at users.sourceforge.net
Sat Aug 1 05:38:22 CEST 2009


Revision: 2235
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2235&view=rev
Author:   dermoth
Date:     2009-08-01 03:38:22 +0000 (Sat, 01 Aug 2009)

Log Message:
-----------
Fix check_snmp passing single-quotes as -m argument when it should be empty

From: Thomas Guyot-Sionnest <dermoth at aei.ca>

Modified Paths:
--------------
    nagiosplug/trunk/plugins/check_snmp.c

Modified: nagiosplug/trunk/plugins/check_snmp.c
===================================================================
--- nagiosplug/trunk/plugins/check_snmp.c	2009-07-31 07:53:30 UTC (rev 2234)
+++ nagiosplug/trunk/plugins/check_snmp.c	2009-08-01 03:38:22 UTC (rev 2235)
@@ -207,7 +207,7 @@
 
 	/* This is just for display purposes, so it can remain a string */
 	asprintf(&cl_hidden_auth, "%s -t %d -r %d -m %s -v %s %s %s:%s",
-		snmpcmd, timeout_interval, retries, miblist, proto, "[authpriv]",
+		snmpcmd, timeout_interval, retries, strlen(miblist) ? miblist : "''", proto, "[authpriv]",
 		server_address, port);
 
 	for (i = 0; i < numoids; i++) {
@@ -256,7 +256,7 @@
 		oidname = strpcpy (oidname, ptr, delimiter);
 		response = strstr (ptr, delimiter);
 		if (verbose > 2) {
-			printf("Processing line %i\n  line: %s\n  oidname: %s\n  response: %s\n", i+1, ptr, oidname, response);
+			printf("Processing line %i\n  oidname: %s\n  response: %s\n", i+1, oidname, response);
 		}
 
 		/* We strip out the datatype indicator for PHBs */
@@ -647,7 +647,7 @@
 		if ( needmibs == TRUE ) {
 			miblist = strdup (DEFAULT_MIBLIST);
 		}else{
-			miblist = "''";			/* don't read any mib files for numeric oids */
+			miblist = "";			/* don't read any mib files for numeric oids */
 		}
 	}
 


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




More information about the Commits mailing list