check_by_ssh time out issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

check_by_ssh time out issue

Post by bosecorp »

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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_by_ssh time out issue

Post by tgriep »

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: check_by_ssh time out issue

Post by bosecorp »

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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_by_ssh time out issue

Post by tgriep »

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.

Code: Select all

su nagios
ssh <IP Address of the remote system>
Post back the output.
Is should not prompt for a password.
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: check_by_ssh time out issue

Post by bosecorp »

[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]
$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_by_ssh time out issue

Post by lmiltchev »

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.002s
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: check_by_ssh time out issue

Post by bosecorp »

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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_by_ssh time out issue

Post by lmiltchev »

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.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: check_by_ssh time out issue

Post by bosecorp »

[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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_by_ssh time out issue

Post by lmiltchev »

Anything in the remote logs?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked