check_by_ssh problem
Posted: Tue Mar 14, 2017 6:48 am
Hi to all,
I have a problem with this script.
I have a nagios server with a user called nagios.
I have 2 jboss server (for example jb1 e jb2)
I added authentication by key so I can execute command from nagios server to jboss client without authentication.
So, if I m in folder /usr/local/nagios/libexec logged by nagios user
and run
./check_by_ssh -H jb1 -t 60 -l nagios -C "/opt/jboss/scripts/check_file_size_custom.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*" -E
or
./check_by_ssh -H jb2 -t 60 -l nagios -C "/opt/jboss/scripts/check_file_size_custom.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*" -E
both commands respond with the correct result
for jb1
FILE: Check for all files (452). Click for details on the service...
---
Warning: Size of 113799 KB > 78125 KB for /opt/jboss/domain/servers/XXXXXXXX/log/server.log.2017-02-21
Warning: Size of 97286 KB > 78125 KB for /opt/jboss/domain/servers/YYYYYY/log/server.log.2017-02-22
Critical: Size of 250648 KB > 146484 KB for /opt/jboss/domain/servers/ZZZZZZZ/log/server.log
...
---
for jb2
FILE: Check for all files (909). Click for details on the service...
---
---
so in jb2 server all is ok (if I lower the threshold, also jb2 return warning.)
But in nagios dashboard i see this
in jb1 server I read what I posted before but in jb2 server I read this
(Return code of 255 is out of bounds : UNKNOWN - check_by_ssh: Remote command '/opt/jboss/scripts/check_file_size_custom.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*' returned status 255))
The advanced service is the same for both server and also the command line (except server name). Why by shell works and by nagios dashboard not?
Can someone help me?
I have a problem with this script.
I have a nagios server with a user called nagios.
I have 2 jboss server (for example jb1 e jb2)
I added authentication by key so I can execute command from nagios server to jboss client without authentication.
So, if I m in folder /usr/local/nagios/libexec logged by nagios user
and run
./check_by_ssh -H jb1 -t 60 -l nagios -C "/opt/jboss/scripts/check_file_size_custom.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*" -E
or
./check_by_ssh -H jb2 -t 60 -l nagios -C "/opt/jboss/scripts/check_file_size_custom.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*" -E
both commands respond with the correct result
for jb1
FILE: Check for all files (452). Click for details on the service...
---
Warning: Size of 113799 KB > 78125 KB for /opt/jboss/domain/servers/XXXXXXXX/log/server.log.2017-02-21
Warning: Size of 97286 KB > 78125 KB for /opt/jboss/domain/servers/YYYYYY/log/server.log.2017-02-22
Critical: Size of 250648 KB > 146484 KB for /opt/jboss/domain/servers/ZZZZZZZ/log/server.log
...
---
for jb2
FILE: Check for all files (909). Click for details on the service...
---
---
so in jb2 server all is ok (if I lower the threshold, also jb2 return warning.)
But in nagios dashboard i see this
in jb1 server I read what I posted before but in jb2 server I read this
(Return code of 255 is out of bounds : UNKNOWN - check_by_ssh: Remote command '/opt/jboss/scripts/check_file_size_custom.sh --maxwarn 80000000 --maxcrit 150000000 /opt/jboss/domain/servers/*/log/* /opt/jboss/domain/log/*' returned status 255))
The advanced service is the same for both server and also the command line (except server name). Why by shell works and by nagios dashboard not?
Can someone help me?