Page 1 of 1

inaccurate performance data

Posted: Thu Jul 11, 2019 3:47 pm
by hzsoliel
Hi there,

We have a custom service that does some work and provides answers in integer format. We have verified that we only ever receive integers. Our custom dashlet also reflects these data and we have twice verified that everything is in integer format.

However, when we look at the "performance data" histogram for the service, we notice that the number displayed below (latest, max, etc) are showing up as decimals. This is misleading because the numbers represents the number of the people or the number of the meetings and we need to find out (a) why Nagios is doing that, and (b) how to prevent the decimal numbers.

Re: inaccurate performance data

Posted: Fri Jul 12, 2019 12:09 pm
by tgriep
There is a formula that performance data gets processed through and what you are seeing is rounding errors from that formula which is causing the graph to display the decimal points.

To fix the issue, you have to create a template and a new command that will use the template.

In Core Config Manager
Create a copy of the existing command and give it a new name

Without knowing what the plugin is that you are using, the following is an example command name. Adjust the name for your plugin.

Code: Select all

define command {
       command_name                  		check_gauge
       command_line                  		$USER1$/check_xxxxxx -H $HOSTADDRESS$ $ARG1$
}
Then edit the service check to use the check_gauge command and not the original command


The graph template is called check_gauge.cfg and it needs to be uploaded to this folder in the XI system /usr/local/nagios/etc/pnp/check_commands/

Code: Select all

/usr/local/nagios/etc/pnp/check_commands/check_gauge.cfg
Then run this to make a copy of it as a php file in the templates folder.

Code: Select all

cp /usr/local/nagios/etc/pnp/check_commands/check_gauge.cfg /usr/local/nagios/share/pnp/templates/check_gauge.php
Changed the permissions of the check_gauge.cfg file to the following

Code: Select all

chown apache.nagios check_gauge.cfg
chmod 666 check_gauge.cfg
Delete the .rrd and .xml files for that service. You will loose all of the history. They are in this folder under the hostname

Code: Select all

/usr/local/nagios/share/perfdata/<HostName>/
After 15 minutes, the graph should be populated with the data and not have the decimal points.

Re: inaccurate performance data

Posted: Tue Jul 16, 2019 3:12 pm
by hzsoliel
Thanks. You may close this thread.

Re: inaccurate performance data

Posted: Tue Jul 16, 2019 4:04 pm
by tgriep
Your welcome. I'll close and lock the post but feel free to open a new post for any other questions in the future.