mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
239 stars 94 forks source link

Check Windows Uptime with Warning and Critical Threshold #696

Open HigH-HawK opened 4 years ago

HigH-HawK commented 4 years ago

Issue and Steps to Reproduce

We are using the latest version of NSClient++ and would like to monitor our Windows VMs uptime in days. The check should also contain a warning and critical threshold.

Example: If the VM is up for 280+ days, it should pop up a warning and if the VM is up for 300+ days, it should pop up a critical message.

Since NSClient++ has the SystemCheck module, which contains the uptime check, we thought it would be as easy as just adding the command into our *.ini file and we would be good to go but it seems that we are doing something wrong. The check pops up in Icinga2 but the setup thresholds are not considered.

[/settings/system/uptime]
check_uptime "warn=uptime > 280d" "crit=uptime > 300d"

I have a slight suspicion, that the [/settings/system/uptime] is not correct but couldn't find any proper explanation, what else to use.

Expected Behavior

We want to show the current uptime of the monitored VM in Icinga2 and get warned, if the warning/critical threshold has been reached.

Actual Behavior

It currently show the uptime of the VM in Icinga2 but despite having set the warning/critical threshold to a certain value (see above), it is being shown in Icinga2 as follows:

Label Value Warning Critical
uptime 30.02 d 2.00 d 1.00 d

Details

Additional Details

NSClient++ log:

The log is clear and does not show any error regarding this command.