Code

Fix --help output when MAX_OIDS is altered.
[nagiosplug.git] / plugins / check_snmp.c
index b16428fe0b02e78651cc86d27629dcfd01e68dbd..f32a26ebeaed628f4f1b682f022945832f249176 100644 (file)
@@ -424,7 +424,7 @@ main (int argc, char **argv)
                                                        temp_double+=(double)18446744069414584320.0; /* 2^64-2^32 */;
                                        }
                                        /* Convert to per second, then use multiplier */
-                                       temp_double = temp_double/(duration*rate_multiplier);
+                                       temp_double = temp_double/duration*rate_multiplier;
                                        iresult = get_status(temp_double, thlds[i]);
                                        asprintf (&show, conv, temp_double);
                                }
@@ -493,8 +493,6 @@ main (int argc, char **argv)
                                temp_string=labels[i];
                        else
                                temp_string=oidname;
-                       if(calculate_rate)
-                               asprintf(&temp_string,"%s-rate",temp_string);
                        strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
                        strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
                        len = sizeof(perfstr)-strlen(perfstr)-1;
@@ -798,7 +796,7 @@ process_arguments (int argc, char **argv)
                        calculate_rate = 1;
                        break;
                case L_RATE_MULTIPLIER:
-                       if(!is_integer(optarg)||(rate_multiplier=atoi(optarg)<=0))
+                       if(!is_integer(optarg)||((rate_multiplier=atoi(optarg))<=0))
                                usage2(_("Rate multiplier must be a positive integer"),optarg);
                        break;
                case L_INVERT_SEARCH:
@@ -1078,8 +1076,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\n", _("internal spaces must be quoted) [max 8 OIDs]"));
+       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", UT_THRESHOLDS_NOTES);