Issues with check_by_ssh
James Osbourn
james.osbourn at citrix.com
Thu Aug 16 10:12:40 CEST 2012
I see that you are talking to a XenServer host. I am performing something similar. What I have had to do to achieve results is to create a local Nagios user on the XenServer host which has SSH keys to allow the server Nagios user to connect and avoid using any root SSH keys which the Nagios user is unlikely to be able to read.
Once you have connected to the XenServer host check that the Nagios user can execute the commands you are running. If you are simply looking at the dom0 as if it was a host and checking items such as cpu, memory or disk usage then you should not have a problem. If you are executing XenServer xe commands then you will need to pass a username and password that has access to the XenServer to run these commands. This will be root or another account that has been granted access. You can store these values in the resources.cfg file and pass them in your command definition.
I have also noticed that your service definition is passing 4 arguments, where your command definition is only using 3 arguments and the hostaddress. It would be worth checking to make sure that you are passing the correct arguments from your service and command definitions to your remote host.
James
From: Eduardo Montes de Oca S. [mailto:edrendar at gmail.com]
Sent: 15 August 2012 18:52
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Issues with check_by_ssh
Hi list,
I have some issues with the plugin "check_by_ssh". In particular, there is one error:
When I run a shell script located in another server, from the Nagios server using the check_by_ssh plugin, I don't have any errors and I can see the result of the script, like this:
root at nagioserver#<mailto:root at TSM-SRV-V-114> /usr/lib/nagios/plugins/check_by_ssh -l root -H "ipxenserver" -C /usr/lib/nagios/plugins/check_Xencpu
"OK:CPU%= 3"
But, by any strange reason, when I configure the check for Nagios presents the results in its interface, I have the error:
[cid:image001.png at 01CD7B8F.4994F110]
I have made the ssh authorization keys in both servers (Nagios and Xen), I configured the users, permissions,etc. And I can't to do this work it.
Could someone help me solve this problem????
This is a part of my definition files:
#XENServer
define command {
command_name check_by_ssh_xentop
command_line /usr/lib/nagios/plugins/check_by_ssh -l '$ARG1$' -H '$HOSTADDRESS$' -C '$ARG2$' -i '$ARG3$'
}
#Hypervisor check
define service{
use generic-service
host_name ORLANDO
service_description Hypervisor CPU
check_command check_by_ssh_xentop!root!ipxenserver!/usr/lib/nagios/plugins/check_Xencpu.sh!/root/.ssh/id_rsa!
}
Regards!
--
IC. Eduardo Montes de Oca Sánchez
Skype: edrendar
Gmail: edrendar at gmail.com<mailto:edrendar at gmail.com>
MSN: ed_montesdeoca at hotmail.com<mailto:ed_montesdeoca at hotmail.com>
Movil: 5523419886
https://linuxcounter.net/cert/549074.png
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120816/bebe3cb5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 22290 bytes
Desc: image001.png
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120816/bebe3cb5/attachment.png>
-------------- next part --------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list