Can't see custon oracle Queries

CMK version=2.0.0p34 CRE:
OS version: linux

Hello all and thank you for reading! This is my first Post here and im totaly new to CheckMK.

I want to monitor a Remote Oracle Database from an already monitored linux-appserver.

  • On the Linux-Server there was already an agent installed.
  • I downloaded the oracle-plugin+plugin-config from the agents my site offers.
  • I configured the Oracle-plugin on the linux server following this guide: Oracle-Datenbanken überwachen
  • I configured the remote-instance: all i enabled/changed in the mk_oracle.cfg are these to lines:
REMOTE_INSTANCE_1='someuser:somepass::someserver:1521::someSID:19.13:'
REMOTE_ORACLE_HOME='/usr/lib/oracle/19.19/client64'

And the oracle-Services appeared for the linux-host

So far so good. But im not interested in the default oracle-monitoriing-services i just want to execute some custom sql on the monitored instance.

So i added this excample to the mk_oracle.cfg

SQLS_SECTIONS="invalid_objects"
SQLS_DIR=/etc/check_mk
SQLS_MAX_CACHE_AGE=10

invalid_objects () {
  SQLS_SIDS=REMOTE_INSTANCE_1
  SQLS_ITEM_SID=someSID
  SQLS_ITEM_NAME="DB Sessions"
  SQLS_SQL=mySQL.sql
}

The mySQL.sql contains this:

/*Syntax help in comments. The first word is always the key word and ends with a ":"*/

/*details:Text to display in the service detail output*/
prompt details: Some details for the service output;

/*perfdata:METRIKNAME=CURRENTVALUE;WARN;CRIT;MAX METRIKNAME=CURRENTVALUE2;WARN;CRIT;MAX*/
prompt perfdata:MyMetricName1=10;15;20;30 MyMetricName2=16;15;20;30;
prompt perfdata:MyMetricName3=21;15;20;30 MyMetricName4=15;15;20;30;

/*long:Text to display in the long output of the service*/
prompt long: Here comes some long output for the service;
prompt long: Here comes some more long output for the service;

/*exit:Status of the service as a number*/
prompt exit:2;

So far so good. But the new Service dont show up in Checkmk :frowning:

mk_oracle -l shows following at the end:

someSID|iostat_file|Temp File|280|63|4|65|19|116|39|281|2097152|12582912|0|13631488
<<<oracle_sql:sep(58)>>>
[[[someSID|DB Sessions]]]
details: Some details for the service output
perfdata:MyMetricName1=10;15;20;30 MyMetricName2=16;15;20;30
perfdata:MyMetricName3=21;15;20;30 MyMetricName4=15;15;20;30
long: Here comes some long output for the service
long: Here comes some more long output for the service
exit:2
elapsed:.07785

What am i doing wrong?

Thank you very mutch,

Andre

Hi Andre,
thanks for this post, did help me a lot.
you did it well, only you missed to update checkMK itself.


in CheckMK dashboard ‘Setup’ go to host, click ‘Save and go to service Configuration’ click ‘rescan’ ans check Undecided services.

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