1、配置CiscoASA5510的snmp功能
snmp-server host inside 192.168.100.22 community public |
注:192.168.100.22为cacti server主机
2、系统环境为CentOS 5.5,安装系统支持cacti的必备环境
首先关闭selinux
vim /etc/selinux/config |
将SELINUX设为disabled
重启系统:
shutdown -r now |
yum –y install httpd php php-mysql mysql mysql-server net-snmp-utils libpng freetype libart-lgpl |
修改yum源:
vim /etc/yum.repos.d/CentOS-Base.repo (添加以下几行) |
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt enabled=1 |
保存退出后,执行下面命令
yum –y install rrdtool rrdtool-perl |
或是安装EPEL的yum源:
对于X86_64安装 EPEL Repo
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm |
对于X86安装 EPEL Repo
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm |
安装yum源后,执行:
yum –y install rrdtool rrdtool-perl |
3、下载cacti
wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz |
4、安装cacti,将cacti解压到/var/www/html目录
tar xvfz cacti-0.8.7g.tar.gz -C /var/www/html cd /var/www/html mv cacti-0.8.7g cacti |
5、配置mysql数据
create database cacti; exit; |
cd /var/www/html/cacti |
vi cacti.sql (添加以下一行) |
mysql -ucactiuser -pcacti cacti < cacti.sql |
useradd cactiuser (添加一个cactiuser账号) |
#mysql (给用户cactiuser权限并设定访问数据库密码为cacti)
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cacti'; flush privileges; |
6、配置cacti
cd /var/www/html/cacti |
vim include/config.php |
(将$database_password的密码改为与上面授权的密码一致即可)
保存退出。
7、设置cacti数据存储目录权限
cd /var/www/html/cacti chown –R cactiuser rra/ log/ |
8、Cacti数据采集,设定任务计划
先创建一个脚本
vim /etc/poller.sh (脚本内容为) |
crontab –e (添加任何计划) |
/etc/init.d/crond reload |
9、开始配置cacti,在浏览器打开
转载于:https://blog.51cto.com/skyou/541686