9.8. Querying a Pacemaker Cluster with SNMP (Red Hat Enterprise Linux 7.5 and later)
9.8. Querying a Pacemaker Cluster with SNMP (Red Hat Enterprise Linux 7.5 and later)
As of Red Hat Enterprise Linux 7.5, you can use the pcs_snmp_agent daemon to query a Pacemaker cluster for data by means of SNMP. The pcs_snmp_agent daemon is an SNMP agent that connects to the master agent (snmpd) by means of agentx protocol. The pcs_snmp_agent agent does not work as a standalone agent as it only provides data to the master agent.
The following procedure sets up a basic configuration for a system to use SNMP with a Pacemaker cluster. You run this procedure on each node of the cluster from which you will be using SNMP to fetch data for the cluster.
Install the pcs-snmp package on each node of the cluster. This will also install the net-snmp package which provides the snmp daemon.
yum install pcs-snmp
# yum install pcs-snmp
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Add the following line to the /etc/snmp/snmpd.conf configuration file to set up the snmpd daemon as master agentx.
master agentx
master agentx
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Add the following line to the /etc/snmp/snmpd.conf configuration file to enable pcs_snmp_agent in the same SNMP configuration.
view systemview included .1.3.6.1.4.1.32723.100
view systemview included .1.3.6.1.4.1.32723.100
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Copy to ClipboardCopied!Toggle word wrapToggle overflow
To check the configuration, display the status of the cluster with the pcs status and then try to fetch the data from SNMP to check whether it corresponds to the output. Note that when you use SNMP to fetch data, only primitive resources are provided.
The following example shows the output of a pcs status command on a running cluster with one failed action.
pcs status
Cluster name: rhel75-cluster
Stack: corosync
Current DC: rhel75-node2 (version 1.1.18-5.el7-1a4ef7d180) - partition with quorum
Last updated: Wed Nov 15 16:07:44 2017
Last change: Wed Nov 15 16:06:40 2017 by hacluster via cibadmin on rhel75-node1
2 nodes configured
14 resources configured (1 DISABLED)
Online: [ rhel75-node1 rhel75-node2 ]
Full list of resources:
fencing (stonith:fence_xvm): Started rhel75-node1
dummy5 (ocf::pacemaker:Dummy): Stopped (disabled)
dummy6 (ocf::pacemaker:Dummy): Stopped
dummy7 (ocf::pacemaker:Dummy): Started rhel75-node2
dummy8 (ocf::pacemaker:Dummy): Started rhel75-node1
dummy9 (ocf::pacemaker:Dummy): Started rhel75-node2
Resource Group: group1
dummy1 (ocf::pacemaker:Dummy): Started rhel75-node1
dummy10 (ocf::pacemaker:Dummy): Started rhel75-node1
Clone Set: group2-clone [group2]
Started: [ rhel75-node1 rhel75-node2 ]
Clone Set: dummy4-clone [dummy4]
Started: [ rhel75-node1 rhel75-node2 ]
Failed Actions:
* dummy6_start_0 on rhel75-node1 'unknown error' (1): call=87, status=complete, exitreason='',
last-rc-change='Wed Nov 15 16:05:55 2017', queued=0ms, exec=20ms
# pcs status
Cluster name: rhel75-cluster
Stack: corosync
Current DC: rhel75-node2 (version 1.1.18-5.el7-1a4ef7d180) - partition with quorum
Last updated: Wed Nov 15 16:07:44 2017
Last change: Wed Nov 15 16:06:40 2017 by hacluster via cibadmin on rhel75-node1
2 nodes configured
14 resources configured (1 DISABLED)
Online: [ rhel75-node1 rhel75-node2 ]
Full list of resources:
fencing (stonith:fence_xvm): Started rhel75-node1
dummy5 (ocf::pacemaker:Dummy): Stopped (disabled)
dummy6 (ocf::pacemaker:Dummy): Stopped
dummy7 (ocf::pacemaker:Dummy): Started rhel75-node2
dummy8 (ocf::pacemaker:Dummy): Started rhel75-node1
dummy9 (ocf::pacemaker:Dummy): Started rhel75-node2
Resource Group: group1
dummy1 (ocf::pacemaker:Dummy): Started rhel75-node1
dummy10 (ocf::pacemaker:Dummy): Started rhel75-node1
Clone Set: group2-clone [group2]
Started: [ rhel75-node1 rhel75-node2 ]
Clone Set: dummy4-clone [dummy4]
Started: [ rhel75-node1 rhel75-node2 ]
Failed Actions:
* dummy6_start_0 on rhel75-node1 'unknown error' (1): call=87, status=complete, exitreason='',
last-rc-change='Wed Nov 15 16:05:55 2017', queued=0ms, exec=20ms
Copy to ClipboardCopied!Toggle word wrapToggle overflow
We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.
About Red Hat
We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.