Install SNMP in CentOS
1. Make sure that the snmp service is installed on the Linux host.
Rpm-qa | grep snmp
Net-snmp-libs-5.1.2-11.EL4.7
Net-snmp-5.1.2-11.EL4.7
If not, find the snmp rpm package on the Linux installation disk for installation, or search for the rpm package suitable for your Linux release on the Internet for installation, or use yum.
2. Installation
You may need to install
Yum install-y net-snmp
Yum install-y net-snmp-devel
Yum install-y net-snmp-libs
Yum install-y net-snmp-perl
Yum install-y net-snmp-utils
Yum install-y mrtg
Some of them are not necessary.-y refers to answering yes to all questions, saving the interaction during installation.
3. Start
Input
Snmpd
Service snmpd start
And
Service snmpd status
View the service status.
Note: sometimes it appears after the service snmpd status is entered
Snmpd dead but pid file exists
Or
Snmpd dead but subsys locked
The reason is that snmpd is not input first. The principle is not very clear, but remember it first.
4. Configuration
After installation, modify/etc/snmp/snmpd. conf to configure it.
A. Modify the default community string.
Com2sec notConfigUser default public
Modify public to a string that you only know
B. Remove the # below
# View mib2 shortded .iso.org. dod. internet. mgmt. mib-2 fc
C. Run the following statement
Access notConfigGroup "" any noauth exact systemview none
Changed:
Access notConfigGroup "" any noauth exact mib2 none
5. Restart the snmpd service
/Etc/rc. d/init. d/snmpd restart
Complete snmpd Configuration
6. Ensure that the Linux iptables firewall has enabled udp port 161 access to our traffic monitoring server.
You can use iptables-L-n to view the current iptables rule.
You can edit the/etc/sysconfig/iptables file to modify iptables rules.