Cacti是一个大型网络中使用的很好的监控软件,它既能够在Linux上安装也能够在Windows上进行安装.今天主要讲解一下关于Linux的Cacti的安装过程以及它的相关使用操作:
1.安装apache
#tar xvzf xxxx
#./configure –prefix=/app/apache –enable-module=so && make && make install
#/app/apache/bin/apachectl start
2.安装mysql
#tar….
#./configure –prefix=/app/mysql && make && make install
#./scripts/mysql_install_db
ldconfig
./bin/mysqld_safe –user=root &
./bin/mysqladmin -u root -p password ‘xxxxxx’ #改root密码
./bin/mysql -p
mysql>use mysql;
mysql>show tables;
mysql>exit
#出来表就OK了
3.安装php.(这里面需要安装4.x版,不要5.x)
#tar…
#./configure –prefix=/app/php –with-mysql=/app/mysql –with-apxs2=/app/apache/bin/apxs
#make
#make install
#cp ./php.ini-dist /usr/local/lib/php.ini
#vi /app/apache/conf/httpd.conf #增加一行AddType application/x-httpd-php .php
#/app/apache/bin/apachectl restart
#可以编写一个PHP文件,测试PHP工作正常否.内容
4.安装phpMyadmin(可步可省)
#tar xvzf phpMy…
#mv phpM…. /app/apache/htdocs/phpMyadmin
#vi /app/apache/htdocs/phpMyadmin/config.inc.php
5.安装netsnmp(系统自带的即可,net-snmp-utils-xxx.i386.rpm),
安装rrdtool
tar…
./configure –prefix=/app/rrdtool && make && make install
6.安装cacti
tar…
/app/mysql/bin/mysqladmin –user=root -p create cacti #创建表
/app/mysql/bin/mysql –user=root -p cacti GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘hhjzlp’;
mysql>flush privileges;
mysql>exit
vi ./include/config.php #改密码,其它看着改
adduser cactiuser
passwd cactiuser #设置密码hhjzlp
mv cacti.. /app/apache/htdocs/cacti
cd /app/apache/htdocs/cacti
chown -R cactiuser rra/ log/
然后通过http来安装.
把rrdtool路径改一下.按照上面设的,改成/app/rrdtool/bin/rrdtool
php路径:/app/php/bin/php
默认用户名密码都是admin,需要改密码(强制).
让系统每5分钟收集,需要
crontab -e
5/* * * * * /app/php/bin/php /app/apache/htdocs/cacti/poller.php > /dev/null 2>&1
也可手工跑一次: /app/php/bin/php /app/apache/htdocs/cacti/poller.php
(不要用root用户运行)
cacti配置比较简单.