[Nagiosplug-devel] [ nagiosplug-Bugs-3614897 ] check_nt COUNTER overenthusiatic isPercent test

SourceForge.net noreply at sourceforge.net
Tue Aug 13 04:26:32 CEST 2013


Bugs item #3614897, was opened at 2013-08-12 19:26
Message generated for change (Tracker Item Submitted) made by rod-payne
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3614897&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Rod Payne (rod-payne)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_nt COUNTER overenthusiatic isPercent test

Initial Comment:
Plugin Version (-V output): check_nt v1991 (nagios-plugins 1.4.13)
Plugin Name: check_nt
Plugin Commandline showing issues: -l "\\PhysicalDisk(_Total)\\Avg. Disk sec/Transfer","Seconds/transfer = %.6f","seconds" -w 1.000000 -c 2.000000

This returns performance data like: 'Seconds/transfer = %.6f&'=0.000044%;1.000000;2.000000
Note the percent sign (%) after the counter value.  This confuses the graph programs.  (%.6f is being specified because with just a clear description/label field, only two decimal places are displayed, and for this counter it mostly shows "Second/transfer = 0.00 seconds".) 

Whenever the description is formated for printf substitution ("Seconds/transfer = %.6f") in this example, the isPercent test finds the % in the description, overriding whatever may have been specified in counter_unit.  It should be looking for a % in the perfmon counter name only.

Alternately, allow the user to specify the counter_unit and override the isPercent test.  Alternately, allow the user to specify the number of decimal places in the result.

Code: (looking at line numbers in https://github.com/nagios-plugins/nagios-plugins/blob/master/plugins/check_nt.c)
----- insert after 93 -----
char *counter_name = NULL;
----- replace 339-341 -----
isPercent = (strchr (value_list, '%') != NULL);
strtok (value_list, "&");	/* burn the first parameters */
----- with -----
counter_name = strtok (value_list, "&");
isPercent = (strchr (counter_name, '%') != NULL);
-------------------


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3614897&group_id=29880




More information about the Devel mailing list