summaryrefslogtreecommitdiffstats
path: root/plugins/check_snmp.c
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2012-02-24 11:29:00 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2012-02-24 11:29:00 (GMT)
commit0e3fa54782f8cbb47af058c4bf13688e8b23865b (patch)
tree8c2e2ac255bd0125a7c8e38bab6ee9c165d7a28c /plugins/check_snmp.c
parent4011599466b8247ced0b6400b72e16620636d0fc (diff)
downloadmonitoring-plugins-0e3fa54782f8cbb47af058c4bf13688e8b23865b.tar.gz
Accept multiple labels specified with "-l"
Fix the code which accepts a comma-separated list of labels specified via the "-l" option. (Spotted by Oskar Liljeblad in Debian bug report #647020, forwarded by Jan Wagner.)
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r--plugins/check_snmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index d79da8c..6c90909 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -749,7 +749,7 @@ process_arguments (int argc, char **argv)
749 if (labels == NULL) 749 if (labels == NULL)
750 die (STATE_UNKNOWN, _("Could not reallocate labels\n")); 750 die (STATE_UNKNOWN, _("Could not reallocate labels\n"));
751 } 751 }
752 labels++; 752 nlabels++;
753 ptr = thisarg (ptr); 753 ptr = thisarg (ptr);
754 if (strstr (ptr, "'") == ptr) 754 if (strstr (ptr, "'") == ptr)
755 labels[nlabels - 1] = ptr + 1; 755 labels[nlabels - 1] = ptr + 1;
@@ -1072,8 +1072,8 @@ print_help (void)
1072 1072
1073 printf ("\n"); 1073 printf ("\n");
1074 printf ("%s\n", _("Notes:")); 1074 printf ("%s\n", _("Notes:"));
1075 printf (" %s\n", _("- Multiple OIDs may be indicated by a comma or space-delimited list (lists with")); 1075 printf (" %s\n", _("- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "));
1076 printf (" %s %i %s\n", _("internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs.")); 1076 printf (" %s %i %s\n", _("list (lists with internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs."));
1077 1077
1078 printf(" -%s", UT_THRESHOLDS_NOTES); 1078 printf(" -%s", UT_THRESHOLDS_NOTES);
1079 1079