Page 1 of 2
check_sqljob.sh
Posted: Wed Feb 25, 2015 12:37 am
by braindope
Hi All,
Can anyone help me with my error?. i'm using check_sqljob.sh plugins but it's returning status of unknown in nagios, however ,when i manually run the checks it return a normal information.
below is the sample output when running manually
<a href=/nagios/sqllog/xx.xx.xx.xx-2015-02-25.html target=main> CRITICAL: Number of Jobs Failed:4|count=4</a>
Re: check_sqljob.sh
Posted: Wed Feb 25, 2015 10:15 am
by ssax
Please post the output of the following:
Re: check_sqljob.sh
Posted: Wed Feb 25, 2015 7:03 pm
by braindope
Hi,
here is the output below.
ls: check_sqljob: No such file or directory
and here the commands when i add .sh
ls -l check_sqljob.sh
-rwxr-xr-x 1 nagios nagios 1748 Feb 25 13:16 check_sqljob.sh
Re: check_sqljob.sh
Posted: Wed Feb 25, 2015 9:43 pm
by Box293
Can you please post your service definition and the command definition.
Please also show us the command you are executing at the command line to test it along with the output.
Re: check_sqljob.sh
Posted: Thu Feb 26, 2015 12:06 am
by braindope
Hi
define service{
use generic-service
host_name POSX_DB
service_description SQL_Jobs
check_command check_sqljob!<server IP>!<username>!<password>
}
define command{
command_name check_sqljob
command_line $USER1$/check_sqljob.sh -H $ARG1$ -u $ARG2$ -p $ARG3$
}
Re: check_sqljob.sh
Posted: Thu Feb 26, 2015 12:25 pm
by jdalrymple
Does your Nagios user have rights to execute your java binary? You might want to `su nagios` and try to run the command logged in with that user.
Re: check_sqljob.sh
Posted: Thu Feb 26, 2015 9:26 pm
by braindope
Hi jdalrymple,
your right the status is
UNKNOWN:
when i run it in nagios user , how can i make my nagios user run java? or can i make the checks to run on root user?
Re: check_sqljob.sh
Posted: Thu Feb 26, 2015 9:33 pm
by Box293
run this as root and then run it as nagios and post the output from both:
Re: check_sqljob.sh
Posted: Fri Feb 27, 2015 9:14 pm
by braindope
Please see result below.
[root@pwnagios ~]# which java
/usr/bin/java
[nagios@pwnagios root]$ which java
/usr/bin/java
Re: check_sqljob.sh
Posted: Mon Mar 02, 2015 12:32 pm
by jdalrymple
Please post the output of
I suspect it will be owned by root:root or root:wheel and that the binary is not world executable. If that's the case the proper way to fix the problem would be to create an appropriate group and put the nagios user in it, or just put the nagios user in the java group if it already exists. Run that command, post the output and we'll figure it out for you.
Does this server do anything besides host Nagios?