[Check_mk (english)] windows_tasks.ps1 fire upon exit code 1

Hey guys and girls, I'm using the standard plugin windows_tasks.ps1 to monitor windows scheduled tasks. I'm running a lot of python scripts as scheduled tasks, and if anything goes wrong, python exits with an exit code 1 instead of 0.

To my surprise, the check_mk windows_tasks.ps1 script still returns OK is the return code is 1. This correct according to documentation, but I want it to return a CRIT when the exit code is 1.

I know how local checks work, and wrote a few myself, but I have no idea how this one works. This is the output the powershell script is returning for example:

TaskName : \users_60_days_disable
Last Run Time : 11/28/2019 5:30:02 AM
Next Run Time : 11/29/2019 5:30:00 AM
Last Result : 0
Scheduled Task State : Enabled

TaskName : \users_notifyarchive
Last Run Time : 11/26/2019 6:45:56 AM
Next Run Time : 12/3/2019 6:45:54 AM
Last Result : 1
Scheduled Task State : Enabled

And this is how it ends up in Check_MK:

Task \users_60_days_disable Open the action menu OK - Service Status: operation completed successfully (0x0), Last run time: 11/28/2019 5:30:02 AM, Next run time: 11/29/2019 5:30:00 AM 2019-08-27 15:05:12 46.6 s
OK Task \users_notifyarchive Open the action menu OK - Service Status: task containing a popup action (0x1), Last run time: 11/26/2019 6:45:56 AM, Next run time: 12/3/2019 6:45:54 AM 2019-08-29 08:49:13 46.6 s

However, I don't seem to be able to configure any parameters for this service, can you guys help me figure out how I can change this behaviour??

And yes, I could add wrappers to the python scripts to change the return codes, but I'd rather not change all these scripts. To me, exit code 1 is bad, mkay.. :slight_smile:

Angelo.