Now that the SNMP protocol is removed, you need to contact us in this regard. So I found some articles about installing Linux SNMP. I found a very good tutorial, I would like to share it with you 。
Previously, we used cacti or mrtg to monitor switch traffic, but seldom used to monitor servers. Today, let's use cacti to monitor linux, today, we will first compile and install snmp and rrdtool 。
1. The installation of the snmpd required by cacti for linux monitoring is simple.
Tip: Due to the hardware firewall, remote udp packets may be faulty. You can modify the snmp port as follows:
Snmpd tcp: port or snmpd udp: Port
You can also directly modify/etc/rc. d/init. d/snmpd in linux.
For example, change to tcp: Port 100001
As follows:
Before Modification
OPTIONS = "-s-l/dev/null-P/var/run/snmpd-"
After modification
OPTIONS = "tcp: 100001-s-l/dev/null-P/var/run/snmpd-"
Then
/Etc/rc. d/init. d/snmpd restart is OK
2. cacti rrdtool for Linux SNMP Installation
If there is no requirement for localization, it is best to install the rpm package 。
Note: Install together during installation, otherwise errors may occur: rpm-ivh perl-rrdtool-1.2.23-1.el5.rf.i386.rpm rrdtool-1.2.23-1.el5.rf.i386.rpm
Mbstring is required. mbstring requires the libmbfl library, and Cacti uses pcre. Therefore, you must add -- with-pcre-regex -- with-mbstring -- with-libmbfl To Your Own compilation, you do not need to specify the path (remember )。
Compile by yourself:
Cp/usr/local/server/libpng/lib/pkgconfig/libpng12.pc/usr/local/server/libpng/lib/pkgconfig/libpng. pc/usr/local/server/freetype/lib/pkgconfig/freetype2.pc/usr/local/server/fontconfig/lib/pkgconfig/fontconfig. pc/usr/lib/pkgconfig/
3. Use of Linux SNMP to install cacti
Basic applications:
Decompress the package to the web directory and run mysql-uroot-p cacti <cacti. SQL vi include/config. php to change the database connection information.
We recommend that you create a newuser and grant the rrd and log directory permissions under cacti to the new user to create the task crontab-u newuser-e.
Add the following */5 */usr/local/server/php5/bin/php/usr/local/server/www/cacti/poller. php>/dev/null 2> & 1
At this point, the basic application is ready 。
In addition, you need to configure the snmp password and other information of the monitored Host:
Vi/etc/snmp/snmpd. conf
Change
1. com2sec notConfigUser default public
Changed to com2sec notConfigUser 127.0.0.1 (changed to the ip address of the monitoring server) public (changed to your own password)
2. access notConfigGroup "" any noauth exact systemview none
Changed to: access notConfigGroup "" any noauth exact all none
3. # view all supported ded. 1 80
Remove the # comment above 。