Document directory
Install cacti in Ubuntu
I have been trying to install cacti for a long time. I tried it under windows and other Linux distributions, but I have not installed it successfully. I am stupid. I can't help it. Haha.
Ubuntu can easily integrate the lamp environment, so I want to install cacti under Ubuntu, it should not be too difficult. Finally, I got it.
When installing Ubuntu, remember to select lamp server. If you want to log on via SSH, remember to select OpenSSH. After the installation is complete, you can install cacti. download the latest version from its homepage. If you want to use another version, you can. I installed 0.8.7e at http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz.
After the download, you can directly drop it under the/var/WWW directory, or you can directly run wget under the/var/WWW directory.
Decompress the package.
$ Sudo-S
$ Cacti-0.8.7e.tar.gz/var/WWW
$ CD/var/WWW
$ Tar xzf cacti-0.8.7e.tar.gz
$ MV cacti-0.8.7e cacti
$ RM cacti-0.8.7e.tar.gz (do what you want to do this step, don't do it if you don't want to do it)
$ Exit
Next, import the database:
$ CD/var/www/cacti
$ Sudo mysqladmin-u root-P create cacti
$ Sudo mysql-u root-P cacti <cacti. SQL
$ Sudo mysql-u root-P cacti
The following operations are performed under MySQL, and permissions are set for the database. (I have never succeeded in obtaining permissions under Windows)
Grant all on cacti. * To cactiuser @ localhost identified by 'cacti ';
Flush privileges;
Set password for cactiuser @ localhost = PASSWORD ('cactiuser'); // you can change the user name and password to the one you want.
Quit
Now, edit/var/www/cacti/include/config. php and change the Database Password to cactiuser.
This is based on the database password you set above
$ Sudo VI/var/www/cacti/include/config. php
$ Database_password = "cactiuser"; (of course, this can be modified, but it must be the same as the header)
Add cactiuser
$ Sudo useradd cactiuser-D/var/www/cacti-S/bin/false
$ Sudo chown-r cactiuser/var/www/cacti/RRA/var/www/cacti/log
The above may not work:
# Sudo chown-HR cactiuser/var/www/cacti/RRA/var/www/cacti/log
Edit/etc/crontab to add a scheduled task and execute the collection task every five minutes.
$ Sudo VI/etc/crontab
*/5 * cactiuser PhP5/var/www/cacti/poller. php>/dev/null 2> & 1
In this way, you can access your cacti, at least you can start to install it. Http: // cactiserver (your cacti server address or domain name)/cacti. The default username and password are admin. After logging in, you will be forced to change the password.
According to the above steps, during the installation process, cacti will prompt you that some tools are not installed properly, as shown in:
Run the following command. Or, after installing lamp in the header, run the following command to install related tools.
1. sudo apt-Get install rrdtool
2. sudo apt-Get install SNMP
3. sudo apt-Get install php5-cli
Or you want to save some trouble.
Sudo apt-Get install php5-mysql php5-cgi php5-cli php5-snmp PHP-pear SNMP snmpd
After the installation is complete, refresh the installation interface and you will be able to see that all of them are OK.
Okay. It's really getting started. Haha
From: http://hi.baidu.com/coolda/blog/item/4e5238c726a229d0d000602d.html