Newely (re-)created (mysql/MariaDB) database not seen by plugin mk_mysql

CMK version: 2.1.0p14
OS version: Rocky Linux 8.6 (Green Obsidian)

Error message: Item not found in monitoring data

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

Checkmk version 2.1.0p14
Try license usage history update.
Trying to acquire lock on /omd/sites/comsolve/var/check_mk/license_usage/next_run
Got lock on /omd/sites/comsolve/var/check_mk/license_usage/next_run
Trying to acquire lock on /omd/sites/comsolve/var/check_mk/license_usage/history.json
Got lock on /omd/sites/comsolve/var/check_mk/license_usage/history.json
Next run time has not been reached yet. Abort.
Releasing lock on /omd/sites/comsolve/var/check_mk/license_usage/history.json
Released lock on /omd/sites/comsolve/var/check_mk/license_usage/history.json
Releasing lock on /omd/sites/comsolve/var/check_mk/license_usage/next_run
Released lock on /omd/sites/comsolve/var/check_mk/license_usage/next_run
+ FETCHING DATA
  Source: SourceType.HOST/FetcherType.PROGRAM
[cpu_tracking] Start [7f33e7e27c40]
[ProgramFetcher] Fetch with cache settings: DefaultAgentFileCache(test04.comsolve.nl, base_path=/omd/sites/comsolve/tmp/check_mk/cache, max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
Not using cache (Too old. Age is 31 sec, allowed is 0 sec)
[ProgramFetcher] Execute data source
Calling: ssh -T root@172.16.0.124
Write data to cache file /omd/sites/comsolve/tmp/check_mk/cache/test04.comsolve.nl
Trying to acquire lock on /omd/sites/comsolve/tmp/check_mk/cache/test04.comsolve.nl
Got lock on /omd/sites/comsolve/tmp/check_mk/cache/test04.comsolve.nl
Releasing lock on /omd/sites/comsolve/tmp/check_mk/cache/test04.comsolve.nl
Released lock on /omd/sites/comsolve/tmp/check_mk/cache/test04.comsolve.nl
[cpu_tracking] Stop [7f33e7e27c40 - Snapshot(process=posix.times_result(user=0.0, system=0.010000000000000009, children_user=0.03, children_system=0.0, elapsed=1.4299999997019768))]
  Source: SourceType.HOST/FetcherType.PIGGYBACK
[cpu_tracking] Start [7f33e78651f0]
[PiggybackFetcher] Fetch with cache settings: NoCache(test04.comsolve.nl, base_path=/omd/sites/comsolve/tmp/check_mk/data_source_cache/piggyback, max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=True, use_outdated=False, simulation=False)
Not using cache (Cache usage disabled)
[PiggybackFetcher] Execute data source
No piggyback files for 'test04.comsolve.nl'. Skip processing.
No piggyback files for '172.16.0.124'. Skip processing.
Not using cache (Cache usage disabled)
[cpu_tracking] Stop [7f33e78651f0 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
+ PARSE FETCHER RESULTS
  Source: SourceType.HOST/FetcherType.PROGRAM
<<<check_mk>>> / Transition NOOPParser -> HostSectionParser
<<<cmk_agent_ctl_status:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<checkmk_agent_plugins_lnx:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<labels:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<df>>> / Transition HostSectionParser -> HostSectionParser
<<<df>>> / Transition HostSectionParser -> HostSectionParser
<<<systemd_units>>> / Transition HostSectionParser -> HostSectionParser
<<<nfsmounts>>> / Transition HostSectionParser -> HostSectionParser
<<<cifsmounts>>> / Transition HostSectionParser -> HostSectionParser
<<<mounts>>> / Transition HostSectionParser -> HostSectionParser
<<<ps_lnx>>> / Transition HostSectionParser -> HostSectionParser
<<<mem>>> / Transition HostSectionParser -> HostSectionParser
<<<lxc_container_cpu_cgroupv2>>> / Transition HostSectionParser -> HostSectionParser
<<<uptime>>> / Transition HostSectionParser -> HostSectionParser
<<<lnx_if>>> / Transition HostSectionParser -> HostSectionParser
<<<lnx_if:sep(58)>>> / Transition HostSectionParser -> HostSectionParser
<<<lnx_bonding:sep(58)>>> / Transition HostSectionParser -> HostSectionParser
<<<tcp_conn_stats>>> / Transition HostSectionParser -> HostSectionParser
<<<diskstat>>> / Transition HostSectionParser -> HostSectionParser
<<<md>>> / Transition HostSectionParser -> HostSectionParser
<<<vbox_guest>>> / Transition HostSectionParser -> HostSectionParser
<<<job>>> / Transition HostSectionParser -> HostSectionParser
<<<local:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<mysql_ping>>> / Transition HostSectionParser -> HostSectionParser
<<<mysql>>> / Transition HostSectionParser -> HostSectionParser
<<<mysql_capacity>>> / Transition HostSectionParser -> HostSectionParser
<<<mysql_slave>>> / Transition HostSectionParser -> HostSectionParser
<<<yum:cached(1667093030,3600)>>> / Transition HostSectionParser -> HostSectionParser
Trying to acquire lock on /omd/sites/comsolve/var/check_mk/persisted/test04.comsolve.nl
Got lock on /omd/sites/comsolve/var/check_mk/persisted/test04.comsolve.nl
Releasing lock on /omd/sites/comsolve/var/check_mk/persisted/test04.comsolve.nl
Released lock on /omd/sites/comsolve/var/check_mk/persisted/test04.comsolve.nl
Stored persisted sections: lnx_packages, lnx_distro, lnx_cpuinfo, lnx_uname, lnx_video, lnx_ip_r, lnx_sysctl, lnx_block_devices
Using persisted section SectionName('lnx_packages')
Using persisted section SectionName('lnx_distro')
Using persisted section SectionName('lnx_cpuinfo')
Using persisted section SectionName('lnx_uname')
Using persisted section SectionName('lnx_video')
Using persisted section SectionName('lnx_ip_r')
Using persisted section SectionName('lnx_sysctl')
Using persisted section SectionName('lnx_block_devices')
  -> Add sections: ['check_mk', 'checkmk_agent_plugins_lnx', 'cifsmounts', 'cmk_agent_ctl_status', 'df', 'diskstat', 'job', 'labels', 'lnx_block_devices', 'lnx_bonding', 'lnx_cpuinfo', 'lnx_distro', 'lnx_if', 'lnx_ip_r', 'lnx_packages', 'lnx_sysctl', 'lnx_uname', 'lnx_video', 'local', 'lxc_container_cpu_cgroupv2', 'md', 'mem', 'mounts', 'mysql', 'mysql_capacity', 'mysql_ping', 'mysql_slave', 'nfsmounts', 'ps_lnx', 'systemd_units', 'tcp_conn_stats', 'uptime', 'vbox_guest', 'yum']
  Source: SourceType.HOST/FetcherType.PIGGYBACK
No persisted sections
  -> Add sections: []
Received no piggyback data
Received no piggyback data
[cpu_tracking] Start [7f33e7816700]
value store: synchronizing
Trying to acquire lock on /omd/sites/comsolve/tmp/check_mk/counters/test04.comsolve.nl
Got lock on /omd/sites/comsolve/tmp/check_mk/counters/test04.comsolve.nl
value store: loading from disk
Releasing lock on /omd/sites/comsolve/tmp/check_mk/counters/test04.comsolve.nl
Released lock on /omd/sites/comsolve/tmp/check_mk/counters/test04.comsolve.nl
CPU utilization      Total CPU: 3.71%
Check_MK Agent       Version: 2.1.0p14, OS: linux, Transport via SSH, Agent plugins: 3, Local checks: 0
Disk IO SUMMARY      Read: 24.3 kB/s, Write: 488 kB/s, Latency: 2 milliseconds
Filesystem /         13.51% used (4.21 of 31.20 GB), trend: -90.54 MB / 24 hours
Interface 2          [eth0], (up), MAC: 32:80:E5:6F:F1:1E, Speed: 10 GBit/s, In: 4.78 kBit/s (<0.01%), Out: 25.3 kBit/s (<0.01%)
Memory               Total virtual memory: 4.99% - 408.61 MB of 8.00 GB, 8 additional details available
Mount options of /   Mount options exactly as expected
MySQL Connections mysql Max. parallel connections since server start: 0.66%, Currently open connections: 0.66%
MySQL DB Size mysql:wordpress Item not found in monitoring data
MySQL InnoDB IO mysql read: 0.00 B/s, write: 0.00 B/s
MySQL Instance mysql MySQL Deamon is alive
MySQL Sessions mysql 1 total, 1 running, 0.12 connections/s
MySQL Version mysql  Version: 10.9.3-MariaDB
Systemd Service Summary Total: 80, Disabled: 6, Failed: 0
TCP Connections      Established: 2
Uptime               Up since Oct 24 2022 23:29:59, Uptime: 5 days 4 hours
YUM Updates          All packages are up to date, Last Update was run at 2022-10-30 01:22:00
No piggyback files for 'test04.comsolve.nl'. Skip processing.
No piggyback files for '172.16.0.124'. Skip processing.
[cpu_tracking] Stop [7f33e7816700 - Snapshot(process=posix.times_result(user=0.07000000000000028, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.07000000029802322))]
[agent] Success, execution time 1.5 sec | execution_time=1.500 user_time=0.070 system_time=0.010 children_user_time=0.030 children_system_time=0.000 cmk_time_ds=1.390 cmk_time_agent=0.000
OMD[comsolve]:~

Expected behaviour
When an new (or a database is dropped and recreated) a database is created it should pop up as unmonitored.

Seen behaviour
this is 2-way:

  • if you create a database not yet before in monitoring it will not show up as new item/unmonitored.
  • if you drop a monitored database, and recreate it, it will no longer be monitored, and the result is it shows up as ‘item not found’

The question here is - is the database shown inside the agent output?
Only if it is there it can be shown as unmonitored.

I found out what the issue was … the new (still empty) database is not shown in the query done by the plugin.

SELECT table_schema, sum(data_length + index_length), sum(data_free)  FROM information_schema.TABLES GROUP BY table_schema;

As soon as the database is ‘filled’ it will again show up in the query and then gets re-inserted into monitoring ( if it was already present) - if not it will show up as a new unmonitored service.

Somewhere this feels wrong, as the database exists, it should (imho) be monitored - even if it reports as empty,
When i issue (from within mysql):

Show databases;

I do see the database as present.

Expectations:
IF a database exists it should be monitored.
The fact that a/the database is empty in MySQL/mariaDB does not mean it should be omitted from monitoring.

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.