I have been getting some questions and emails about problems with adding linux client to Zenoss monitoring as explained in my post on Install Zenoss Monitoring Server on CentOS 6. I decided to post the SNMP daemon configuration i use, to add linux client to Zenoss monitoring server and write in general how to get things working.
Following this post you will learn how to configure linux client to be monitored via SNMP by your Zenoss server. By adding linux client to Zenoss monitoring, you will be able to see relevant linux client data and also linux client performance graphs in your Zenoss server web GUI.
Let’s learn how to Add Linux Client to Zenoss Monitoring!
1. Install Net SNMP package
You should install “net-snmp” package which provides SNMP daemon and other requirements for successful SNMP monitoring.
yum install net-snmp -y
2. Configure Client SNMP
SNMP daemon is configured via /etc/snmp/snmpd.conf file. By editing snmpd.conf file you can configure the client to accept SNMP communication and by that also allow Zenoss server to get information from your linux client. I use the following SNMP daemon configuration:
## System location and contact information syslocation MY DC syscontact info@geekpeek.net ## sec.name source community com2sec notConfigUser default geekpeeksnmp ## groupName securityModel securityName group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser ## Make at least snmpwalk -v 1 localhost -c public system fast again. ## name incl/excl subtree mask(optional) view systemview included .1 ## group context sec.model sec.level prefix read write notifications access notConfigGroup "" any noauth exact systemview none none
The following parameters are important to you:
- “syslocation” parameter is the information about the location of your client.
- “syscontact” parameter gives information about the administrator email.
- “com2sec notConfigUser default geekpeeksnmp” line is important since the “geekpeeksnmp” is the unique comunity name i use. This community name must be defined on the Zenoss server side also, when adding a new linux client. If the correct community name is not provided, the Zenoss server will not be able to get SNMP information from the linux client.
3. Re-configure IPTables
Reconfigure IPTables on the linux client to allow SNMP traffic. The SNMP traffic is running on UDP port 161. Add the following line to /etc/sysconfig/iptables file and reload IPTables service.
-A INPUT -m state --state NEW -m udp -p udp --dport 161 -j ACCEPT
4. Start SNMP service
Now you have to start the SNMP daemon service on your linux client and make it start at boot.
[root@client01 ~]# /etc/init.d/snmpd start Starting snmpd: [ OK ] [root@client01 ~]# chkconfig snmpd on
5. Add Linux Client to Zenoss
Go to Zenoss web GUI and click to add a new client. In the add new client form enter the linux client name or IP address, choose the device class and click on “more” to define the “SNMP Community” parameter according to the linux client.
6. Test Client Configuration
You should be able to test out the linux client SNMP configuration by running a “snmpwalk” command from your Zenoss monitoring server as follows where:
- “-v2c” tells snmpwalk to use SNMP v2
- “-cgeekpeeksnmp” is the SNMP community name to use
- “client01.geekpeek.net” the hostname of the server to probe
- “system” prints system information
[root@zenoss ~]# snmpwalk -v2c -cgeekpeeksnmp client01.geekpeek.net system SNMPv2-MIB::sysDescr.0 = STRING: Linux client01.geekpeek.net 2.6.32-431.20.5.el6.x86_64 #1 SMP Fri Jul 25 08:34:44 UTC 2014 x86_64 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (52367626) 6 days, 1:27:56.26 SNMPv2-MIB::sysContact.0 = STRING: info@geekpeek.net SNMPv2-MIB::sysName.0 = STRING: client01.geekpeek.net SNMPv2-MIB::sysLocation.0 = STRING: MY DC SNMPv2-MIB::sysORLastChange.0 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDMIBObjects.3.1.1 SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup SNMPv2-MIB::sysORDescr.1 = STRING: The MIB for Message Processing and Dispatching. SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching. SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB. SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP. SNMPv2-MIB::sysORUpTime.1 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.2 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.3 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.4 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.5 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.6 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.7 = Timeticks: (1) 0:00:00.01 SNMPv2-MIB::sysORUpTime.8 = Timeticks: (1) 0:00:00.01
We are finished with the Add Linux Client to Zenoss Monitoring post. If you get a “Timeout: No response from …” error check the firewall configuration between Zenoss server and linux client.