Issues with check_by_ssh

James Osbourn james.osbourn at citrix.com
Mon Aug 20 11:00:20 CEST 2012


Looking at your command from your terminal example and then looking at your command_line from your Nagios definition and your check_command statement the fields all seems to be backwards

The things that I can see are

-          Your Nagios configuration is using the root account to connect to the server and your command line definition is using Nagios

-          Your command_line is being passwd 'ipxenserver' as the remote command to execute

-          You command_line is being passwd your remote command as the ssh key to use.

-          You have a trailing ! in your check_command definition which we create a variable with no value

I think your command definition and need to be updated, something like this

define command{
        command_name    check_xen_cpu
        command_line    $USER1$/check_by_ssh -l $ARG1$ H $HOSTADDRESS$ -C $ARG2$ -I $ARG3$
        }

define service {
       service_description                 XenServer CPU Load
       host_name                                  ORL-XEN-02
       check_command                      check_by_ssh_xentop!nagios! /usr/lib/nagios/plugins/check_Xencpu.sh! /root/.ssh/id_rsa
       }

James

>From Nagios server

nagios at nagioserver:~$ /usr/lib/nagios/plugins/check_by_ssh -l nagios -H 172.16.31.2 -C "/usr/lib/nagios/plugins/check_Xencpu" -i /var/lib/nagios/.ssh/id_rsa
"OK:CPU%= 3"


command_line /usr/lib/nagios/plugins/check_by_ssh (1)-l '$ARG1$' (2)-H '$HOSTADDRESS$' (3)-C '$ARG2$' (4)-i '$ARG3$'
check_command    check_by_ssh_xentop!(1)root!(2)ipxenserver!(3)/usr/lib/nagios/plugins/check_Xencpu.sh!(4)/root/.ssh/id_rsa!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120820/3c10b298/attachment.html>
-------------- 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