I found a lot of methods for installing SNMP in Ubuntu on the Internet, and the results are not available. The methods I have summarized below are for your reference only ~ 1. The Installationsudo-iapt-getinstallsnmpdsnmp2.Configuration rename the/etc/snmp/snmpd. conf configuration file to/etc/snmp/snmpd.conf.org: mv/etc/snmp
I found a lot of methods for installing SNMP in Ubuntu on the Internet, and the results are not available. The methods I have summarized below are for your reference only ~
1. Installation
Sudo-I
Apt-get install snmpd snmp
2. Configuration
Rename the configuration file/etc/snmp/snmpd. conf to/etc/snmp/snmpd.conf.org:
Mv/etc/snmp/snmpd. conf/etc/snmp/snmpd.conf.org
Create a new/etc/snmp/snmpd. conf file:
Rocommunity public
Syslocation "Chengdu"
Syscontact mail@mail.com
Open/etc/default/snmpd:
Gedit/etc/default/snmpd
Find
# Snmpd options (use syslog, close stdin/out/err ).
SNMPDOPTS = '-Lsd-Lf/dev/null-u snmp-I-smux-p/var/run/snmpd. pid 127.0.0.1'
Change it
# Snmpd options (use syslog, close stdin/out/err ).
# SNMPDOPTS = '-Lsd-Lf/dev/null-u snmp-I-smux-p/var/run/snmpd. pid 127.0.0.1'
SNMPDOPTS = '-Lsd-Lf/dev/null-u snmp-I-smux-p/var/run/snmpd. pid-c/etc/snmp/snmpd. conf'
Restart snmpd
/Etc/init. d/snmpd restart
3. Test
Snmpwalk-v 1-c public localhost
An output indicates that snmp and snmpd have been installed successfully.