Self written plugin to monitor informix table what to print so thats recognised in scan?

Hi all,

i have written a python script which connects to an informix database and prints its findings.
I tried printing stuff like:
<<>>
tablename; OK 106

executing with python3 <filename.py> works.

I installed with

sudo install -m 0755 mk_filename.py /usr/lib/check_mk_agent/plugins/60

and tried to rescan and use like mk_apt which is a bash script which works without problems.

I am using the docker version Checkmk Cloud Edition 2.3.0p2 on an Ubuntu 22.04.3 LTS
I know of devel_check_plugins

Any ideas/ways to troubleshoot?
Best Bodo

You also need a corresponding check plugin in the site that is able to parse your data section.

If you do not want to implement that you can use Local checks, which are more easy.

1 Like

Hi Robert,

thanks for your quick answer pointing me in the right direction. :slight_smile:

The bash examples work every minute if i install them in a dir named 60 → great.
I tried to run a python program with no success.
Is this possible? Do i need special shebangs?
Are there any logs i can follow when check_mk is not recognizing an output?

Running the python program via crontab and let it produce a bash script would not be as elegant as i want,

best,
Bodo

PS: Just managed to run a simple python script, i guess import pyodbc, psycopg2 of the full plugin is failing
PPS: No, it works, checkmk seems to be very strict with the output, will investigate further

A Local Check script is only allowed to output lines conforming to the Local Check format.

Hi again,

with your hint and the excellent documentation for checkmk i was able to
write a local plugin in python which does an informix login and gets data from a table.

Very useful was the output of
/var/lib/check_mk_agent/cache/local_mk_.py.cache
which is produced when the program exists for example:
/usr/lib/check_mk_agent/local/6/<mk_my-python-program>.py

Cave: the env variables are not the same. I had to write a text-file and import them via load_dotenv,

best,
Bodo