I have a problem with a custom check in check_mk which I just do not understand.
I am monitoring a MySQL (actually MariaDB) Galera cluster. The mk_mysql plugin is placed on the hosts and successfully reporting it’s information. Part of the plugin output is details on the Galera cluster state but for this check_mk provides no predefined check.
So I downloaded a Galera check from here (https://github.com/HeinleinSupport/check_mk/blob/master/mysql/checks/mysql.galera) and put in in my “~/local/check_mk/checks” folder.
So far so good, the inventory run in WATO shows 5 new checks (all green) which I then add to the host and activate the changes. But as soon as Nagios triggers Check_MK the next time these 5 services go into “UNKNOWN - Check not implemented” state.
Running “cmk -v database.host” from the command line shows the 5 services in OK state, refreshing the service view in Nagios/WATO Web interface after that also shows the services in OK state. Running Check_MK for the host once more from Nagios (either by forcing an active check oder waiting for the next scheduled check) results in UNKNOWN again. Also manually running “python ~/var/check_mk/precompiled/database.host” refreshes the services in Nagios to UNKNOWN.
Shouldn’t “cmk -v database.host” lead to the exact same results as “python ~/var/check_mk/precompiled/database.host”??? I also recreated the procompiled check using “cmk -R” (verified by checking timestamp of precompiled check) but it makes no difference.
I have some more custom checks in “~/local/check_mk/checks” which all work flawlessly as they should and there is no difference in ownership and permissions between the checks. I could not see any obvious errors in the check file itself, inventory and check funtions are declared correctly. Parsed input should also work as it’s a sub-check of pre-existing mysql which declares the parsing function.
For good measure I performed a “omd restart” but nothing changes.
Any hints are greatly appreciated.