Page 1 of 1

check_by_ssh

Posted: Fri May 16, 2014 6:46 am
by kemecs
[Mod edit - split from this post: http://support.nagios.com/forum/viewtop ... =6&t=26953]

Hello!

Too bad it's not going to Nagos my server:

Code: Select all

nagios@MHnagios:/usr/local/nagios$ /usr/local/nagios/libexec/check_by_ssh -t 20 -E 1 -l vi-admin -H 10.0.10.110 -C "~/box293_check_vmware.pl --check Host_Memory_Usage --server 10.0.10.100 --host 10.0.10.20"
CRITICAL - Plugin timed out after 20 seconds
This is the command of VMA-server on my good

Code: Select all

vma:/home/vi-admin # ./box293_check_vmware.pl --check Host_Memory_Usage --server 10.0.10.100 --host 10.0.10.20
OK: Host Memory {Free: 32.1 GB} {Used: 15.9 GB} {Total: 48 GB}|'Memory Free'=32.1GB 'Memory Used'=15.9GB 'Memory Total'=48G
I do not understand because it is the right answer comman my Nagios server:

Code: Select all

nagios@MHnagios:/usr/local/nagios$ /usr/local/nagios/libexec/check_by_ssh -t 15 -E 1 -l vi-admin -H 10.0.10.110 -C "~/box293_check_vmware.pl --help"|more

NAME
    box293_check_vmware.pl - VMware Plugin for Nagios

SYNOPSIS
    box293_check_vmware.pl --check <check_to_be_performed> --server
    <vCenter_Server_or_ESX(i)_Host> <Other_arguments_as_required>
So ssh good..

What am I doing wrong?

Greetings: kemecs

Re: check_by_ssh

Posted: Fri May 16, 2014 8:39 am
by Box293
Hi kemecs,
It looks like everything you are doing is right, lets see if we can find the problem.

Can you give me some details about your Nagios host please?
What version is Nagios?
What OS is Nagios running on?

Re: check_by_ssh

Posted: Fri May 16, 2014 8:51 am
by John12
I would like to point that the "Test check command" in service core config is not compatible with check_by_ssh plugin.

But if you save the config and do "check service" it will return output OK, if your command definition is correct.

I had same issue. Just waiting for nagios to fix.

Re: check_by_ssh

Posted: Fri May 16, 2014 1:18 pm
by sreinhardt
John, this is not likely something that will be fixed per say, as it is working as intended, and we really do not want or cannot change some of the items that cause it to be issue prone due to potential vulnerabilities by doing so, and restrictions due to php. Otherwise your point is spot on that check_by_ssh does not work via the test command button due to many different reasons, testing via cli or immediate command execution is suggested instead.

Re: check_by_ssh

Posted: Sat May 17, 2014 2:41 am
by kemecs
here are my versions:

nagios-plugins-1.4.15

Ubuntu Linux 10.04.1
NagiosĀ® Coreā„¢ Version 3.3.1

Thanks: Kemecs

Re: check_by_ssh

Posted: Mon May 19, 2014 12:36 pm
by sreinhardt
When on the vmware host, how long does the check plugin take to run? I see that you have the check_by_ssh currently only set to 20 seconds, might it be running longer than that?

Code: Select all

time ./box293_check_vmware.pl --check Host_Memory_Usage --server 10.0.10.100 --host 10.0.10.20

Re: check_by_ssh

Posted: Thu May 22, 2014 3:50 am
by Box293
I've reproduced your environment but I am unable to recreate the problem you are getting.
  • I ran up a VM with Ubuntu Linux 10.04.1 (server x64)
    I installed nagios-plugins-1.4.15
    I followed all the steps in the box293_check_vmware manual
    I am able to execute the same check you are doing and it works as expected
I'm not sure what could be the problem.