Page 1 of 1
Alerts on long uptime
Posted: Thu Jul 30, 2015 12:58 am
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.
Re: Alerts on long uptime
Posted: Thu Jul 30, 2015 9:10 am
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;
Re: Alerts on long uptime
Posted: Thu Jul 30, 2015 9:15 am
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;
Re: Alerts on long uptime
Posted: Thu Jul 30, 2015 9:05 pm
by jamesc23
Sorry. Just realised I double posted.
Please see this -
https://support.nagios.com/forum/viewto ... 96#p147196
Thanks.