標籤:cacti安裝 webseven 系統監控
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
[[email protected] ~]# cd rrdtool-1.4.7
[[email protected] rrdtool-1.4.7]# ./configure --prefix=/usr/local/rrdtool
[[email protected] rrdtool-1.4.7]# make && make install
[[email protected] 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 [email protected] 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
<VirtualHost *:8888>
DocumentRoot /usr/local/cacti
ServerName *
ErrorLog /usr/local/cacti/log/mycacti_err.log
CustomLog logs/mycacti.log common
</VirtualHost>
啟動httpd服務:service httpd restart
12.Add a line to your ”/etc/crontab” file similar to1):
crontab -e -u cacti
*/5 * * * * /usr/bin/php /user/local/cacti/poller.php > /dev/null 2>&1
13.訪問http://ip:7777/,至此Cacti安裝完成.
本文出自 “webseven” 部落格,請務必保留此出處http://webseven.blog.51cto.com/4388012/1537434