A Zabbix template for pacemaker cluster monitoring with virtual ip.
Author: Vadim Ipatov <vadim.ipatov@zabbix.com> (euphoria.vi@gmail.com)
Metric | Description |
---|---|
pacemaker.cluster.dc | Current cluster DC (Designated Coordinator) |
pacemaker.cluster.failed_actions | The current number of failed actions |
pacemaker.cluster.maintenance | Shows if the cluster is in the maintenance state |
pacemaker.nodes.offline | The current number of offline (or in the shutdown state) nodes |
pacemaker.process.corosync.active | Shows if corosync daemon is in the running state |
pacemaker.process.pacemakerd.active | Shows if pacemakerd daemon is in the running state |
pacemaker.resources.failed | The current number of failed (non active or blocked) resources |
pacemaker.status | Service item for data gathering |
node.name | Node hostname. If it changes, it could mean that the VIP has been moved to another node |
You need to configure every cluster nodes as shown below:
UserParameter=pacemaker.status, sudo /usr/sbin/crm_mon --as-xml
Restart zabbix_agent
Copy "configs/zbx_pacemaker.sudoers" into /etc/sudoers.d or manually add that rule:
zabbix ALL=NOPASSWD: /usr/sbin/crm_mon --as-xml
You can check that everything works correctly by using crm_mon dumps in “tests” folder.
For this purpose you need to copy dumps to cluster nodes (or use your own) and add this UserParameter to config:
UserParameter=pacemaker.test[*], cat /etc/zabbix/zabbix_agentd.d/tests/$1
Then change "pacemaker.status" item key to "pacemaker.test[sampleN.xml]" and save.
Also you could manually edit sample file for test different cluster states.