Page 1 of 1

How Uptime monitor works?

Posted: Mon Nov 05, 2018 4:07 pm
by lpereira
Hello All... i wanted to know how the uptime monitor works.

We have a few virtual servers loaded SSD Datastores, and the reboot for those boxes, took literally 4 or 5 seconds. So, there are no alerts for host unreacheable, it only looses 3 or 4 ping Packets. And no service alerts because the box "back to live" faster than the check periods.


In those scenarios, Should Uptime send an alert, indicating that the uptime for the server has been changed (for instance) from 566666 to 0?... If no, is there a way to configure the check in order to do it?

Thanks in advance.

Re: How Uptime monitor works?

Posted: Mon Nov 05, 2018 4:44 pm
by lmiltchev
Are you using the check_uptime plugin? It doesn't take under consideration any lost packets... If you are using check_ping, that's a different story. What are the thresholds that you are using? Can you show us the actual command that you are using, run from the command line, along with the output of it?

Re: How Uptime monitor works?

Posted: Mon Nov 05, 2018 4:50 pm
by lpereira
lmiltchev wrote:Are you using the check_uptime plugin? It doesn't take under consideration any lost packets... If you are using check_ping, that's a different story. What are the thresholds that you are using? Can you show us the actual command that you are using, run from the command line, along with the output of it?
i'm using the UPTIME plugin that is loaded along with the Windows Server Wizard

This is the output i got for the plugin

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME  
System Uptime - 13 day(s) 10 hour(s) 37 minute(s) |uptime=19357
Attached is the CCM configuration for the service.

Re: How Uptime monitor works?

Posted: Mon Nov 05, 2018 5:11 pm
by lmiltchev
You don't have any thresholds set on this check, so it is always going to return OK...

Try running something like this from the command line:

Code: Select all

# this should give you OK (exit code 0)
/usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME -l days -w 10 -c 5
echo $?

# this should give you WARNING (exit code 1)
/usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME -l days -w 15 -c 10
echo $?

# this should give you CRITICAL (exit code 2)
/usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME -l days -w 20 -c 15
echo $?
Note: This is an example with using "days" in thresholds. You could also use seconds, minutes or hours if you wish.

From the plugin's usage (help menu):
UPTIME =
Get the uptime of the machine.
-l <unit>
<unit> = seconds, minutes, hours, or days. (default: minutes)
Thresholds will use the unit specified above.
I would recommend that you add thresholds to your check, whatever makes sense in your environment.

Re: How Uptime monitor works?

Posted: Mon Nov 05, 2018 5:18 pm
by lpereira
lmiltchev wrote:You don't have any thresholds set on this check, so it is always going to return OK...

Try running something like this from the command line:

Code: Select all

# this should give you OK (exit code 0)
/usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME -l days -w 10 -c 5
echo $?

# this should give you WARNING (exit code 1)
/usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME -l days -w 15 -c 10
echo $?

# this should give you CRITICAL (exit code 2)
/usr/local/nagios/libexec/check_nt -H 172.30.XXXX -s "" -p 12489 -v UPTIME -l days -w 20 -c 15
echo $?
Note: This is an example with using "days" in thresholds. You could also use seconds, minutes or hours if you wish.

From the plugin's usage (help menu):
UPTIME =
Get the uptime of the machine.
-l <unit>
<unit> = seconds, minutes, hours, or days. (default: minutes)
Thresholds will use the unit specified above.
I would recommend that you add thresholds to your check, whatever makes sense in your environment.
Excellent i would definetly do that...

so the Wizard plugin has not any option to configure the days for the uptime? or is something i miss when i add the box into monitoring

Re: How Uptime monitor works?

Posted: Mon Nov 05, 2018 5:25 pm
by lmiltchev
No, you didn't miss it. There is no option to add thresholds in the wizard. You can always do it later though in the CCM.