Cacti 工具

本文详细介绍在CentOS 6.5环境下安装配置RDtools、net-snmp、LAMP、cacti监控系统的全过程,包括软件包安装、数据库创建、权限设置及定时任务配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 

安装RD tools

CentOS6.5

rpm -ivh http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

yum install rrdtool -y

 

安装配置net-snmp

1、安装net-snmp
yum install net-snmp net-snmp-libs net-snmp-utils
2、配置net-snmp
修改:
view systemview included .1.3.6.1.2.1.1
为:
view systemview included .1.3.6.1.2.1
3、测试net-snmp
# service snmpd start
# snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux cronos 2.4.28 #2 SMP ven jan 14 14:12:01 CET 2005 i686

安装LAMP

yum install httpd php php-mysql php-snmp php-xml php-gd mysql mysql-server
service httpd start
service mysqld start
mysqladmin -uroot password yourpassword
mysqladmin --user=root --password reload

安装cacti

1、下载cacti
cd /tmp
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar xzf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a /var/www/html/cacti
cd /var/www/html/cacti
2、创建数据库
mysqladmin --user=root -p create cacti
3、导入数据库
mysql -uroot -p cacti < cacti.sql
4、创建 数据库用户
shell> mysql -uroot -p mysql  (passwd: 123456)
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword';
mysql> flush privileges;
5、配置include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipassword";
/* load up old style plugins here */
$plugins = array();
//$plugins[] = 'thold';
/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
$url_path = "/cacti/";
/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";
6、设置目录权限
chown -R cactiuser rra/ log/
cactiuser为系统存在的用户,为了收集数据。
7、配置计划任务
echo "*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1">>/etc/crontab
service crond restart
8、完成cacti的安装
1) 在 浏览器中输入:http://www.yourdomain. com/cacti/
默认用户名:admin 密码:admin
2) 更改密码
3)设置cacti用到的命令 路径
 
 1034  sh restart
 1035  ping localhost
 1036  gvim /var/www/html/cacti/include//config.php
 1037  mysqladmin --user=root -p create cacti
 1038  mysql -uroot -p cacti < cacti.sql
 1039  cd /var/www/html/cacti/
 1040  mysql -uroot -p cacti < cacti.sql
 1041  mysql -uroot -p mysql  
 1042  sh ~/restart
 1043  chown -R cactiuser rra/ log/
 1044  useradd cactiuser
 1045  passwd cactiuser
 1046  chown -R cactiuser rra/ log/
 1047  ls
 1048  gvim include/auth.php
 1049  echo "*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1">>/etc/crontab
 1050  service crond restart
 1051  gvim include/global_constants.php
 1052  gvim /etc/php.ini
 1053  sh ~/restart
 1054  history

 
warning: strtotime(): It is not safe to rely on the system's timezone settings
出现这个错误的原因,主要是因为php.ini里面的时区没有进行设置,可以设置一下,例如:
vi /etc/php.ini
然后找到timezone
将时区设为,例如:Asia/Shanghai

转载于:https://www.cnblogs.com/kylegui/p/3805786.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值