LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Nagios not processing perfdata (https://www.linuxquestions.org/questions/linux-server-73/nagios-not-processing-perfdata-869674/)

khurramazizkhalid 03-19-2011 05:45 PM

Nagios not processing perfdata
 
Hi All,

I am currently deploying Nagios as my NMS on CentOS 5 and using pn4nagios to create graphs.
I have successfully configured Nagios-3.3.3 along with nagios-plugins-1.4.15. its working fine and showing my windows machine and linux machine.
But here is the problem, when I try to configure pnp4nagios-0.6.11 I am unable to restart nagios service as it gives me error in commands.cfgfile on line number 240 which is as follows :

command_name process-service-perfdata
can sum1 tell me how to get rid of this error. i had encountered similar problem while using nagiosgrapher. kindly note that i have allowed perdata to be processed by setting its value to 1.

ComputerErik 03-20-2011 10:55 AM

Have you defined that command anywhere? What is the exact error you get?

khurramazizkhalid 03-20-2011 11:13 AM

yes I have defined this command in /usr/local/nagios/etc/objects/commands.cfg & command is as follows :

define command {
command_name process-service-perfdata
command_line /usr/bin/perl /usr/localpnp4nagioslibexec/process_perfdata.pl
}

I have verifed and process_perfdata.pl does exist on this path. Error that I get is I am unable to restart nagios service & it says "Running Configuration check...CONFIG ERROR! Restart aborted. Check your Nagios configuration".

so i checked what was the error using
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

and exact error is
Error: Could not add object property in file '/usr/local/nagios/etc/objects/command.cfg' on line 424

and line 424 in commands.cfg is command_name process-serivce-perfdata . if i comments out this then nagios services starts without any error but then how can I create graphs :(

ComputerErik 03-20-2011 11:26 AM

I think your problem is you can't actually define the command in the commands.cfg file. You will need to instead write a script to place into the libexec directory with all of the other commands, and in commands.cfg you just place the name of this with the parameters to pass to it.

So in libexec create a shell script called check_perf (or whatever you like), and in there place the call to the perl script. Then your command configuration should have just somehting like this:


define command {
command_name process-service-perfdata
command_line check_perf
}

You should also check and see if there should be any arguments passed to this (such as hostname which is VERY common for almost all of the Nagios check commands) and pass that if needed.

khurramazizkhalid 03-21-2011 05:54 AM

Erik I am following this link for my pnp4nagios configuration http://docs.pnp4nagios.org/pnp-0.6/doc_complete . currently I am trying to configure Synchronous Mode & following this document step by step


All times are GMT -5. The time now is 05:58 PM.