Topic Description : Install cacti as a universal monitoring tool in the Redhat system.
Environment Description: i The client uses the Win7 system to telnet to the Linux server via Putty
Client Ip:192.168.0.23,linux server ip:192.168.0.56 (using intranet)
Cacti principle: Cacti itself is a PHP script, all its functions are done by its plug-in, cacti through the SNMP protocol with the monitored host to obtain communication, monitored host monitoring parameters are stored in a RRA file in the cacti directory, By RRDtool This tool to read the data in this file regularly, and then make the table, rendering to the client.
Installation process:
One: Install lamp environment (can skip this step with lamp environment)
Cacti itself is a PHP program so need to have php,cacti in the process of work will have a lot of data, this data is stored in MySQL, so need to install MySQL database, about lamp environment online There is a lot of information, here I will also demonstrate my installation process, But not necessarily for your environment, different versions of the installation process are not the same. I'm a redhat6.5 here.
1. Installing Apache
Yum-y Install httpd
Start after installation is complete
Service httpd Start
2. Install MySQL
Yum-y install MySQL mysql-server mysql-devel
When the installation is complete, start:
Service mysqld Start
To add a password for the root user of MySQL:
mysqladmin-u root password "password"
3. Install PHP and PHP support
Yum-y Install PHP Php-mysql
After the installation is complete, create a index.php file in the/var/www/html/directory and write the contents:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/0F/wKioL1U_AV2zZO6jAACMPnmUqBU498.jpg "title=" QQ picture 20150428113023.jpg "alt=" Wkiol1u_av2zzo6jaacmpnmuqbu498.jpg "/>
Browser Input in the Win7 system http://192.168.56/index.php (You need to enter your own server IP) The following interface appears to indicate that PHP installation was successful
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/13/wKiom1U_ASmgA7zpAAgzcaVs4wI375.jpg "title=" QQ picture 20150428113135.png "alt=" wkiom1u_asmga7zpaagzcavs4wi375.jpg "width=" "height=" 526 "border=" 0 "hspace=" 0 " Vspace= "0" style= "width:1000px;height:526px;"/> if there is no connection, try to close Sulinux:setenforce 0
The Lamp installed successfully
Second, the installation of cacti and cacti support tools required
1. Install SNMP
The cacti is working with the SNMP protocol, the Simple Network Management Protocol, so install the SNMP protocol.
Yum-y Install NET-SNMP net-snmp-devel net-snmp-libs net-snmp-utils
To start the SNMP service:
Service SNMPD Start
Modifying a configuration file
Open/etc/snmp/snmpd.conf This file
Vim/etc/snmp/snmpd.conf
Find Com2sec This line, change the default to 127.0.0.1
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/10/wKioL1U_JTrBFqhVAABdvLRk4HU843.jpg "title=" QQ picture 20150428121456.jpg "alt=" Wkiol1u_jtrbfqhvaabdvlrk4hu843.jpg "/>
Change the SystemView of line 62nd to all:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/10/wKioL1U_JbXBjUr1AABdSG2oMvE375.jpg "title=" QQ picture 20150428121537.jpg "alt=" Wkiol1u_jbxbjur1aabdsg2omve375.jpg "/>
Remove the comments from line 85th
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/10/wKioL1U_JdTzc-MMAABI4zXnQEg696.jpg "title=" QQ picture 20150428121606.jpg "alt=" Wkiol1u_jdtzc-mmaabi4zxnqeg696.jpg "/>
Service SNMPD Restart
Complete.
3, installation cacti
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/14/wKiom1U_KMTSuUFiAAbVNEzGU6g494.jpg "title=" QQ picture 20150428142502_ copy. jpg "width=" "height=" 351 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:351px ; "alt=" wkiom1u_kmtsuufiaabvnezgu6g494.jpg "/>
I am here in win7 download cacti-0.8.8c.tar.gz This package, to the server (I use SSH), can also be downloaded directly on the server, but my server does not have the download tool, only the client download, to the server.
Unpack the package:
TAR-XVF cacti-0.8.8c.tar.gz
Get cacti-0.8.8c This file, move this file to/var/www/html/and rename it to cacti/
MV cacti-0.8.8c/var/www/html/cacti/
Complete
4. Install Drawing Tools RRDtool
Yum-y Install Ttdtool
Iii. preparatory work
1. Create Cacti Users
Useradd cacti
2. Database connection:
cd/var/www/html/cacti/
Mysql-u root-p, enter the database.
Mysql>create database cacti;
Exit the database, in the current directory
Mysql-u root-p cacti<cacti.sql, enter password, complete
3. Modify the config.php file
cd/var/www/html/cacti/include/
Vim config.php
Find the following lines, change the username to Cacti,password to your own, I will use the demonstration here cacti
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/11/wKioL1U_ORTzuWViAAHX--gkWYg557.jpg "title=" QQ picture 20150428152021_ copy. jpg "width=" "height=" 444 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:444px ; "alt=" wkiol1u_ortzuwviaahx--gkwyg557.jpg "/>
Remove the following line of comments
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/11/wKioL1U_OdzhmkOMAAEHyC12rig597.jpg "title=" QQ picture 20150428152050_ copy. png "width=" "height=" 216 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:216px ; "alt=" Wkiol1u_odzhmkomaaehyc12rig597.jpg "/> completed.
4. Set up routine tasks
#crontab-e-u cacti
*/5 * * * * php/var/www/html/cacti/poller.php > Dev/null 2>&1
Iv. entering the Cacti interface
1, finish the above steps can enter cacti interface, in Win7 browser input http://192.168.0.56/cacti/Enter
(Again, here you have to enter your own server IP address http://ip/cacti/), the following interface appears to indicate the successful installation,
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/16/wKiom1U_QsbxvJnWAAQuxX7gg5E395.jpg "title=" QQ picture 20150428161938.png "Width=" "height=" 462 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:462px; " alt= "Wkiom1u_qsbxvjnwaaquxx7gg5e395.jpg"/>
2. Click Next to select the new install
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/12/wKioL1U_ROvSg2slAAGi1an5-Dg687.jpg "title=" QQ picture 20150428162257.png "Width=" "height=" 276 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:800PX;HEIGHT:276PX; " alt= "Wkiol1u_rovsg2slaagi1an5-dg687.jpg"/>3, the following interface is a check interface, it is important to note that all the selection is green, if there is a red, indicating that there is no installation need to reinstall in the server, Refresh the interface again,
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/12/wKioL1U_RX-xWTerAATsxdC_w-Y375.jpg "title=" QQ picture 20150428162420.png "Width=" "height=" 702 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:702px; " alt= "Wkiol1u_rx-xwteraatsxdc_w-y375.jpg"/>
4, this interface is not a problem after clicking Finish
Enter an interface, the default account and password are admin,login after the system will force you to reset a password,
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/16/wKiom1U_RQWgGl-_AAFaSkEQgCE431.jpg "title=" QQ picture 20150428162725.png "Width=" "height=" 473 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:800PX;HEIGHT:473PX; " alt= "Wkiom1u_rqwggl-_aafaskeqgce431.jpg"/>
5. Click Save to enter the cacti interface
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/12/wKioL1U_RsKCnIzgAANL8gHV9hw033.jpg "title=" QQ picture 20150428163106.png "Width=" "height=" 388 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:388px; " alt= "Wkiol1u_rskcnizgaanl8ghv9hw033.jpg"/>
The cacti installation is complete
Five, the installation process of problem solving
1. You are not having permission to access/cacti/graph_view.php in this server.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/16/wKiom1U_SBSTV0QNAAEyXpmr1Xw211.jpg "title=" QQ picture 20150428145649_ copy. png "width=" "height=" 398 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:398px ; "alt=" wkiom1u_sbstv0qnaaeyxpmr1xw211.jpg "/>
May be because SELinux is turned on, and SELinux is turned off
#setenforce 0
2. Cannot connect to MySQL server "localhost" appears. Sure you have specifield a valid MySQL database name in include/config.php
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/16/wKiom1U_SCrh_Kr-AAEVVgMcJew049.jpg "title=" QQ picture 20150428145908.png "Width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:800PX;HEIGHT:97PX; "alt = "Wkiom1u_scrh_kr-aaevvgmcjew049.jpg"/>
It may be that the above connection database which step did not do, as follows:
#cd/var/www/html/cacti/
#mysql-U root-p cacti<cacti.sql
Enter password, restart MySQL
#service mysqld Restart
If it still doesn't work, it could be a permissions issue
Mysql-u root-p enter password into MySQL database
Mysql>grant all on cacti.* to [e-mail protected] identified by ' cacti ';
Mysql>grant all on cacti.* to [e-mail protected] identified by ' cacti ';
mysql> flush Privileges;
Mysql>quit
Restart the MySQL service, refresh the interface to see
You can also make a soft connection: Ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock Refresh interface. Note: The above three methods I encountered cacti above error resolution, if there is no workaround, you need to find another method.
3, cacti installation after the diagram
#cd/var/www/html/cacti/
#chown-R Cacti:cacti rra/log/
#chmod-R 777 rra/log/
#vim/etc/php.ini
Find the Date.timezone line, remove the comment, and add "Asia/shanghai" to the back
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/13/wKioL1U_V9KghH8ZAAFYC_-imGc953.jpg "title=" QQ picture 20150428174104_ copy. png "width=" "height=" 290 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:290px ; "alt=" wkiol1u_v9kghh8zaafyc_-imgc953.jpg "/>
redhat6.5 installation cacti monitoring and installation process problem solving