Installing and configuring the snmp service in RedHatLinux Check System for installing the snmp service # rpm-qa | grepsnmpnet-snmp-5.3.2.2-17.el5net-snmp-perl-5.3.2.2-17.el5net-snmp-devel-5.3.2.2-17.el5net-snmp-libs-5.3.2.2-17.el5net-snmp-utils-5.3.2.2-17.e
Install and configure the snmp service in the RedHat Linux System
Check whether the system has installed the snmp service.
# Rpm-qa | grep snmp
Net-snmp-5.3.2.2-17.el5
Net-snmp-perl-5.3.2.2-17.el5
Net-snmp-devel-5.3.2.2-17.el5
Net-snmp-libs-5.3.2.2-17.el5
Net-snmp-utils-5.3.2.2-17.el5
Net-snmp-libs-5.3.2.2-17.el5
Net-snmp-devel-5.3.2.2-17.el5
The above installation packages will be available after the SNMP service is installed.
Install the SNMP service 1. Configure the local yum service and install it using yum
Yum install-y net-snmp *
2. Configure the SNMP service to start upon startup
# Chkconfig snmpd on
# Chkconfig -- list | grep snmpd check whether startup setting is successful
Snmpd 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
SNMP http://www.linuxidc.com/Linux/2013-09/90263.htm for Zabbix
Network Dynamic Analysis http://www.linuxidc.com/Linux/2013-04/83514.htm Based on SNMP
SNMP Network Status Monitoring http://www.linuxidc.com/Linux/2013-04/83187.htm
Building SNMP test environment http://www.linuxidc.com/Linux/2013-02/79233.htm in CentOS 6.3
Linux (Ubuntu/CentOS) SNMP configuration http://www.linuxidc.com/Linux/2012-12/76837.htm
Enable and configure the SNMP service http://www.linuxidc.com/Linux/2013-01/78487.htm for Citrix Xenserver
Verify SNMP Service 1. Use snmpwalk to get the host name
# Snmpwalk-v 2c-c public localhost sysName.0
SNMPv2-MIB: sysName.0 = STRING: wh69
Snmpwalk usage
Snmpwalk-v 1 | 2c | 3 (SNMP Version)-c IP address OID (object identifier)
2. Run the snmptranslate command to check whether the snmp tool can be used.
# Snmptranslate-To | head
. 1.3
. 1.3.6
. 1.3.6.1
. 1.3.6.1.1
. 1.3.6.1.2
. 1.3.6.1.2.1
. 1.3.6.1.2.1.1
. 1.3.6.1.2.1.1.1
. 1.3.6.1.2.1.1.2
. 1.3.6.1.2.1.1.3
If some oid is found, the snmp tool can be used normally.
Configure the SNMP service 1. Configure the SNMP connection string community string
# Vi/etc/snmp/snmpd. conf
Modify the following fields
# Sec. name source community
Com2sec notConfigUser default public
ModifyPublicCustom community string
2. Modify the permission to view device nodes
Find the following location in the configuration file/etc/snmp/snmpd. conf:
####
# Third, create a view for us to let the group have rights:
# Make at least snmpwalk-v 1 localhost-c public system fast again.
# Name incl/excl subtree mask (optional)
View systemview embedded ded. 1.3.6.1.2.1.1
View systemview embedded ded. 1.3.6.1.2.1.25.1.1
View: defines which node devices can be viewed.
By default, snmp can only view device information under nodes 1.3.6.1.2.1.1 and 1.3.6.1.2.1.25.1.1,
The host's CPU, memory, and other devices are not under these nodes, so the data cannot be obtained.
Therefore, you can modify the configuration as follows:
####
# Third, create a view for us to let the group have rights:
# Make at least snmpwalk-v 1 localhost-c public system fast again.
# Name incl/excl subtree mask (optional)
View systemview supported ded. 1
View systemview embedded ded. 1.3.6.1.2.1.1
View systemview embedded ded. 1.3.6.1.2.1.25.1.1
A line is added here:
View systemview supported ded. 1
Displays information about all devices on the. 1 node.
For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2014-07/104074p2.htm