Page 3 of 6

Re: Check_by_ssh issue

Posted: Wed Aug 31, 2016 1:16 am
by MarMottE
Box293 wrote:
tgriep wrote:I am thinking that the error is the printing of the message of the day or the banner when you login to the remote system.
Adding -E 1 to the check_by_ssh command will ignore the first line of output.

In my previous message page 1, I have put the command definition and there is already -E 1

The check_by_ssh

# 'ssh_disk' command definition
define command{
command_name ssh_disk
command_line /usr/local/nagios/libexec/check_by_ssh -i /home/nagios/.ssh/id_dsa -H '$HOSTADDRESS$' -E 1 -C "/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -e -p '$ARG3$'"

Re: Check_by_ssh issue

Posted: Wed Aug 31, 2016 12:25 pm
by tgriep
It could also be the single quotes around the macros remove them and see if that works for you.

Code: Select all

/usr/local/nagios/libexec/check_by_ssh -i /home/nagios/.ssh/id_dsa -H $HOSTADDRESS$ -E 1 -C "/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$"

Re: Check_by_ssh issue

Posted: Thu Sep 01, 2016 8:42 am
by MarMottE
No, the same ..

Re: Check_by_ssh issue

Posted: Thu Sep 01, 2016 12:40 pm
by tgriep
Can you login to the Nagios server as the nagios user and run the command like in the previous post, filling in the IP Address and arguments and post the output here?

Re: Check_by_ssh issue

Posted: Fri Sep 02, 2016 1:42 am
by MarMottE
tgriep wrote:Can you login to the Nagios server as the nagios user and run the command like in the previous post, filling in the IP Address and arguments and post the output here?
nagios@nagiosserver:/usr/local/nagios/libexec$ ./check_by_ssh -i /home/nagios/.ssh/id_dsa -H xxxxxx -E 1 -C "/usr/lib/nagios/plugins/check_disk -w 10 -c 20 -e -p /"
DISK OK| /=4453MB;12677;12667;0;12687

Re: Check_by_ssh issue

Posted: Fri Sep 02, 2016 9:37 am
by rkennedy
Could you please post your service definition for the one that's using this check_command and failing? The command definition looks good, as well as the fact it's working over the CLI.

Re: Check_by_ssh issue

Posted: Fri Sep 02, 2016 9:46 am
by MarMottE
rkennedy wrote:Could you please post your service definition for the one that's using this check_command and failing? The command definition looks good, as well as the fact it's working over the CLI.
define service {
host_name xxxxxxx,
service_description /
check_command ssh_disk!20%!10%!/
use generic-service
}

Re: Check_by_ssh issue

Posted: Fri Sep 02, 2016 11:59 am
by rkennedy
To rule out parsing and values getting lost in translation, could you create a new command definition and assign this to your service?

Code: Select all

$USER1$/check_by_ssh -i /home/nagios/.ssh/id_dsa -H xxxxxx -E 1 -C "/usr/lib/nagios/plugins/check_disk -w 10 -c 20 -e -p /"
This isn't ideal, but it will at least help us to see what's going on. Let us know what the status is for the check when it comes back.

Re: Check_by_ssh issue

Posted: Mon Sep 05, 2016 4:27 am
by MarMottE
rkennedy wrote:To rule out parsing and values getting lost in translation, could you create a new command definition and assign this to your service?

Code: Select all

$USER1$/check_by_ssh -i /home/nagios/.ssh/id_dsa -H xxxxxx -E 1 -C "/usr/lib/nagios/plugins/check_disk -w 10 -c 20 -e -p /"

# 'ssh_disk' command definition
define command{
command_name ssh_disk_test
command_line $USER1$/check_by_ssh -i /home/nagios/.ssh/id_dsa -H '$HOSTADDRESS$' -E 1 -C "/usr/lib/nagios/plugins/check_disk -w 10 -c 20 -e -p /"
}



define service {
host_name xxxxxx, xxxxxxx
service_description /_test
check_command ssh_disk_test
use generic-service
}


It's the same ... check goes down when the session is closed


/_test
Perform Extra Service Actions
CRITICAL 09-05-2016 11:26:18 0d 0h 3m 16s 3/3 (Return code of 255 is out of bounds)

Re: Check_by_ssh issue

Posted: Tue Sep 06, 2016 10:42 am
by rkennedy
It really sounds like the storage isn't persistent if that's the case. What type of firewall device is this?