Install and Configure Cacti
1.Required Packages for RPM-based Operating Systems
yum -y install cairo-devel libxml2-devel pango-devel php-mysql mysql-devel php-snmp php-xml net-snmp-utils net-snmp
2.install rrdtool
[root@cacti ~]# cd rrdtool-1.4.7
[root@cacti rrdtool-1.4.7]# ./configure --prefix=/usr/local/rrdtool
[root@cacti rrdtool-1.4.7]# make && make install
[root@cacti rrdtool-1.4.7]# ln -s /usr/local/rrdtool/bin/* /usr/local/bin/
3.Create cacti os user
shell>mkdir /home/cacti
shell> useradd -r -s /sbin/nolog -h /home/cacti cacit
shell>chown cacti:cacti /home/cacti
4.Extract the distribution tarball. Untar to the DOCUMENT_ROOT of your web server
shell> tar -xzvf cacti.tar.gz
5.Create the MySQL database:
shell> mysqladmin --user=root create cacti
6.Import the default cacti database:
shell> mysql cacti < cacti.sql
7.Optional: Create a MySQL username and password for Cacti.
shell> mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql> flush privileges
8.Edit “include/config.php” and specify the database type, name, host, user and password for your Cacti configuration.
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
$url_path = "/";
9.Configure the privileges of rra and log:
shell> chown -R cacti:cacti rra/ log/
10.Configure snmp.conf
修改com2sec notConfigUser default public为:
com2sec notConfigUser 10.0.1.0/24(根据实际情况修改) public
修改access notConfigGroup "" any noauth exact systemview none none,为
access notConfigGroup "" any noauth exact all none none
修改#view all included .1 80为
view all included .1 80
重启snmp服务:service snmpd restart
执行命令验证:snmpwalk -v 2c -c public your_remote_ip if
11.Configure httpd.conf
cat /etc/httpd/conf.d/cacti.conf
Listen 8888
NameVirtualHost *:8888
DocumentRoot /usr/local/cacti
ServerName *
ErrorLog /usr/local/cacti/log/mycacti_err.log
CustomLog logs/mycacti.log common
启动httpd服务:service httpd restart
12.Add a line to your ”/etc/crontab” file similar to1):
crontab -e -u cacti
*/5 * * * * /usr/bin/php /usr/local/cacti/poller.php > /dev/null 2>&1
13.访问http://ip:8888/,至此Cacti安装完成.
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com