# Jobwatch ## (C) 2022, Michael Höß, MIT-Licensed ### What is jobwatch If you just want to execute a simple shell-script via cron every couple of hour, often only a few lines of code are required. But if you want to ensure the script really run, in the required interval, completed without error, you have to add a lot of plumping code. jobwatch helps to migitate this problem. It wraps the execution of your script, and does all the rest for you, by providing output, which can be fed to CheckMK by the Agent-Plugin-mechanism. jobwatch - checks for required _exit-codes_, and maps them to _OK, WARN, CRIT, UNKN (0-3)_ - _searches_ through the _console-output_ of your script via _regex_ to classify certain keywords as OK, WARN or CRIT (0, 1, 2) - sends previous regex matches to _logwatch_ - prevents running your job in multiple instances (previous job took longer than expected) - let you define the required run-intervals Simply add a .job-file into /etc/jobwatch.d where you defines all of this, call you script via jobwatch -j job in the crontab and you are done. TBD: - document deployment - document job-file (see included sample) - redirect script-output to a logfile via Config - job-timeout - more metrics (last-success-ful run )