Windows Tasks plugin : customize the mapping from return code to monitoring state

Hi All,

Please point me to the place I can do this in checkmk enterprise. Background: the checkmk service is already running for a couple of (filtered) scheduled windows tasks. Want to exclude some return codes which trigger false alarms.

Many thanks,
P.

Hi,

the mapping of the return codes is done in the windows_tasks check.
You can copy and customize it and save it in your sites ~/local structure.

1 Like

One last question on this:
Is …/sites/my_site/local/share/check_mk/checks/ the intended place for copying my modified scripts?
I am exploring the folder structure for sites on the server, would be great if there are some hidden gems in checkmk documentation you could point me to.

Thanks again,
P.

Hi Parsa,

yes, that is correct.
Imho there is currently a gap for developing stuff for version1.x between documentation that is not accessible any more and available documentation that will be only be valid for version 2.

Andre

1 Like

Updates: I modified the windows_tasks.py by adding my custom code:

...
_MAP_EXIT_CODES = {
'0x800710e0': (1, 'The operator or administrator has refused the request.'),
...

and copied it in the /sites/my_site/local/share/check_mk/checks/.
But I still get the same Critical status when a task returns this status code.

I was wondering what could possibly prevent the python script from running?

Thanks,
P.

Hi,

generally speaking it should work.

Make sure that

  1. The file has the correct permissions
  2. The file has the exact name of the original plugin
  3. You did not change anything in the check_info part

You can try to restart checkmk with cmk -R after you did the changes.

Works now! Must have been the permissions.
I opted for an older version of the script on Python 2.7, but must hold for the script you posted.

Thanks again!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.