summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ad344a)
raw | patch | inline | side by side (parent: 2ad344a)
author | Ton Voon <ton.voon@opsera.com> | |
Wed, 30 Jun 2010 08:01:14 +0000 (09:01 +0100) | ||
committer | Ton Voon <ton.voon@opsera.com> | |
Wed, 30 Jun 2010 08:01:14 +0000 (09:01 +0100) |
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index d38710403f30246545037b934d3e88903518f735..b16428fe0b02e78651cc86d27629dcfd01e68dbd 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
duration = current_time-previous_state->time;
if(duration<=0)
die(STATE_UNKNOWN,_("Time duration between plugin calls is invalid"));
- temp_double = (response_value[i]-previous_value[i])/duration;
+ temp_double = response_value[i]-previous_value[i];
/* Simple overflow catcher (same as in rrdtool, rrd_update.c) */
if(is_counter) {
if(temp_double<(double)0.0)
if(temp_double<(double)0.0)
temp_double+=(double)18446744069414584320.0; /* 2^64-2^32 */;
}
+ /* Convert to per second, then use multiplier */
+ temp_double = temp_double/(duration*rate_multiplier);
iresult = get_status(temp_double, thlds[i]);
asprintf (&show, conv, temp_double);
}
printf (" %s\n", _("Critical threshold range(s)"));
printf (" %s\n", "--rate");
printf (" %s\n", _("Enable rate calculation. See 'Rate Calculation' below"));
+ printf (" %s\n", "--rate-multiplier");
+ printf (" %s\n", _("Converts rate per second. For example, set to 60 to convert to per minute"));
/* Tests Against Strings */
printf (" %s\n", "-s, --string=STRING");
printf("%s\n", _("Rate Calculation:"));
printf(" %s\n", _("In many places, SNMP returns counters that are only meaningful when"));
printf(" %s\n", _("calculating the counter difference since the last check. check_snmp"));
- printf(" %s\n", _("saves the last state information in a file so that the rate can be"));
- printf(" %s\n", _("calculated. Use the --rate option to save state information. On the"));
- printf(" %s\n", _("first run, there will be no prior state - this will return with OK."));
+ printf(" %s\n", _("saves the last state information in a file so that the rate per second"));
+ printf(" %s\n", _("can be calculated. Use the --rate option to save state information."));
+ printf(" %s\n", _("On the first run, there will be no prior state - this will return with OK."));
printf(" %s\n", _("The state is uniquely determined by the arguments to the plugin, so"));
printf(" %s\n", _("changing the arguments will create a new state file."));