willixix / naglio-plugins

Monitoring Plugins by William Leibzon
http://william.leibzon.org/nagios/
77 stars 54 forks source link

check_netint --nagios_with_savedata removes octet values from perfdata #41

Closed olliewalsh closed 10 years ago

olliewalsh commented 10 years ago

Without --nagios_with_savedata: eth0:UP (1 UP): OK | 'eth0_in_octet'=3332824843c 'eth0_out_octet'=285853005c 'eth0_in_error'=0 'eth0_out_error'=0 'eth0_in_discard'=0 'eth0_out_discard'=0 cache_descr_ids=2 cache_descr_names=eth0 cache_descr_time=1383821720 ptime=1383822815 With --nagios_with_savedata: eth0:UP (1 UP): OK | 'eth0_in_error'=0 'eth0_out_error'=0 'eth0_in_discard'=0 'eth0_out_discard'=0 || cache_descr_ids=2 cache_descr_names=eth0 cache_descr_time=1383821720 'eth0_in_octet'=3329426741 'eth0_out_octet'=285420176 ptime=1383822312

willixix commented 10 years ago

SAVEDDATA is my own extension to Nagios which adds an an result string for output to plugins that is similar to PERFDATA but is not for use by graphing programs and only available as special MACRO. It is not part of standard nagios distribution so nobody but myself I'd expect to use it, at least right now. This type of data goes after || as opposed to | for PERFDATA.

When you use this switch all data that is re-used by plugin goes into that new part of OUTPUT. What is left before || is only what you specifically asked to be available with perf-output switches (-e, -Z, -y, -Y) which for output of octets this is done with -Z switch. If it is not present the data is not part of PERFDATA although it is sent to SAVEDDATA since that is required for by plugin to calculate average traffic to be displayed at the status line.

The line in the code that you found is actually exactly what it should be, I modified it when I added experimental SAVEDDATA support and tested to make sure when -Z switch is present the octets would still go to PERFDATA (-Z switch is $o_perfo). So there is no problem in the code and I will close this github issue in a few days.

First however I'd like to know how come you were using --nagios_with_savedata option?

olliewalsh commented 10 years ago

Ah - I thought -P enabled -Z.

I'm was planning to add SAVEDATA to shinken - thinking it was already in nagios. The reason being to fix php4nagios graphing.

As the SAVEDATA patch hasn't made it into nagios this would make less sense. I'm using the LONGSERVICEOUTPUT macro instead - the only difference is replacing || with \n in the output.