UPTIME Threshold

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.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

UPTIME Threshold

Post 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.
Attachments
UPTime Definition
UPTime Definition
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UPTIME Threshold

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: UPTIME Threshold

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UPTIME Threshold

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: UPTIME Threshold

Post by amitgupta19 »

@ scottwilkerson : But where can i find this command definition?

Can you guide?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UPTIME Threshold

Post by scottwilkerson »

every nagios setup is different, but in most they are configured in a file called commands.cfg
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: UPTIME Threshold

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UPTIME Threshold

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: UPTIME Threshold

Post 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.
Attachments
services.cfg
(90.58 KiB) Downloaded 445 times
checkcommands.cfg
(26.06 KiB) Downloaded 448 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UPTIME Threshold

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked