Page 1 of 1

how to create service perfdata

Posted: Thu Apr 21, 2016 2:49 pm
by Bryan
bash-4.1$ cat /usr/local/pnp4nagios/var/service-perfdata | grep mq

DATATYPE::SERVICEPERFDATA TIMET::1461267002 HOSTNAME::hostname SERVICEDESC::svc-activemq_watch SERVICEPERFDATA:: SERVICECHECKCOMMAND::check_byssh_activemq_watch!500!750!queue name HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::UNKNOWN SERVICESTATETYPE::HARD



currently my perfdata is unavailable so i cannot view graph

so how do i enable service perfdata in command.cfg or should i go where service is defined.

Re: how to create service perfdata

Posted: Thu Apr 21, 2016 2:55 pm
by rkennedy
This is most likely because your plugin isn't sending performance data.

To break it down for you, take a look at -

Code: Select all

[root@localhost libexec]# ./check_http -H nagios.com -f follow
HTTP OK: HTTP/1.1 200 OK - 53511 bytes in 0.380 second response time |time=0.379755s;;;0.000000 size=53511B;;;0
The part of the check that is returned as the Nagios status is going to be HTTP OK: HTTP/1.1 200 OK - 53511 bytes in 0.380 second response time and the part for the performance data is going to be everything after | (used as a delimiter), so - time=0.379755s;;;0.000000 size=53511B;;;0

Does that answer your question?

Re: how to create service perfdata

Posted: Thu Apr 21, 2016 3:05 pm
by Bryan
No
i have been trying to moniter it through graph
i have attached image for more specification

This service doesnot show service perfdata

DATATYPE::SERVICEPERFDATA TIMET::1461265693 HOSTNAME::hostname SERVICEDESC::svc-activemq_watch SERVICEPERFDATA:: SERVICECHECKCOMMAND::check_byssh_activemq_watch!500!750!queue name HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::CRITICAL SERVICESTATETYPE::HARD

and this is working example of a service

DATATYPE::SERVICEPERFDATA TIMET::1461265535 HOSTNAME::hostname SERVICEDESC::ping SERVICEPERFDATA::rta=5.532000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0 SERVICECHECKCOMMAND::check_ping!100.0,20%!500.0,60% HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD

so how can i moniter this by graph

when i click on graph option it shows me this error

XML file "/usr/local/pnp4nagios/var/perfdata/hostname/svc-activemq_watch.xml" not found. <a href="http://docs.pnp4nagios.org/faq/6">Read FAQ online</a>

so i think my service perfdata is not enabled



bash-4.1$ ./activemq_watch
Cannot get XML file: Connection refused

Re: how to create service perfdata

Posted: Thu Apr 21, 2016 3:14 pm
by rkennedy
As I mentioned, your service is NOT returning performance data. If check_ping is working without issues, then clearly performance data is enabled on your system. If the service was returning performance data, you'd see something similar to this, with the 'Performance Data:' part not empty -
core-performance-data.PNG
PNP4Nagios is actually a separate product not created by Nagios, and we aren't able to provide support for it. Let us know if you have any further questions regarding Nagios.