Status Information 6
Posted: Wed Apr 14, 2021 9:14 am
Good afternoon,
I have a sh script that connects via SSH to a remote machine and runs a robotframework program. When the program ends, I save the output value to check if it finished well. I attach the script:
"#!/bin/bash
sshpass -p 'pass' /usr/bin/ssh -p 22 user@host robot d:/monitor-rfk/robot/company-space-test-plan.robot
valor=$?
if [ $valor -eq 0 ]
then
echo "OK: Passed 1 of 1 tests"
exit 0
else
echo "CRITICAL: Failed 1 of 1 tests"
exit 2
fi"
If I run the script on the server it works fine, but if I pass it to nagios it comes out as critical.
I have looked at the output value that appears in nagios and it is a 6. If I do it on the server it is 0. What could it be due to?
Attached command file and services file
" define command{
command_name my-eventhandler
command_line $USER1$/prueba2.sh
}"
define service {
use local-9min ; Name of service template to use
host_name checkmknodo1
service_description SlaCarpetaEmpresa
check_command my-eventhandler
}
Thanks!
I have a sh script that connects via SSH to a remote machine and runs a robotframework program. When the program ends, I save the output value to check if it finished well. I attach the script:
"#!/bin/bash
sshpass -p 'pass' /usr/bin/ssh -p 22 user@host robot d:/monitor-rfk/robot/company-space-test-plan.robot
valor=$?
if [ $valor -eq 0 ]
then
echo "OK: Passed 1 of 1 tests"
exit 0
else
echo "CRITICAL: Failed 1 of 1 tests"
exit 2
fi"
If I run the script on the server it works fine, but if I pass it to nagios it comes out as critical.
I have looked at the output value that appears in nagios and it is a 6. If I do it on the server it is 0. What could it be due to?
Attached command file and services file
" define command{
command_name my-eventhandler
command_line $USER1$/prueba2.sh
}"
define service {
use local-9min ; Name of service template to use
host_name checkmknodo1
service_description SlaCarpetaEmpresa
check_command my-eventhandler
}
Thanks!