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.
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.