3. Download and install
Download the Chinese cacti and decompress it to/var/www/cacti. Then enter the cacti directory. Import the cacti data structure.
: Cacti-0.8.7e-cn-utf8.tar.gz
- # Cd/var/www/cacti
-
- # Mysql-u cacti-P cacti <cacti. SQL
-
Modify configuration file
- # Vim/var/www/cacti/include/config. php
-
- $ Database_type = "MySQL ";
-
- $ Database_default = "cacti ";
-
- $ Database_hostname = "localhost ";
-
- $ Database_username = "cacti ";
-
- $ Database_password = "passwd ";
-
- $ Database_port = "3306 ";
-
Add a cacti user
- $ Useradd cacti-D/var/www/cacti-S/bin/false
-
- $ Chown-r cacti/var/www/cacti/RRA/var/www/cacti/log
-
The above may not work:
- # Chown-HR cacti/var/www/cacti/RRA/var/www/cacti/log
-
4. Configure the httpd server configuration file
- # Vim/etc/httpd/CONF. d/cacti. conf
-
- Alias/cacti/var/www/cacti
-
- Directoryindex index. php
-
- AllowOverride all
-
- Order deny, allow
-
- Deny from all
-
- Allow from all
-
- Addtype application/X-httpd-PHP. php
-
- Php_flag magic_quotes_gpc on
-
- Php_flag track_vars on
-
Restart the HTTPd service to make the above modification take effect.
- #/Etc/init. d/httpd restart
-
5. test whether the installation is normal.
Open the following URL.
Http://server.ip.or.name/cacti
Open the website, click Next, select new install, and press Enter.
The Last User Name is admin and the password is admin.
6. Final
The system collects data every five minutes.
- Crontab-e
-
- */5 * cacti PHP/var/www/cacti/poller. php &>/dev/null
-
You can also run it once manually:/var/www/cacti/poller. php
7. Solution to abnormal font display in the image
Download and install the cjkuni-fonts Chinese font, Ukai. TTF, http://ftp.tw.debian.org/debian/pool/main/t/ttf-arphic-ukai/ttf-arphic-ukai_0.1.20060928.orig.tar.gz
- # Tar zxvf ttf-arphic-ukai_0.1.20060928.orig.tar.gz
-
- # Cd ttf-arphic-ukai-0.1.20060928/
-
- # Cp Ukai. TTF/usr/share/fonts/Ukai. TTF
-
After the installation is complete, note the following two required changes in "Settings. general-> rrdtool application version changed to 1.2.x. The default value is 1.0.x. the image may not be displayed normally. path-> the default font path of rrdtool is changed to the Ukai installed above. TTF file path, such as/usr/share/fonts/Ukai. TTF
8. SNMP file settings of the monitored host
SNMP needs to be configured for the monitored host. (Thank you for your reminder)
- # Vi/etc/snmp/snmpd. conf
-
Change
- Com2sec notconfiguser default public
Change
- Com2sec notconfiguser 127.0.0.1 public
2. Change
- Access notconfiggroup "" any noauth exact systemview none
-
Change
- Access notconfiggroup "" any noauth exact all none
-
3,
- # View all supported ded. 1 80
-
Remove the # comment above. Save and exit
The above are very important. Please note that you will not be able to get the data.
9. Test whether SNMP is normal
- # Snmpwalk-C public-V 2C localhost
-
- # Snmpwalk-V 1-C public localhost IP-MIB: ipadentifindex
-
- IP-MIB: ipadentifindex.61.xxx. XXX. XXX = integer: 2 IP-MIB: ipadentifindex.127.0.0.1 = integer: 1 IP-MIB: ipadentifindex.172.xxx. XXX. XXX = integer: 3
-
You can also run the snmpd-F-Le command to check whether any errors have occurred.
Through the above article, everyone should learn how to install cacti on centos. I hope this article will help you!