CentOS 6.7安裝配置Cacti監控系統

來源:互聯網
上載者:User

標籤:

一、安裝配置LAMP環境

yum -y install httpd php php-mysql php-snmp php-xml php-gd mysql mysql-server

啟動http和mysql

service httpd startservice mysqld start

執行mysql安全設定,根據提示設定root密碼

mysql_secure_installation

二、安裝RRDTool和net-snmp

1、RRDTool主要用於繪圖

yum -y install rrdtool

2、net-snmp主要用於收集並傳送伺服器的統計資訊

yum -y install net-snmp net-snmp-libs net-snmp-utils

3、配置net-snmp

vim /etc/snmp/snmpd.conf
將55行的view    systemview    included   .1.3.6.1.2.1.1改為view    systemview    included   .1.3.6.1.2.1

4、啟動net-snmp

service snmpd start

5、測試net-snmp

snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0

如果顯示類似:SNMPv2-MIB::sysDescr.0 = STRING: Linux guest.guest 2.6.32-573.8.1.el6.x86_64 #1 SMP Tue Nov 10 18:01:38 UTC 2015 x86_64,說明net-snmp工作正常。

三、下載安裝cacti

1、下載cacti,並放到html目錄下

wget http://www.cacti.net/downloads/cacti-0.8.8f.tar.gztar zxf cacti-0.8.8f.tar.gzmv cacti-0.8.8f /var/www/html/cacti

2、在mysql中添加cacti資料庫,並匯入模板資料庫

cd /var/www/html/cacti/mysqladmin --user=root -p create cactimysql -uroot -p cacti < cacti.sql

3、在mysql中建立cacti使用者,使用者名稱為cactiuser,密碼暫訂為123

mysql -u root -p GRANT ALL ON cacti.* TO [email protected] IDENTIFIED BY ‘123‘;flush privileges;
quit

4、在Linux系統中添加cacti使用者

useradd cactiuserchown -R cactiuser rra/ log/

5、配置include/config.php

$database_type = "mysql";$database_default = "cacti";$database_hostname = "localhost";$database_username = "cactiuser";$database_password = "123";$database_port = "3306";$database_ssl = false;

6、添加計劃任務

echo "*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1">>/etc/crontabservice crond restart

四、初始化安裝cacti

瀏覽器中輸入:http://www.yourdomain.com/cacti

一路下一步,預設初始使用者名稱和密碼都是:admin

五、配置開機啟動

chkconfig --level 35 snmpd onchkconfig --level 35 httpd onchkconfig --level 35 mysqld onchkconfig --level 35 crond on

六、加入一個新的Linux被監控主機(CentOS)

目標機器上安裝net-snmp即可

yum install -y net-snmp net-snmp-perl net-snmp-devel net-snmp-utils net-snmp-libs

啟動net-snmp(預設199號連接埠)

service snmpd start

在網路頁面左側,選擇Devices——add,填寫hostname(ip或網域名稱),並將SNMP Version改為2

 

CentOS 6.7安裝配置Cacti監控系統

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.