Page 1 of 3

UPTIME Threshold

Posted: Tue Mar 06, 2018 7:14 am
by amitgupta19
i am using the plugin check_nt with the NSCliet++ .

i tried to define the threshold for UPTIME of the server as follows:

check_nt ! UPTIME -l hours -c 5

But it is not generating the alert.

i have attached the screenshot from the file services.cfg

kindly refer to it and suggest where i am wrong.

Re: UPTIME Threshold

Posted: Tue Mar 06, 2018 4:32 pm
by scottwilkerson
In order to assist further, can you post the command you are trying to configure running it from the command line, and can you also show the configuration you have for the check_nt check command

Thanks

Re: UPTIME Threshold

Posted: Wed Mar 07, 2018 5:22 am
by amitgupta19
Please refer to the following URL:

https://www.monitoring-plugins.org/doc/ ... ck_nt.html

I am using the plugin mentioned in the URL.

Please refer to the command UPTIME in the above URL.

I am not able to find the command in my Nagios for the UPTIME.

Please suggest.

Re: UPTIME Threshold

Posted: Wed Mar 07, 2018 10:03 am
by scottwilkerson
I'm looking for the command definition for check_nt in you setup.

Commands are defined like this

Code: Select all

define command {
    command_name    check_pop
    command_line    /usr/local/nagios/libexec/check_pop -H $HOSTADDRESS$
}
https://assets.nagios.com/downloads/nag ... ml#command

Re: UPTIME Threshold

Posted: Wed Mar 07, 2018 12:24 pm
by amitgupta19
@ scottwilkerson : But where can i find this command definition?

Can you guide?

Re: UPTIME Threshold

Posted: Wed Mar 07, 2018 1:06 pm
by scottwilkerson
every nagios setup is different, but in most they are configured in a file called commands.cfg

Re: UPTIME Threshold

Posted: Wed Mar 14, 2018 9:45 am
by amitgupta19
Command Definition
Command Definition
i searched in the server and found the file name as checkcommands.cfg

But UPTIME was not defined there.

I defined it in the file as per the screenshot attached.

Re: UPTIME Threshold

Posted: Wed Mar 14, 2018 11:04 am
by scottwilkerson
Your picture in the first post is calling a command called check_nt This picture is check_nt_uptime

we need to see check_nt

Re: UPTIME Threshold

Posted: Wed Mar 14, 2018 12:15 pm
by amitgupta19
Even i was also wondering the same.

But same is working for memory usage and USED Disk Space.

i am uploading the service.cfg and commands.cfg file.

Please refer to the USEDDISKSPACE and MEMUSE.

Re: UPTIME Threshold

Posted: Wed Mar 14, 2018 1:30 pm
by scottwilkerson
it's in there
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s secret-password760 -v $ARG1$ $ARG2$
}
The check_command line in your OP should be

Code: Select all

check_nt!UPTIME!-l hours -c 5
You are missing 1 !

So you should be able to test this from the command line running (replacing IP_ADDRESS with a real IP

Code: Select all

./check_nt -H IP_ADDRESS -p 12489 -s secret-password760 -v UPTIME -l hours -c 5