Monitoring treasure recommended use of NET-SNMP, so this article also take this as an example.
First, we install NET-SNMP.
The code is as follows |
Copy Code |
Yum Install Net-snmp net-snmp-devel net-snmp-utils
|
Next we start to configure NET-SNMP.
Before configuring, we need to confirm that SELinux is turned off (CentOS system attention), and then temporarily stop NET-SNMP
The code is as follows |
Copy Code |
Service SNMPD Stop
|
Then, add a read-only account (such as vpsaa.com), create a password (such as 123456), and transmit it in MD5
1 |
Net-snmp-config--create-snmpv3-user-ro-a 123456-a MD5 vpsaa.com |
The code is as follows |
Copy Code |
Service SNMPD Start
|
Add NET-SNMP to the startup item
The code is as follows |
Copy Code |
Chkconfig snmpd on
|
Then we check the NET-SNMP
1 |
Snmpwalk-v 3-u vpsaa.com-a md5-a "123456"-l authnopriv 127.0.0.1 SYSDESCR |
If everything works, you'll see some information about the output.
Finally, because Zhao Jong here the server opened the iptables, so you need to add the monitoring IP address in the rule:
60.195.252.107
60.195.252.110
The code is as follows |
Copy Code |
Iptables-i input-p udp-s 60.195.252.107–dport 161-j ACCEPT
Iptables-i input-p udp-s 60.195.252.110–dport 161-j ACCEPT
|
OK, finish the above work, we login our monitor treasure account (if not, please register, address: www.jiankongbao.com)
As shown above, select "Monitor" in the account-"server performance Monitoring", then click on the right "add Server", fill in the following figure the necessary information, and finally Add.
When you are done, you can click on the "Add Monitoring item" on the next page.
Finally, complete the server monitoring add, here should be noted that if you use to monitor the VPs, based on the OpenVZ architecture, the last disk IO will prompt "Your server does not support the monitoring project, please add Diskio module for the SNMP agent", OpenVZ users please cancel this item.