check_by_ssh time out issue
check_by_ssh time out issue
I am trying to monitor few servers using SSH, but I am getting the error below. if I run the check from the CLI works fine. I am running the check as root and also as Nagios.
Critical
Command: /usr/bin/ssh
Argument 1: myIPADDRESS
Argument 2: /usr/local/nagios/libexec/check_disk /
CRITICAL - Plugin timed out after 10 seconds
Critical
Command: /usr/bin/ssh
Argument 1: myIPADDRESS
Argument 2: /usr/local/nagios/libexec/check_disk /
CRITICAL - Plugin timed out after 10 seconds
You do not have the required permissions to view the files attached to this post.
Re: check_by_ssh time out issue
Could you post how you have the check setup in Nagios XI and how you ran it from the command line?
For your second arguments, do you have them in double quotes? That may be needed because of the space in the command.
For your second arguments, do you have them in double quotes? That may be needed because of the space in the command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_by_ssh time out issue
I do have them with double quotes
# ./check_by_ssh -H myserver -C "/usr/local/nagios/libexec/check_disk /"
DISK OK - free space: / 324 MB (56% inode=90%);| /=251MB;;;0;576
# ./check_by_ssh -H myserver -C "/usr/local/nagios/libexec/check_disk /"
DISK OK - free space: / 324 MB (56% inode=90%);| /=251MB;;;0;576
You do not have the required permissions to view the files attached to this post.
Re: check_by_ssh time out issue
I tested your example and it worked for me. Lets check and see if you can ssh in to the remote system without being prompted for a password. Try running this on the XI system in a shell.
Post back the output.
Is should not prompt for a password.
Code: Select all
su nagios
ssh <IP Address of the remote system>Is should not prompt for a password.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_by_ssh time out issue
[nagios@nagmonus1 ~]$ ssh myserver
Last unsuccessful login: Thu Jul 2 07:04:10 EDT 2015 on ssh from nagmonus1.bose.com
Last login: Thu Jul 2 08:27:40 EDT 2015 on /dev/pts/1 from nagmonus1.bose.com
*******************************************************************************
* *
* *
* Welcome to AIX Version 7.1! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
*******************************************************************************
[YOU HAVE NEW MAIL]
$
Last unsuccessful login: Thu Jul 2 07:04:10 EDT 2015 on ssh from nagmonus1.bose.com
Last login: Thu Jul 2 08:27:40 EDT 2015 on /dev/pts/1 from nagmonus1.bose.com
*******************************************************************************
* *
* *
* Welcome to AIX Version 7.1! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
*******************************************************************************
[YOU HAVE NEW MAIL]
$
Re: check_by_ssh time out issue
Can you also try timing the check, even though it is highly unlikely it actually timed out...
Code: Select all
su nagios
time /usr/local/nagios/libexec/check_by_ssh -H x.x.x.x -C "/usr/local/nagios/libexec/check_disk /" -v
Command: /usr/bin/ssh
Argument 1: x.x.x.x
Argument 2: /usr/local/nagios/libexec/check_disk /
DISK OK - free space: / 4850 MB (29% inode=70%);| /=11801MB;;;0;17544
real 0m0.129s
user 0m0.008s
sys 0m0.002sBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_by_ssh time out issue
from CLI, here is the result
[nagios@nagmonus1 ~]$ time /usr/local/nagios/libexec/check_by_ssh -H myserver -C "/usr/local/nagios/libexec/check_disk /" -v
Command: /usr/bin/ssh
Argument 1: myserver
Argument 2: /usr/local/nagios/libexec/check_disk /
DISK OK - free space: / 324 MB (56% inode=90%);| /=251MB;;;0;576
real 0m0.620s
user 0m0.015s
sys 0m0.011s
You have mail in /var/spool/mail/nagios
[nagios@nagmonus1 ~]$ time /usr/local/nagios/libexec/check_by_ssh -H myserver -C "/usr/local/nagios/libexec/check_disk /" -v
Command: /usr/bin/ssh
Argument 1: myserver
Argument 2: /usr/local/nagios/libexec/check_disk /
DISK OK - free space: / 324 MB (56% inode=90%);| /=251MB;;;0;576
real 0m0.620s
user 0m0.015s
sys 0m0.011s
You have mail in /var/spool/mail/nagios
Re: check_by_ssh time out issue
Can you find any clues in the remote server's logs? I am not sure where the AIX version of "secure" log would be... "/var/log/authlog"? Also, check the nagios.log on the Nagios XI server.
Code: Select all
tail -100 /usr/local/nagios/var/nagios.logBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_by_ssh time out issue
[1435836260] SERVICE ALERT: ac1db1.bose.com;Check root;UNKNOWN;SOFT;1;Remote command execution failed: ssh: connect to host 10.0.x.x port 22: Connection timed out
Last edited by jolson on Thu Jul 02, 2015 2:24 pm, edited 2 times in total.
Reason: omitted some IP information
Reason: omitted some IP information
Re: check_by_ssh time out issue
Anything in the remote logs?
Be sure to check out our Knowledgebase for helpful articles and solutions!