Page 1 of 1

Plugin return perfdata but NO rrd and xml files generated.

Posted: Sun May 04, 2014 3:15 am
by John12
Hi,

I have developed a nagios plugin to monitor the virtual machines run by vmware workstation. I have completed the script and the values return by the script are pretty much accurate. I am exicted to put in nagios plugin section.

My problem:-

During initial development, I found that plugin doesn't not return more than 15 graph . i made some study and made some correction in script. I went and deleted the rrd and xml files.
But then on no rrd and xml graph can be generated.

If i look at the service status info screen. I get to see that plugin returning the perf data values as shown in image below:
service state info.JPG
As you can see plugin return perfdata.. but i see no graph in perfomance data screen. Nor , any rrd or XML files get generated in nagiosxi server.

Let me know how i could proceed further to debug it. i m pretty new to nagios. and can provide my plugin code if needed.

regards,
John.

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Sun May 04, 2014 5:50 pm
by Box293
From what I can see, the performance data string is being cut off. Your screenshot ends with:

Code: Select all

'Accounting_VM'=1 'Accou
How is your plugin being executed? Via an agent like NRPE or NSClient++?

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 3:31 am
by John12
Hey thanks for reply. I appreciate your time and help for me in this regard.
Yes, i forgot to mention, I execute plugin with NRPE agent. and its running under xinetd.

nrpe.cfg
command_timeout=60
connection_timeout=300

Q: whether it will be because of Plugin Output Length Restrictions http://nagios.sourceforge.net/docs/3_0/pluginapi.html

I redirectred the plugin output to a file and checked is size. found as 4 KB.

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 5:37 am
by Box293
NRPE has a hard limit of 4096 bytes passed for any service check including total standard and long service output.
I came across this issue while developing a plugin recently and it was because of the nrpe limit.

I decided to stop using nrpe and instead I used check_by_ssh to perform the remote checks.

check_by_ssh does not have a limit on how much data it will receive back and hence it works great for plugins with a lot of output. I'm confident this will fix your problem.

As a bonus, I found that configuring and using check_by_ssh was less complicated and quicker to get it up and running as you don't need to install an agent on the remote servers.

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 5:49 am
by John12
Alright, i was thinking the same.. But having strange issue with check_by_ssh.
let me put the configuration details:-

Nagiosxi server: vmware instance Nagios XI 2012R2.9 32bit.
My target host : centos 6.4 x64bit

I created the key pair and tested successful login. Now from nagios server. i issued command as.. but getting

-bash: ./check_by_ssh: cannot execute binary file .

[nagios@monitoring libexec]$ ./check_by_ssh -H 74.208.XXX.XXX -C '/usr/bin/sudo /usr/local/nagios/libexec/VM-monitoring.sh -j SourceForge_VM,SourceForge-1_VM,Openerpx1_VM,Openerpx2_VM,Openerpx3_VM,SubversionEdge_VM,Accounting_VM -w 85-850-300,85-350-300,180-5000-500,180-750-500,180-1750-1000,85-750-500,80-750-500 -c 95-900-400,95-450-400,190-6000-1000,190-850-1000,190-1800-2000,95-850-1000,90-850-700'
-bash: ./check_by_ssh: cannot execute binary file

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 8:09 am
by John12
Never mind.. i found answer. i have downloaded nagios plugin and did ./configure and then make. then copyied the check_by_ssh and that works .

Let me test. the output. I am concern about the perfdata. does the check_by_ssh has graph template. ?

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 9:04 am
by John12
hi,

I am having trouble with check_by_ssh.
I created key-pair in nagios server. /home/nagios/.ssh/id_rsa and id_rsa.pub
Transferred the id_rsa.pub to the targe server /home/nagios/.ssh/authorized_keys.

I could login into target server from host without password.
I checked the running ./check_by_ssh in nagios server with all the arguments and it returns data successfully.

Now, coming to perform check from nagiosXI.
I created command as
check_vm $USER1$/check_by_ssh -H $HOSTADDRESS$ $ARG1$ -C '/usr/bin/sudo $USER1$/VM-monitoring.sh -j $ARG2$ -w $ARG3$ -c $ARG4$'

and in coreconfig created a new service with :
check command: check_vm
$ARG1$ : -p 2298 -2 -t 30 -l nagios
$ARG2$: vm's
$ARG3: WARNING values
$ARG4: CRITICAL values.

ON test check command, I get to see error as :
COMMAND: /usr/local/nagios/libexec/check_by_ssh -H 74.208.xxx.xxx -p 22xx -2 -t 30 -l nagios -C '/usr/bin/sudo /usr/local/nagios/libexec/VM-monitoring.sh -j SourceForge_VM,SourceForge-1_VM,Openerpxxt_VM,Openerpxx_VM,Openerpxx_VM,SubversionEdge_VM,Accounting_VM -w 85-850-300,85-350-300,180-5000-500,180-750-500,180-1750-1000,85-750-500,80-750-500 -c 95-900-400,95-450-400,190-6000-1000,190-850-1000,190-1800-2000,95-850-1000,90-850-700'
OUTPUT: Remote command execution failed: Could not create directory '/var/www/.ssh'.

why it asking about the create directory.. any idea.

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 9:33 am
by John12
Update, I found that the service is actually working. I can see the warning from the service list. It appears the issue is with the "Test Check Command" is giving the error. The Test Check Command must be doing some extra stuff in the background. It's a great tool and have used it now serveral times to troubleshoot other commands. Not sure why this one breaks with the check_by_ssh command and that I need to additional permissions, but not sure where at this point? I believe it must be something to do with the addtional directories and files that the check_by_ssh command appeared to hit from my last post (/var/www/.ssh)

The test check command is having problem with the check_by_ssh plugin. !!

Its upto nagios for addressing it.

Thanks anyway. I really appreciate your help.

My problem solved.

Re: Plugin return perfdata but NO rrd and xml files generate

Posted: Mon May 05, 2014 10:09 am
by abrist
The "Test check command" function runs the check as the apache user, not the nagios user. Just an FYI as I have seen that trip up a number of clients when using check_by_ssh as the RSA key is usually generated for the nagios user. When the check is run normally by nagios, it is run as the nagios user, but the test check command is a special case.