Uptime Powered
Uptime Powered
Good afternoon
I am trying to configure nagios to alarm if the server is powered on for more than 60 days.
But I can't, does anyone know how I can do this?
With -c it alarms when it is shorter than the time I set.
I am trying to configure nagios to alarm if the server is powered on for more than 60 days.
But I can't, does anyone know how I can do this?
With -c it alarms when it is shorter than the time I set.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Uptime Powered
The default unit is minutes
Try
or convert to minutes 60 * 24 * 60 = 86400
Code: Select all
-u, Time unit of measurement (seconds|minutes|hours|days) (default: minutes)
Code: Select all
/usr/local/nagios/libexec/check_uptime -c 60 -u days
Code: Select all
/usr/local/nagios/libexec/check_uptime -c 86400
Re: Uptime Powered
I want it to be critical when it is on for more than 60 days, this command is for when it is less than 60 days on.scottwilkerson wrote:The default unit is minutesTryCode: Select all
-u, Time unit of measurement (seconds|minutes|hours|days) (default: minutes)
or convert to minutes 60 * 24 * 60 = 86400Code: Select all
/usr/local/nagios/libexec/check_uptime -c 60 -u days
Code: Select all
/usr/local/nagios/libexec/check_uptime -c 86400
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Uptime Powered
Not true, here's my example with a machine that has been up 85 days (more than 60)martinsrs wrote:I want it to be critical when it is on for more than 60 days, this command is for when it is less than 60 days on.
Code: Select all
[root@localhost ~]# uptime
11:44:37 up 85 days, 2:25, 2 users, load average: 0.35, 0.36, 0.25
[root@localhost ~]# /usr/local/nagios/libexec/check_uptime -c 60 -u days
Uptime CRITICAL: 85 day(s) 2 hour(s) 25 minute(s) | uptime=85.000000;;60.000000;
Code: Select all
/usr/local/nagios/libexec/check_uptime -c 60: -u days
Re: Uptime Powered
How do I do this in Windows, is it the same thing?
In NSClient it looks like this:
alias_up = checkUpTime MinWarn = 1d MinWarn = 1h
And in Webadmin I passed the command that spoke.
In NSClient it looks like this:
alias_up = checkUpTime MinWarn = 1d MinWarn = 1h
And in Webadmin I passed the command that spoke.
Re: Uptime Powered
How do I do this in Windows, is it the same thing?scottwilkerson wrote:Not true, here's my example with a machine that has been up 85 days (more than 60)martinsrs wrote:I want it to be critical when it is on for more than 60 days, this command is for when it is less than 60 days on.for clarity, the command for LESS THAN 60 days would beCode: Select all
[root@localhost ~]# uptime 11:44:37 up 85 days, 2:25, 2 users, load average: 0.35, 0.36, 0.25 [root@localhost ~]# /usr/local/nagios/libexec/check_uptime -c 60 -u days Uptime CRITICAL: 85 day(s) 2 hour(s) 25 minute(s) | uptime=85.000000;;60.000000;
Code: Select all
/usr/local/nagios/libexec/check_uptime -c 60: -u days
In NSClient it looks like this:
alias_up = checkUpTime MinWarn = 1d MinWarn = 1h
And in Webadmin I passed the command that spoke.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Uptime Powered
No it is definitely different.martinsrs wrote:How do I do this in Windows, is it the same thing?
something like
Code: Select all
alias_up_60 = check_uptime "crit=uptime > -60d"