Modify status to WARNING/CRITICAL when Spool directory file has not been updated since X minutes

CMK version:
2.1.0p31
OS version:
Debian Bulleseyes

I’m using spool directory (The spool directory - Adding file contents to agent outputs) to monitor cron tasks
These tasks write /var/lib/check_mk_agent/spool/<freshness_time>_<task_name>.txt
When the file has not been updated since <freshness_time>, the corresponding CheckMK service switch to UNKNOWN state.
Is it possible to modify it and choose WARNING or CRITICAL state ?
Thx

The checkmk agent package already contains mk-job to monitor cronjobs:

Hi Robert.
Thank you for your answer.
But using this way to do, how CheckMK detects that result file was not updated, meaning that cron job did not run, did not finished, is stalled …?
I’m coming from naemon and NSCA for passive monitoring. In naemon passive services, we could set a freshness, a status code and a message so that naemon raised a alert if no NSCA state was received from sender system after freshness delay.

State translation might work for you. Disclaimer: I never tried this to translate UNKNOWN to CRIT.

You can specify in the service’s check parameters how often the cronjob should run.

Thank you for you answers
We have Raw edition which does have the State translation rules
I’ll give a try to mk-job

mk-jobs was the solution for me.