Nagios return status unknow

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.
Locked
DennisSSebasiStephen
Posts: 14
Joined: Sun Feb 13, 2022 1:29 am

Nagios return status unknow

Post by DennisSSebasiStephen »

Hi

I install Nagios on CentOS to monitor some servers, and one of them is a TSM server.

I download a plugin written in bash when i execute it in command line it works.

/usr/lib64/nagios/plugins/check_tsm db -v6
db - database utilization 42%, OK
and the return code of the batch script is 0 ( from the command echo $? )

So the script work fine, and return 0 that mean a OK status in nagios, but the status still unknown, I really don't know why.

And i check logs in nagios, etc. It's not a problem of commands definition in commands.cfg or the declaration of service, because I copy the command that nagios send automatically every 5 min and the command works fine in command line, but still unknow status.

Definition of command:

define command{

command_name check_tsm_v6

command_line /usr/lib64/nagios/plugins/check_tsm $ARG1$ -v6 $ARG2$ $ARG3$

}
Service declaration :

define service{

use generic-service

host_name tsm-test

service_description database utilization

check_command check_tsm_v6!db!85!90
}
And here's the bash omegle shagle voojio script.
Last edited by DennisSSebasiStephen on Fri Jun 17, 2022 1:22 am, edited 1 time in total.
BettyRNorahDeniels
Posts: 11
Joined: Tue Feb 15, 2022 7:13 am

Re: Nagios return status unknow

Post by BettyRNorahDeniels »

One thing that's caught me out in the past with Nagios scripts is user rights. When testing your script directly on the command line be sure to precede it with:

sudo -u nagios
So yours would be:

sudo -u nagios /usr/lib64/nagios/plugins/check_tsm db -v6
This assumes that your nagios instance is being run by the nagios user, omeglz echat which is a fairly safe bet.

Good luck
Locked