一、安装环境LAMP #yum -y install gcc* glibc* gd* #yum -y install httpdmysql-server perl-DBI perl-DBD-MySQL php php-devel php-mysql php-snmp php-pdophp-gd lm_sensors net-snmp net-snmp-libs net-snmp-utils net-snmp-devel # chkconfig mysqld on # chkconfig httpd on # chkconfig snmpd on # service mysqld start # service httpd start # service snmpd start #vim /var/www/html/index.php
访问http://localhost/index.php
# mysqladmin -u rootpassword '123' 报错处理: # export PATH=$PATH:/usr/local/mysql/bin
# mysql -u root –p :输入密码 mysql>createdatabase cacti default character set utf8; mysql>drop database cacti; Query OK, 1 row affected (0.00 sec)
mysql>grantall on cacti.* to cacti@localhost identified by '123'; mysql>revoke all on cacti.* fromcacti@localhost; Query OK, 0 rows affected (0.01 sec)
mysql>flushprivileges; Query OK, 0 rows affected (0.00 sec)
mysql> q
二、安装cacti
1、安装rrdtool需要的软件包
# yum -y installcairo-devel libxml2-devel pango pango-devel 2、安装rrdtool # tar xf rrdtool-1.4.4.tar.gz # cd rrdtool-1.4.4 # ./configure --prefix=/usr/local/rrdtool && make&& make install # ln -s /usr/local/rrdtool/bin/* /usr/local/bin/#此步非常重要
3、安装cacti-0.8.7.e中文版 #wget http://blogimg.chinaunix.net/blog/upfile2/090815172648.gz # tar xvf090815172648.gz -C /var/www/html # cd /var/www/html # mv cacti-0.8.7e-cn-utf8/cacti # mysql -ucacit –p cacti <cacti cacti.sql="" 导入数据库[="" backcolor][="" align]#="" mysql="" -ucacti="" -p123="" cacti="" <pa.sql[="" align]
7、修改配置文件,如下: # vim /var/www/html/cacti/include/config.php $config['url_path'] = "/cacti/";; 在3306下一行添加,记住一定不要写成/cacti
9、页面设置 控制面板—用户管理—admin 插件管理打钩—保存 看到控制面板—配置,多个了插件管理
9、安装monitor扩展插件如下: # wget http://cactiusers.org/downloads/monitor.tar.gz # wget http://cactiusers.org/downloads/thold.tar.gz # wget http://cactiusers.org/downloads/settings.tar.gz # tar xvf monitor.tar.gz -C/var/www/Cacti/plugins # tar xvf thold.tar.gz -C/var/www/Cacti/plugins # tar xvf settings.tar.gz -C /var/www/Cacti/plugins # cd /var/www/html/cacti/plugins # mysql -ucacti -p123 cacti < monitor/monitor.sql # mysql -ucacti -p123 cacti < thold/thold.sql # vim /var/www/html/cacti/include/config.php $plugins[] = "monitor"; //添加此行 $plugins[] = "thold"; $plugins[] = "settings";
刷新网页即可 如果出现空白页,请查看apache日志 /var/log/httpd/error_log
|