Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
braindope
Posts: 80 Joined: Fri Sep 26, 2014 12:13 am
Post
by braindope » Wed Feb 25, 2015 12:37 am
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>
ssax
Dreams In Code
Posts: 7682 Joined: Wed Feb 11, 2015 12:54 pm
Post
by ssax » Wed Feb 25, 2015 10:15 am
Please post the output of the following:
braindope
Posts: 80 Joined: Fri Sep 26, 2014 12:13 am
Post
by braindope » Wed Feb 25, 2015 7:03 pm
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
Box293
Too Basu
Posts: 5126 Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:
Post
by Box293 » Wed Feb 25, 2015 9:43 pm
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new
Privacy Policy .
braindope
Posts: 80 Joined: Fri Sep 26, 2014 12:13 am
Post
by braindope » Thu Feb 26, 2015 12:06 am
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$
}
Attachments
check sqljob.txt
(1.76 KiB) Downloaded 440 times
jdalrymple
Skynet Drone
Posts: 2620 Joined: Wed Feb 11, 2015 1:56 pm
Post
by jdalrymple » Thu Feb 26, 2015 12:25 pm
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.
braindope
Posts: 80 Joined: Fri Sep 26, 2014 12:13 am
Post
by braindope » Thu Feb 26, 2015 9:26 pm
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?
Box293
Too Basu
Posts: 5126 Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:
Post
by Box293 » Thu Feb 26, 2015 9:33 pm
run this as root and then run it as nagios and post the output from both:
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new
Privacy Policy .
braindope
Posts: 80 Joined: Fri Sep 26, 2014 12:13 am
Post
by braindope » Fri Feb 27, 2015 9:14 pm
Please see result below.
[root@pwnagios ~]# which java
/usr/bin/java
[nagios@pwnagios root]$ which java
/usr/bin/java
jdalrymple
Skynet Drone
Posts: 2620 Joined: Wed Feb 11, 2015 1:56 pm
Post
by jdalrymple » Mon Mar 02, 2015 12:32 pm
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?