Best practises to monitor galera cluster

hi all,

I want to monitor Galera Cluster and I found mysql-galera-cluster on exchange! This mkp is only for Check_MK Server, but which plugin should I copy to the agent ?

I copy the mk_mysql to the agent but it need mysql.cfg:
Could not open required defaults file: /mysql.cfg

Does anyone have any examples or links?

Thanks in advance

Iā€™ll try this first:

in the documentation they I should create mysql.cfg in /etc/check_mk/ and I did that but when I run the plugin I get:

grep: /mysql.cfg: No such file or directory
<<<mysql_ping>>>
[[]]
Could not open required defaults file: /mysql.cfg
Fatal error in defaults handling. Program aborted

Does anyone know why?

I add this line manually to the mk_mysql:
MK_CONFDIR=/etc/check_mk

This should not be necessary ā€“ the agent already sets this variable.
Donā€™t run the plugin on its own. Run the agent and check the output for the relevant sections, starting with ā€˜<<< mysqlā€™

1 Like

Or, if you really need to test the plugin separately, then set the variable ā€œon the flyā€ in the command call, like

sudo sh -c "MK_CONFDIR=/etc/check_mk /usr/lib/check_mk_agent/plugins/mk_mysql

No need to modify the plugin.

1 Like

Thank you so much @martin.schwarz you are right it works when the agent run it :slight_smile:

For testing its very good idea thank you.

Do you know where can I download those plugins Check Plug-Ins Catalog

2.35. MySQL

Have a look at the details of each plugin: these are ā€œofficial part of Check_MKā€, so no separate download required.

Once you have the mk_mysql plugin working on the client, just do a service discovery and you should find the new services.

1 Like

The check works already! so all above checks will be automatically added ?

I want to monitor for example global variables like: wsrep_cluster_config_id, wsrep_lost_committed etc.

I can see those already in the output of this:

BUt why I cant see those on check_mk ?

on Server side:
Do I have to copy all mysql from /omd/versions/1.6.0p27.cre/share/check_mk/checks#
mysql mysql_capacity mysql.include mysql_ping mysql_slave

to /omd/sites/mysite/local/share/check_mk/checks/ ?

No, on the monitoring server, everything should just work out of the box. No need to copy anything to the local hierarchy.

No sign of any mysql* check in the service discovery? Even after a ā€œfull scanā€?

Trying to debug this:

cmk -n -v -d $YOUR_HOST | fgrep -A1 '<<<mysql'
cmk -n -vv --no-cache --checks mysql,mysql_ping,mysql_sessions -II $YOUR_HOST
1 Like

@martin.schwarz thank you for your answer, in our checks folder we have only own checks so thats why I asked if I should copy something thereā€¦ until know I copy only mysql from check_mk to the checks folder on the server.

When I run that I get:

OMD[mysite]:~$ cmk -n -vv --no-cache --checks mysql,mysql_ping,mysql_sessions -II serverdm
Discovering services on: serverdm
serverdm:
Unknown plugin file mysql_sessions
Unknown plugin file mysql_sessions
+ FETCHING DATA
 [agent] No persisted sections loaded
 [agent] Not using cache (Cache usage disabled)
 [agent] Execute data source
 [agent] Connecting via TCP to 172.31.0.28:6556 (5.0s timeout)
 [agent] ERROR: Communication failed: [Errno 113] No route to host
 [piggyback] No persisted sections loaded
 [piggyback] Execute data source
No piggyback files for 'serverdm'. Skip processing.
No piggyback files for '172.31.0.28'. Skip processing.
Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/serverdm.mk
+ EXECUTING DISCOVERY PLUGINS (3)
  Trying discovery with: mysql, mysql_ping, mysql_sessions
Try aquire lock on /omd/sites/mysite/var/check_mk/autochecks/serverdm.mk
Got lock on /omd/sites/mysite/var/check_mk/autochecks/serverdm.mk
Releasing lock on /omd/sites/mysite/var/check_mk/autochecks/serverdm.mk
Released lock on /omd/sites/mysite/var/check_mk/autochecks/serverdm.mk
SUCCESS - Found no services, no host labels

So your monitoring server cannot connect to the checkmk agent on serverdm

Youā€™re talking about the checks folder in the local hierarchy, right?
That one should not matter for the mysql* checks since they are built-in and should be found in
~mysite/share/check_mk/checks/

But you need a working agent connection first.

1 Like

thank you so much @martin.schwarz it works like I want :slight_smile:

the system was down at the moment!

but now its exactly like I want :slight_smile:

thank you again

2 Likes

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.