Page 1 of 1

How to enable critical alert for uptime

Posted: Wed Mar 03, 2021 11:34 am
by informatica
Hi Team,

Could you please help me on the how to enable alert for uptime. If any linux/windows is restarted with 2 min we should get alert.
how we can put enable critical alert if the server is not up from last two min.

Ex: if uptime is less then two minutes we should get the alert.

Re: How to enable critical alert for uptime

Posted: Wed Mar 03, 2021 6:40 pm
by jdunitz

Re: How to enable critical alert for uptime

Posted: Thu Mar 04, 2021 3:48 am
by informatica
HI Team,

Here you can go some example what exact we required. The below sever uptime is 4 min. If the server is uptime less than 2 min we should get critical alert. We need these kind of help. I tried to change as minutes but its not working please help on threshold changes.

[root@inl77t libexec]# uptime
04:40:28 up 4 min, 1 user, load average: 0.02, 0.10, 0.05


[root@inl77libexec]# ./check_uptime -u minutes -c 2
Uptime CRITICAL: 0 day(s) 0 hour(s) 7 minute(s) | uptime=7.000000;;2.000000;
[root@inl77t libexec]# ./check_uptime -u minutes -c 2
Uptime CRITICAL: 0 day(s) 0 hour(s) 7 minute(s) | uptime=7.000000;;2.000000;
[root@inl77t libexec]# ./check_uptime -u minutes -c 1
Uptime CRITICAL: 0 day(s) 0 hour(s) 7 minute(s) | uptime=7.000000;;1.000000;
[root@inl77 libexec]# ./check_uptime -u minutes -c 10
Uptime OK: 0 day(s) 0 hour(s) 8 minute(s) | uptime=8.000000;;10.000000;

The uptime script is working if the servers is up from 4 min it is givning alert but our concern is if the server is down and if its uptime shows less than 2 min we should get the alert.

Re: How to enable critical alert for uptime

Posted: Thu Mar 04, 2021 6:27 pm
by benjaminsmith
Hi,

The following check would result in critical if the server has been up less than 2 minutes. The default unit for the plugin is minutes. Let me know if that works for you.

Code: Select all

./negate -s ./check_uptime -c 2
Best Regards,
Benjamin