Monitor Redhat Cluster with SNMP

Now that you have created your Redhat cluster, how do you properly monitor services that may or may not be running on a node? By using the cluster-snmp package.

For Redhat/Centos, on each of your nodes install the cluster-snmp agent.

[root@server1 snmp]# yum search cluster-snmp
=============================================== N/S Matched: cluster-snmp ================================================
cluster-snmp.x86_64 : Red Hat Enterprise Linux Cluster Suite - SNMP agent
[root@server1 snmp]# yum install cluster-snmp
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos.mirror.freedomvoice.com
 * extras: centos.mirror.ndchost.com
 * updates: mirror.raystedman.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package cluster-snmp.x86_64 0:0.16.2-20.el6 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
==========================================================================================================================
 Package                         Arch                      Version                          Repository               Size
==========================================================================================================================
Installing:
 cluster-snmp                    x86_64                    0.16.2-20.el6                    base                    124 k
 
Transaction Summary
==========================================================================================================================
Install       1 Package(s)
 
Total download size: 124 k
Installed size: 367 k
Is this ok [y/N]: y
Downloading Packages:
cluster-snmp-0.16.2-20.el6.x86_64.rpm                                                              | 124 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : cluster-snmp-0.16.2-20.el6.x86_64                                                                      1/1 
  Verifying  : cluster-snmp-0.16.2-20.el6.x86_64                                                                      1/1 
 
Installed:
  cluster-snmp.x86_64 0:0.16.2-20.el6                                                                                     
 
Complete!

Add the following to the top of your snmpd.conf file. Update the path to just /usr/lib if not using x86_64.

dlmod RedHatCluster /usr/lib64/cluster-snmp/libClusterMonitorSnmp.so

And in the views.

view systemview included REDHAT-CLUSTER-MIB:RedHatCluster

Now restart your snmp daemon.

[root@server1 snmp]# service snmpd restart
Stopping snmpd:                                            [  OK  ]
Starting snmpd:                                            [  OK  ]

Walk your snmp tree and see all the wonderful MIBs that are now exposed.

[root@server1 snmp]# snmpwalk -v 2c -c public server1 .1.3.6.1.4.1.2312
SNMPv2-SMI::enterprises.2312.8.1.1.0 = INTEGER: 2
SNMPv2-SMI::enterprises.2312.8.2.1.0 = STRING: "mysql-cluster"
SNMPv2-SMI::enterprises.2312.8.2.2.0 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.2.3.0 = STRING: "All services and nodes functional"
SNMPv2-SMI::enterprises.2312.8.2.4.0 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.2.5.0 = INTEGER: 2
SNMPv2-SMI::enterprises.2312.8.2.6.0 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.2.7.0 = INTEGER: 2
SNMPv2-SMI::enterprises.2312.8.2.8.0 = STRING: "server1, server2"
SNMPv2-SMI::enterprises.2312.8.2.9.0 = INTEGER: 2
SNMPv2-SMI::enterprises.2312.8.2.10.0 = STRING: "server1, server2"
SNMPv2-SMI::enterprises.2312.8.2.11.0 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.2.12.0 = ""
SNMPv2-SMI::enterprises.2312.8.2.13.0 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.2.14.0 = STRING: "mysql"
SNMPv2-SMI::enterprises.2312.8.2.15.0 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.2.16.0 = STRING: "mysql"
SNMPv2-SMI::enterprises.2312.8.2.17.0 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.2.18.0 = ""
SNMPv2-SMI::enterprises.2312.8.2.19.0 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.2.20.0 = ""
SNMPv2-SMI::enterprises.2312.8.2.21.0 = INTEGER: 16
SNMPv2-SMI::enterprises.2312.8.3.1.1.1.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.49 = STRING: "server1"
SNMPv2-SMI::enterprises.2312.8.3.1.1.1.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.50 = STRING: "server2"
SNMPv2-SMI::enterprises.2312.8.3.1.1.2.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.49 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.3.1.1.2.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.50 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.3.1.1.3.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.49 = STRING: "Participating in cluster"
SNMPv2-SMI::enterprises.2312.8.3.1.1.3.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.50 = STRING: "Participating in cluster"
SNMPv2-SMI::enterprises.2312.8.3.1.1.4.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.49 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.3.1.1.4.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.50 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.3.1.1.5.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.49 = STRING: "mysql"
SNMPv2-SMI::enterprises.2312.8.3.1.1.5.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.50 = ""
SNMPv2-SMI::enterprises.2312.8.3.1.1.6.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.49 = INTEGER: 1
SNMPv2-SMI::enterprises.2312.8.3.1.1.6.15.98.117.114.98.45.109.121.115.113.108.45.112.48.48.50 = INTEGER: 2
SNMPv2-SMI::enterprises.2312.8.3.2.1.1.5.109.121.115.113.108 = STRING: "mysql"
SNMPv2-SMI::enterprises.2312.8.3.2.1.2.5.109.121.115.113.108 = INTEGER: 0
SNMPv2-SMI::enterprises.2312.8.3.2.1.3.5.109.121.115.113.108 = STRING: "running"
SNMPv2-SMI::enterprises.2312.8.3.2.1.4.5.109.121.115.113.108 = STRING: "automatic"

SNMPv2-SMI::enterprises.2312.8.3.2.1.5.5.109.121.115.113.108 = STRING: “server1”

Leave a Reply

Your email address will not be published. Required fields are marked *