Setting Check_MK windows_tasks plugin ‘running’ to OK

How to adjust the windows_tasks Windows Check_MK plugin to set the status for Windows Tasks as OK when they are running.

All that is required to accept ‘running’ as an OK state will be to add state code 267009 as an accepted state in the Check_MK windows_tasks file. To do this, simply replace the section that looks like this and replace with the below. This will swap the way the check works, so by default the state will be 2 (CRIT) unless the state code is 0 or 267009.

nano /usr/share/check_mk/checks/windows_tasks

def check_windows_tasks(item, _no_params, info):
info = windows_tasks_convert(info)
for name, values in info.items():
if name == item:
last_result = saveint(values[‘Last Result’])
state = 2
label = “(!!)”
msg = []
if last_result == 0 or last_result == 267009:
state = 0
label = “”
msg.append(“Service in state: %s%s” % ( last_result, label ) )

Restart Check_MK on the server to update this setting.

cmk -R


Any comments or questions? Get in touch here or Email me at [email protected]