Alerts on long uptime

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jamesc23
Posts: 82
Joined: Thu Jan 15, 2015 11:55 pm

Alerts on long uptime

Post by jamesc23 »

Hi,

I'm looking for a plugin that will send alert on servers with specific uptime (days). Can anyone please direct me to the right place?

I'm new to Nagios.

Thanks.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Alerts on long uptime

Post by jdalrymple »

check_uptime is one of the base plugins in the nagios-plugins package:

http://nagios-plugins.org/downloads/

Code: Select all

[root@localhost libexec]# ./check_uptime -w 12 -c 18 -u hours
Uptime CRITICAL: 0 day(s) 23 hour(s) 26 minute(s) | uptime=23.000000;12.000000;18.000000;
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Alerts on long uptime

Post by lmiltchev »

Are you monitoring Linux or Windows? For Linux, you can use "check_uptime":

Code: Select all

[root@testbox libexec]# ./check_uptime -u days -w 20 -c 40
Uptime WARNING: 36 day(s) 18 hour(s) 38 minute(s) | uptime=36.000000;20.000000;40.000000;
[root@testbox libexec]# ./check_uptime -u days -w 20 -c 30
Uptime CRITICAL: 36 day(s) 18 hour(s) 38 minute(s) | uptime=36.000000;20.000000;30.000000;
This way, you will be alerted if the number of days exceeds the warning or critical thresholds. If you want to be alerted if the number is less than the thresholds, you could use the plugin this way:

Code: Select all

[root@testbox libexec]# ./check_uptime -u days -w 40: -c 20:
Uptime WARNING: 36 day(s) 18 hour(s) 41 minute(s) | uptime=36.000000;0.000000;0.000000;
[root@testbox libexec]# ./check_uptime -u days -w 40: -c 50:
Uptime CRITICAL: 36 day(s) 18 hour(s) 40 minute(s) | uptime=36.000000;0.000000;0.000000;
Be sure to check out our Knowledgebase for helpful articles and solutions!
jamesc23
Posts: 82
Joined: Thu Jan 15, 2015 11:55 pm

Re: Alerts on long uptime

Post by jamesc23 »

Sorry. Just realised I double posted.

Please see this - https://support.nagios.com/forum/viewto ... 96#p147196

Thanks.
Locked