From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/136758-mmmm | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 web/attachments/136758-mmmm (limited to 'web/attachments/136758-mmmm') diff --git a/web/attachments/136758-mmmm b/web/attachments/136758-mmmm new file mode 100644 index 0000000..768eb35 --- /dev/null +++ b/web/attachments/136758-mmmm @@ -0,0 +1,75 @@ +*** check_snmp.c.old Tue May 31 22:09:23 2005 +--- check_snmp.c Tue May 31 23:35:45 2005 +*************** +*** 336,341 **** +--- 336,342 ---- + + i++; + ++ /* I think this declaration here is bad syntax, and compilation fails */ + char *str[MAX_INPUT_BUFFER]; + asprintf(str, "=%s%s;;;; ", show, type ? type : ""); + strcat(perfstr, *str); +*************** +*** 376,381 **** +--- 377,383 ---- + char *ptr; + int c = 1; + int j = 0, jj = 0, ii = 0; ++ int needmibs = FALSE; + + int option = 0; + static struct option longopts[] = { +*************** +*** 510,515 **** +--- 512,525 ---- + retries = atoi(optarg); + break; + case 'o': /* object identifier */ ++ if ( strspn( optarg, "0123456789." ) != strlen( optarg ) ) { ++ /* ++ * we have something other than digits and periods, so we ++ * have a mib variable, rather than just an SNMP OID, so ++ * we have to actually read the mib files ++ */ ++ needmibs = TRUE; ++ } + for (ptr = optarg; (ptr = index (ptr, ',')); ptr++) + ptr[0] = ' '; /* relpace comma with space */ + for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++) +*************** +*** 628,633 **** +--- 638,646 ---- + if (community == NULL) + community = strdup (DEFAULT_COMMUNITY); + ++ if ( ! needmibs ) ++ miblist = "''"; /* don't read any MIB files */ ++ + return validate_arguments (); + } + +*************** +*** 913,921 **** + /* OID Stuff */ + printf (_("\ + -o, --oid=OID(s)\n\ +! Object identifier(s) whose value you wish to query\n\ + -m, --miblist=STRING\n\ +! List of MIBS to be loaded (default = ALL)\n -d, --delimiter=STRING\n\ + Delimiter to use when parsing returned data. Default is \"%s\"\n\ + Any data on the right hand side of the delimiter is considered\n\ + to be the data that should be used in the evaluation.\n"), DEFAULT_DELIMITER); +--- 926,937 ---- + /* OID Stuff */ + printf (_("\ + -o, --oid=OID(s)\n\ +! Object identifier(s) or SNMP variables whose value you wish to query\n\ + -m, --miblist=STRING\n\ +! List of MIBS to be loaded (default = ALL)\n\ +! Set empty if polling only OIDs, and not SNMP variables\n\ +! (since no MIB files are needed if we already have the OIDs)\n\ +! -d, --delimiter=STRING\n\ + Delimiter to use when parsing returned data. Default is \"%s\"\n\ + Any data on the right hand side of the delimiter is considered\n\ + to be the data that should be used in the evaluation.\n"), DEFAULT_DELIMITER); -- cgit v1.2.3-74-g34f1