check_by_ssh

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kemecs
Posts: 2
Joined: Fri May 16, 2014 6:17 am

check_by_ssh

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_by_ssh

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
John12
Posts: 48
Joined: Fri Nov 11, 2011 6:16 am

Re: check_by_ssh

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_by_ssh

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
kemecs
Posts: 2
Joined: Fri May 16, 2014 6:17 am

Re: check_by_ssh

Post by kemecs »

here are my versions:

nagios-plugins-1.4.15

Ubuntu Linux 10.04.1
Nagios® Core™ Version 3.3.1

Thanks: Kemecs
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_by_ssh

Post 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
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_by_ssh

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked