亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

RedHat / CentOS Install and Configure Cacti

系統 2633 0

RedHat / CentOS Install and Configure Cacti Network Graphing Tool

by ? ? on ? APRIL 20, 2009 ? · ? 67 COMMENTS · last updated at ? JUNE 26, 2009

C acti is a network graphing tool similar to MRTG. How do I install and configure common options to collect SNMP data and various other data (such as system load, network link status, hard disk space, logged in users etc) into an RRD?

From the official project site:

Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.

Required software(s)

You need to install the following software on RHEL / Fedora / CentOS Linux:

  1. MySQL Server : Store cacti data.
  2. NET-SNMP server - SNMP (Simple Network Management Protocol) is a protocol used for network management.
  3. PHP with net-snmp module - Access SNMP data using PHP.
  4. Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL.

Install the software

First, login as root user and ? type the following command ? to install mysql, apache and php:
# yum install mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd

Configure MySQL server

First, set ? root password :
# mysqladmin -u root password NEWPASSWORD

Create cacti MySQL database

Create a database called cacti, enter:
# mysql -u root -p -e 'create database cacti'
Create a user called cacti with a password called zYn95ph43zYtq, enter:
# mysql -u root -p

      mysql> 
      
        GRANT
      
      
        ALL
      
      
        ON
      
       cacti.* 
      
        TO
      
       cacti@localhost 
      
        IDENTIFIED
      
      
        BY
      
      
        'zYn95ph43zYtq'
      
      ;
mysql> 
      
        FLUSH
      
       privileges;
mysql> \q
    

Install snmpd

Type the following command to install net-snmpd
# yum install net-snmp-utils php-snmp net-snmp-libs
Configure snmpd, open /etc/snmp/snmpd.conf
# vi /etc/snmp/snmpd.conf
Append / modify it as follows (see snmpd.conf man page for details):

      com2sec local     localhost           public
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
view all    included  .1                               80
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root  (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
    

Save and close the file. Turn on snmpd service:
# /etc/init.d/snmpd start
# chkconfig snmpd on

Make sure you are getting information from snmpd:
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
Sample ouptut:

      IP-MIB::ipAdEntIfIndex.10.10.29.68 = INTEGER: 2
IP-MIB::ipAdEntIfIndex.67.yy.zz.eee = INTEGER: 3
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
    

Install cacti

First, make sure ? EPEL repo ? is enabled. Type the following command to install cacti:
# yum install cacti

Install cacti tables

Type the following command to find out cacti.sql path:
# rpm -ql cacti | grep cacti.sql
Sample output:

      /usr/share/doc/cacti-0.8.7d/cacti.sql
    

Type the following command to install cacti tables (you need to type the cacti user password):
# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7d/cacti.sql

Configure cacti

Open /etc/cacti/db.php file, enter:
# vi /etc/cacti/db.php
Make changes as follows:

      ?

      
        /* make sure these values refect your actual database/host/user/password */
      
      
        $database_type
      
       = 
      
        "mysql"
      
      ;

      
        $database_default
      
       = 
      
        "cacti"
      
      ;

      
        $database_hostname
      
       = 
      
        "localhost"
      
      ;

      
        $database_username
      
       = 
      
        "cacti"
      
      ;

      
        $database_password
      
       = 
      
        "zYn95ph43zYtq"
      
      ;

      
        $database_port
      
       = 
      
        "3306"
      
      ;
?
    

Save and close the file.

Configure httpd

Open /etc/httpd/conf.d/cacti.conf file, enter:
# vi /etc/httpd/conf.d/cacti.conf
You need to update allow from line. Either set to ALL or your LAN subnet to allow access to cacti:

      ?
#
# Cacti: An rrd based graphing tool
#
Alias /cacti    /usr/share/cacti
?
<Directory /usr/share/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from 
      
        10.0
      
      
        .0
      
      
        .0
      
      /
      
        8
      
      
</Directory>
?
    

Another option is create /usr/share/cacti/.htaccess file and ? password protect ? the directory. Finally, restart httpd:
# service httpd restart

Setup cacti cronjob

Open /etc/cron.d/cacti file, enter:
# vi /etc/cron.d/cacti
Uncomment the line:

      */5 * * * *     cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
    

Save and close the file.

Run cacti installer

Now cacti is ready to install. Fire a webbrowser and type the url:
http://your.example.com/cacti/
OR
http://your.server.ip.address/cacti/
Just follow on screen instructions. The default username and password for cacti is admin / admin. Upon first login, you will be force to change the default password.

How do I configure SNMP data collection?

SNMP can be used to monitor server traffic. Once installed login to cacti.
=> Click on Devices

=> Select Localhost

=> Make sure SNMP options are selected as follows:

Fig.01: SNMP configuration

Fig.01: SNMP configuration

Finally, click on Save button.

How do I create SNMP graphs?

Click on "Create Graphs for this Host" link on top right side.

Select SNMP - Interface Statistics

Select a graph type (such as In/Out bytes with total bandwidth)

Finally, click on Create button.

How do I view graphs?

To view graphs click on Graphs tab. Here is sample graph from one my own box:

Fig.02: Cacti in Action - Memory, CPU and Network Usage

Fig.02: Cacti in Action - Memory, CPU and Network Usage


(Fig.02: Cacti in action)
Fig.03: Cacti in Action Disk, Load average and User stats

Fig.03: Cacti in Action Disk, Load average and User stats

Further readings:

RedHat / CentOS Install and Configure Cacti Network Graphing Tool


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日日干日日草 | 精品一区二区三区三区 | 欧美精品国产 | 成年女人看片免费视频频 | 精品精品国产自在香蕉网 | 天天操操操操操 | 韩国精品一区二区久久 | 天天干天天爱天天操 | 中文字幕精品视频在线 | 国产精品入口麻豆 | 天天操天天干天天爱 | 黄色天堂在线 | 国产一区中文字幕 | 韩国一级特黄毛片大 | 国产精品久久久久影视青草 | 超级乱淫视频aⅴ播放视频 超级乱淫视频播放日韩 | 国产全黄a一级毛片视频 | 97国产成人精品视频 | 影音先锋在线亚洲精品推荐 | 91视频爱爱 | 成人短视频在线观看免费 | 一本色道久久综合狠狠躁 | 欧美色综合 | 狠狠色狠狠色综合系列 | 亚洲国产成人私人影院 | 一区二区亚洲精品 | 全部在线播放免费毛片 | 久久久免费观看 | 伊香蕉大综综综合久久 | 亚洲欧美一区二区久久香蕉 | 欧美日韩国产成人高清视频 | 久章草在线 | 国产欧美精品一区二区 | 亚洲国产精品人久久 | 国产理论自拍 | 亚洲一区二区免费视频 | 天天摸天天操天天射 | 黄色片在线免费观看视频 | 久久久久99精品成人片三人毛片 | 亚洲精品国产福利一区二区三区 | 四虎在线影院 |