check_uptime

Check computer uptime (time since last reboot).

Implementation

WindowsLinuxFreeBSDMacOSX
✅✅✅✅

Argument Defaults

ArgumentDefault Value
warninguptime < 2d
criticaluptime < 1d
empty-state0 (OK)
empty-syntax
top-syntax%(status) - %(list)
ok-syntax
detail-syntaxuptime: %(uptime), boot: %(boot | utc)

Check Specific Arguments

None

Attributes

Filter Keywords

these can be used in filters and thresholds (along with the default attributes):

AttributeDescription
uptimeHuman readable time since last boot
uptime_valueUptime in seconds
bootUnix timestamp of last boot

Examples

Default Check

check_uptime
OK - uptime: 3d 02:30h, boot: 2023-11-17 19:33:46 UTC |'uptime'=268241s;172800:;86400:

Example using check_snclient and Naemon

Naemon Config

define command{
    command_name         check_snclient
    command_line         $USER1$/check_snclient -k -p 'your-password' -u 'https://$HOSTADDRESS$:8443' $ARG1$ $ARG2$
}

define service {
    host_name            testhost
    service_description  check_uptime
    use                  generic-service
    check_command        check_snclient!check_uptime!'warn=uptime < 180s' 'crit=uptime < 60s'
}