Page 1 of 1

[Nagios-devel] empty perfdata not put on perfdata channels anymore

Posted: Tue Jul 26, 2011 1:34 pm
by Guest
This is a multi-part message in MIME format.
--------------060406000304020808090501
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

hi,

this is one of those patches i did not yet get an idea on how to make it
portable from icinga to nagios. since there was a release rushed into
today, i decided to throw this just "as is" onto the list as it seems
that no-one else tested/encountered this yet. most likely users will ask
about that soon - so get to know that prior to installing and debugging
this release.

feel free to create your own working patch out of it.

https://dev.icinga.org/issues/1413


main issue will be with 3.3.1 that nagiosgrapher and ohcp/oscp won't
work anymore with not sent perfdata if the plugin output does not
provide any (because it's empty and not processed in the macro
calculation in xdata/xpddefault.c). a possible workaround is to make
sure each plugin provides perfdata output (like it should be).


i decided to make it a config option in icinga 1.4.0 to allow those
users not needing it, to explicitely disable that. for the others,
icinga 1.4.0 got that fixed thanks to various icinga users out there.
it's not the cleanest patch, but i'll leave it here for porting it into
nagios upstream.

https://git.icinga.org/?p=icinga-core.g ... 6fdfdce06e

kind regards,
michael


ps: some tests on the released source to proof it right away.

define command{
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/nagios/var/service-perfdata
/usr/local/nagios/var/perfdata/service-perfdata.$TIMET$
}

define command{
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/nagios/var/host-perfdata
/usr/local/nagios/var/perfdata/host-perfdata.$TIMET$
}


process_performance_data=1

host_perfdata_process_empty_results=1
service_perfdata_process_empty_results=1

service_perfdata_file=/usr/local/nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

host_perfdata_file=/usr/local/nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file





nagios 3.3.1

~/nagios/nagios $ tail -f /usr/local/nagios/var/service-perfdata
DATATYPE::SERVICEPERFDATA TIMET::1311688921
HOSTNAME::localhost SERVICEDESC::HTTP
SERVICEPERFDATA::time=0.064582s;;;0.000000 size=508B;;;0
SERVICECHECKCOMMAND::check_http HOSTSTATE::UP
HOSTSTATETYPE::SOFT SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1311688961
HOSTNAME::localhost SERVICEDESC::PING
SERVICEPERFDATA::rta=0.035000ms;100.000000;500.000000;0.000000
pl=0%;20;60;0SERVICECHECKCOMMAND::check_ping!100.0,20%!500.0,60%
HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK
SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1311689001
HOSTNAME::localhost SERVICEDESC::Root Partition
SERVICEPERFDATA::/=636MB;3172;3569;0;3966
SERVICECHECKCOMMAND::check_local_disk!20%!10%!/ HOSTSTATE::UP
HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1311689071
HOSTNAME::localhost SERVICEDESC::Swap Usage
SERVICEPERFDATA::swap=975MB;0;0;0;1027
SERVICECHECKCOMMAND::check_local_swap!20!10 HOSTSTATE::UP
HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA T

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]