[nagiosplug] Accept multiple labels specified with "-l"
"Holger Weiss" <[email protected]> Fri, 24 Feb 2012 11:31:51 +0000
| Newsgroups | gmane.network.nagios.plugins.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module: nagiosplug Branch: master Commit: 0e3fa54782f8cbb47af058c4bf13688e8b23865b Author: Holger Weiss <[email protected]> Date: Fri Feb 24 12:29:00 2012 +0100 URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=0e3fa54 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.) --- plugins/check_snmp.c | 6 +++--- 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) if (labels == NULL) die (STATE_UNKNOWN, _("Could not reallocate labels\n")); } - labels++; + nlabels++; ptr = thisarg (ptr); if (strstr (ptr, "'") == ptr) labels[nlabels - 1] = ptr + 1; @@ -1072,8 +1072,8 @@ print_help (void) printf ("\n"); printf ("%s\n", _("Notes:")); - printf (" %s\n", _("- Multiple OIDs may be indicated by a comma or space-delimited list (lists with")); - printf (" %s %i %s\n", _("internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs.")); + printf (" %s\n", _("- Multiple OIDs (and labels) may be indicated by a comma or space-delimited ")); + printf (" %s %i %s\n", _("list (lists with internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs.")); printf(" -%s", UT_THRESHOLDS_NOTES); ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/