First install snmp # yuminstall-ynet-snmpnet-snmp-utils and then configure snmp Step 1: (the configuration file installed in yum is/etc/snmp/snmpd. conf, a lot of things in it, a very detailed document, but I always have an excuse not to go into detail, move it first, and then create a snmpd by myself. conf) # mv/etc/snmp/s
First install snmp
# Yum install-y net-snmp-utils
Then configure snmp
Step 1:
(The configuration file for yum installation is/etc/snmp/snmpd. conf, a lot of things in it, a very detailed document, but I always have an excuse not to go into detail, move it first, and then create a snmpd by myself. conf)
# Mv/etc/snmp/snmpd. conf/etc/snmp/snmpd. conf. bak
# Vi/etc/snmp/snmpd. conf
Enter "rouser jiankongbao auth" to save and quit.
(In v3c authentication mode, add a read-only account, as follows: rouser jiankongbao auth indicates that in v3c, "rouser" indicates the type of the read-only account, the "jiankongbao" is the specified user name, and the "auth" at the end indicates that verification is required .)
Step 2: Create the jiankongbao user. we need this file:/var/net-snmp/snmpd. conf. This file will be automatically called when snmpd is started. because we have not run snmp yet, manually create this file by running the following command:
# Mkdir/var/net-snmp
# Touch/var/net-snmp/snmpd. conf
# Vim/var/net-snmp/snmpd. conf
Enter the following text "createUser jiankongbao MD5 mypassword"
(This line of configuration means to create a user named "jiankongbao" with the password "mypassword" and use MD5 for encrypted transmission. It should be noted that the password must contain at least 8 bytes. this is the SNMP protocol. if the password is smaller than 8 bytes, communication will fail .)
Finally run snmp
# Service snmpd start
Set to automatically run upon startup
# Chkconfig snmpd on
Now you can add server monitoring in the monitoring treasure background.