A: Cacti introduction
Cacti in the English meaning is the meaning of cactus, Cacti is a set of PHP,MYSQL,SNMP and RRDtool based on the development of network traffic monitoring graphical analysis tools. It uses Snmpget to get data, use RRDtool to draw graphics, and you can completely not need to understand RRDtool complex parameters. It provides very powerful data and user management functions, can specify each user can view the tree structure, host and any map, also can be combined with LDAP user authentication, but also can add their own templates, the function is very powerful perfect.
Two. Install the cacti server:
1. First to install the Epel extension source
2. (lamp) then install httpd, PHP, MySQL separately
Yum install-y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel
3. Install cacti NET-SNMP RRDtool
Yum install-y cacti Net-snmp net-snmp-utils rrdtool
After installation cacti is complete, the cacti.conf configuration file is generated by default under/etc/httpd/conf.d/and requires service httpd restart to restart the Apache configuration.
4. Start the service:
/etc/init.d/mysqld start
/ETC/INIT.D/HTTPD start
/ETC/INIT.D/SNMPD start
5. Edit the httpd configuration file
Vim/etc/httpd/conf.d/cacti.conf
Change "Deny from all" to "Allow from all"
/ETC/INIT.D/HTTPD restart
6. Import data Create cacti Library
MYSQL-UROOT-E "CREATE Database Cacti"
Create cacti User
MYSQL-UROOT-E "Grant all on cacti.* to ' cacti ' @ ' 127.0.0.1 ' identified by ' cacti ';"
Import SQL file
Mysql-uroot Cacti </usr/share/doc/cacti-0.8.8b/cacti.sql
7. Edit the cacti configuration file
vim/usr/share/cacti/include/config.php changes as follows:
$database _type = "MySQL";
$database _default = "cacti";
$database _hostname = "127.0.0.1";
$database _username = "cacti";
$database _password = "cacti";
$database _port = "3306";
$database _ssl = false;
8. Web Access cacti and installation
http://ip/cacti/
Click "Next" and "Finish" at two.
Enter Admin Admin login, reset new password
9. Execute poller.php, generate graphics, join scheduled Tasks
/usr/bin/php/usr/share/cacti/poller.php adding cron Tasks
CRONT-E Increase:
*/5 * * * */usr/bin/php/usr/share/cacti/poller.php
Second, install the client (add a Linux server)
1. Install SNMP
Yum Install-y Net-snmp
2. Modify Snmpd.conf
Modify Syslocation and Syscontact, where syslocation can write a machine ip,syscontact writing the admin mailbox
Syslocation 11.20
Syscontact Root[email protected]
3. Start SNMP
Service SNMPD Start
4. Login to the Cacti management background, click Console, then click Device, in the upper right corner, click "Add"
Description Write machine IP or you customize a name
Hostname Machine IP
Host Template Select Ucd/net SNMP Host
Version 2 of SNMP version selected
Click Create in the lower right corner
In the top right corner, click "Create Graphs for this Host"
Graph Types: Select Snmp-interface Statistics
Select the network card you want to monitor in the box below, for example, I choose Eth0, tick the right small square, then click Create in the lower right corner.
Graph Types: Then choose graph Template Based
In the box below, select the items you want to monitor, such as Ucd/net-load Average
Tick the right small square, then click Create in the lower right corner
5. Point to the left of graph Trees
Select "Default Tree"
Click Add in the upper right corner
Tree Item Type Select "Host"
Host Select the machine IP that we just added
Click Create in the lower right corner
6. Point at the top left corner of the graphs
On the left you can see
The Defaut tree below has added the host we just added, the graphics will not come out so quickly at first, it will be a little while.
linux-monitoring and safe operation Koriyuki cacti