check_sqljob.sh
check_sqljob.sh
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>
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
Please post the output of the following:
Code: Select all
ls -l check_sqljob
Re: check_sqljob.sh
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
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
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_sqljob.sh
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.
Please also show us the command you are executing at the command line to test it along with the output.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_sqljob.sh
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$
}
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$
}
- Attachments
-
- check sqljob.txt
- (1.76 KiB) Downloaded 276 times
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: check_sqljob.sh
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
Hi jdalrymple,
your right the status is
your right the status is
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?UNKNOWN:
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_sqljob.sh
run this as root and then run it as nagios and post the output from both:
Code: Select all
which java
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_sqljob.sh
Please see result below.
[root@pwnagios ~]# which java
/usr/bin/java
[nagios@pwnagios root]$ which java
/usr/bin/java
[root@pwnagios ~]# which java
/usr/bin/java
[nagios@pwnagios root]$ which java
/usr/bin/java
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: check_sqljob.sh
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?
Code: Select all
ll /usr/bin/java
Does this server do anything besides host Nagios?