shaerzzr 发表于 2019-1-11 13:10:24

cacti监控 On RHEL6

  1. Install required packages
  # yum -y install httpd php php-mysql php-snmp mysql mysql-server net-snmp
  2. Configure MySQL
  # /etc/init.d/mysqld start
  # mysqladmin --user=root create cacti
# mysql -u root -p
  mysql>GRANT ALL on cacti.* TO cacti@localhost IDENTIFIED BY 'password';
  mydql>flush privileges;
  3. Install and Configure Cacti
  # tar xf cacti-0.8.7g.tar.gz
  # cp -r cacti-0.8.7g /var/www/html/cacti
  # cd /var/www/html/cacti
  # mysql cacti < cacti.sql
  # vim include/config.php
  $database_type = &quot;mysql&quot;;
$database_default = &quot;cacti&quot;;
$database_hostname = &quot;localhost&quot;;
$database_username = &quot;cacti&quot;;
$database_password = &quot;password&quot;;
  # useradd -s /sbin/nologin -M cacti
  # chown -R cacti.cacti rra/ log/
  # crontab -e
  */5 * * * * cacti php /var/www/html/cacti/poller.php > /dev/null 2>&1
  注意:可以手动运行php /var/www/html/cacti/poller.php进行测试会发现有多WARNING:
  PHP Warning:strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /var/www/html/cacti/include/global_arrays.php on line 640
  解决办法是:
  # vim /etc/php.ini
  date.timezone = PRC
  # /etc/init.d/httpd restart
  4. Install and Confiture Spine
  # yum -y install automake libtool mysql-devel net-snmp-devel

#tar xf cacti-spine-0.8.7g.tar.gz
#cd cacti-spine-0.8.7g
#aclocal
#libtoolize --force
#autoheader
#autoconf
#automake
#./configure
#make && make install && echo $?
  # cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf
  # vi /usr/local/spine/etc/spine.conf
  DB_Host         localhost
DB_Database   cacti
DB_User         cacti
DB_Pass         password
DB_Port         3306
DB_PreG         0
  5. Install and Configure rrdtool
  # yum -y install libxml2-devel pango-devel cairo-devel perl-ExtUtils-MakeMaker
  # tar xf rrdtool-1.4.4.tar.gz
  # cd rrdtool-1.4.4
  # ./configure
  # make && make install && echo $?
  6. Test and Further Configure
  Use firefox to open the url: http://localhost/cacti
http://blog.运维网.com/attachment/201110/122455253.jpg
  

http://blog.运维网.com/attachment/201110/122522484.jpg
  

http://blog.运维网.com/attachment/201110/122812688.jpg
http://blog.运维网.com/attachment/201110/122601147.jpg
  

  

http://blog.运维网.com/attachment/201110/122913748.jpg
http://blog.运维网.com/attachment/201110/123158824.jpg



页: [1]
查看完整版本: cacti监控 On RHEL6