2015年12月6日

CactiEZ安裝設定

下載CactiEZ CD 
先到Cacti 官網下載http://cactiez.cactiusers.org/ 說明版本為CactiEZ v0.7
1.安裝CactiEZ
硬體需求:vCPU *1vRAM 1GHD 5GOS CentOS 64 位元 ( 測試用,請依實際需求加規格 )CatciEZ 的安裝十分簡單,光碟開機後直接按下Enter 鍵進行安裝。( 預設為 64 位元 )
安裝時系統設定
Configure TCP/IP (設定網路)
Language Selection = English
Keyboard Selection = us
Time Zone Selection = Asia/Taipei ( OPNE UTC )
Root Password = 自訂
Partitioning Type = Replace existing Linux system
安裝完成重新開機
本版本 CentOS 6.3
CactiEZ 預設登入帳號(帳密皆使用預設值)
系統:     帳號:root 密碼:CactiEZ
網站:     帳號:admin     密碼:admin
webmin:帳號:root     密碼:CactiEZ新版CactiEZMySQL安全性做了加強,安裝時會自動產生動態的MySQL密碼,而不使用預設密碼安裝完成後的MySQL使用者密碼可到# cat /root/mysqlpass.txt 檢查 (建議確認完成後,將此檔案刪掉)  
2.安裝完成後所要進行的設定 
更改root 密碼
passwd (指令)
設定主機IP位置
vi /etc/sysconfig/network-scripts/ifcfg-eth0
設定主機名稱
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=XXXX.test.com
設定 DNS
 vi /etc/resolv.conf
nameserver x.x.x.x
設定時間自動校正
ntpdate -u tock.stdtime.gov.tw
vi /etc/crontab
*/1 * * * * root (/usr/sbin/ntpdate -u tock.stdtime.gov.tw && /sbin/hwclock -w) > /dev/null

修改 httpd.conf 設定
vi /etc/httpd/conf/httpd.conf
找到 ServerName 改為 ServerName 127.0.0.1:80
PHP效能調整
vi /etc/php.ini
找到 Resource Limits
max_execution_time = 60
max_input_time = 120
memory_limit = 256M
重新啟動
reboot
3.更新 Cacti ( 0.8.8b )與升級MySQLPHPApacheopenssl版本
# yum install cactiez  (優先做)
# yum install httpd php mysql openssl bash
升級完成後,reboot重開
升級至0.8.8b可解決哪些Bug可參考下方網頁
http://www.cacti.net/spine_changelog.php
升級openssl是為了解決opensslHeartBleed問題
http://www.ithome.com.tw/news/86526
4.登入 Web 管理介面修改基本環境與 RRDtool 環境設定 
第一次登入時基本設定
Serup → Begin
Serup → Plugin Setup → Avaliable Plugins → 全選 → Install
Serup → Template Setup → Optional Templates → 全選 → Install
Serup → Settings Setup → DNS Options → 設定 DNS
Serup → Settings Setup → Emailing Options → 設定 Mail
From Email Address = XXX
From Name = XXX@test.com
Serup → Complete → Goto Console
Web 管理介面的 {Console}→[Configuration]→[Settings]→(General) 中修改如下:
Event Logging → Log File Destination → Logfile Only 改為 Logfile and Syslog/Eventlog
SNMP Defaults → SNMP Version → Version 1 改為 Version 2
SNMP Defaults → SNMP Community → public 改為 xxxsnmpkey (設定自訂的預設值)
Web 管理介面的 {Console}→[Configuration]→[Settings]→(Poller) 的修改如下:
General → Maximum Concurrent Poller Processes → 1 改為 4
Spine Specific Execution Parameters → Maximum Threads per Process → 1 改為 15
Spine Specific Execution Parameters → Number of PHP Script Servers → 1 改為 5
Spine Specific Execution Parameters → The Maximum SNMP OID's Per SNMP Get Request → 10 改為 50
Host Availability Settings → Downed Host Detection → SNMP Uptime 改為 Ping and SNMP Uptime
Host Availability Settings → Ping Type → UDP Ping 改為 ICMP Ping
Host Availability Settings → Ping Timeout Value 400 改為 1500
Host Availability Settings → Ping Retry Count → 1 改為 2
Web 管理介面的 {Console}→[Configuration]→[Settings]→(Visual) 的修改如下:
Graph Management → Rows Per Page → 30 改為 100
Data Queries → Maximum Field Length → 15 改為 30
Data Sources → Rows Per Pageh → 30 改為 100
Data Sources → Maximum Title Length → 45 改為 80
Devices → Rows Per Pageh → 30 改為 100
Web 管理介面的 {Console}→[Utilities]→[User Management]→ IDAdmin →  Graph Settings 的修改如下:
General → Default RRA → Daily 改為 Hourly
Default Graph View Timeshift → 1 Day 改為  →30Min
Allow Graph to extend to Future → Allow Graph to extend to Future → 取消打勾
Graph Thumbnails → Thumbnail Width → 300 改為 400
Graph Thumbnails → Thumbnail Columns → 2 改為 3
Graph Thumbnails → Thumbnail Sections →  Tree View (Dual Pane) → 打勾
Tree View Mode → Graphs Per-Page → 10 改為 30
Tree View Mode → Dual Pane Tree Width → 200 改為 250
Web 管理介面的 {Console}→[Templates]→[Host Templates]→Add
Name = Generic SNMP-enabled Host → Create
Associated Data Queries → SNMP - Interface Statistics → Add → Save 
5.新增設備(網路設備) 
Web 管理介面的 {Console}→{Device}→add【新增主機】
Description(主機名稱)→siteA_名稱編號
HostName(主機IP)
Host Template(預設選擇Generic SNMP-enabled Host)
完成→Save 
Create Graphs for this Host→select a graph type選擇【In/Out Bits(64-bit Counters)把網卡勾選
完成→Create
重覆N次加入網路設備 
6-1.新增Graph Tree 
Web 管理介面的 {Console}→{Management}→{Graph Tree}→add【新增Tree
Name→輸入Tree的名稱
完成→Create 
        至新增完的Graph Trees底下→Add【把新增的Device加入Tree底下】
           Tree Items→Tree Item Type→Host→Tree Item Value Host→選擇要加入的Device
           完成→Create      
6-2.新增Graph Tree分類
依需求加入對應的Graph Tree分類 
Q&A問題
     如果圖形出不來時      /usr/bin/php /var/www/html/poller.php --force
     如果有圖沒流量時
                     [~]# chown root:root
           [~]# chmod 644 /var/www/html/rra/*  ( 777 也可以 )
     執行 /usr/bin/php /var/www/html/poller.php --force 時出現下列錯誤訊息
           ERROR: illegal attempt to update using time XXX when last update time is XXX (minimum one second step)
           刪除 *.rrd 檔後即可重跑程式 ( 注意 !!!! 會刪掉舊圖檔資料 )
                     [~]# rm -rf /var/www/html/rra/*
     突然發生所有的圖像都無法產生,並在郵件中發現這個錯誤訊息
           /bin/bash: line 1:  5611 File size limit exceededphp /var/www/cacti/poller.php >/dev/null 2>&1
           因為cacti.log檔案已經到達2GB,造成無法寫入Log檔,將該檔案移除後,就可正常產生圖型
           預設路徑:/var/www/cacti/log/cacti.log
           徹底處理:使用logrotate來設定log檔的保留規則
                1. 加入檔案 cacti /etc/logrotate.d/
                2. 檔案內容
                                           /var/www/cacti/log/cacti.log {
                                                   monthly
                                             size=100M
                                                   rotate 5
                                                   create 0600 root root
     詳細設定及說明請參考  鳥哥,第十九章、認識與分析登錄檔  登錄檔的輪替 (logrotate)
      Cacti LOG 出現下列訊息
           SPINE: Poller[X] Host[X] ERROR: Empty result [X.X.X.X]: '/usr/bin/snmpwalk X.X.X.X -v 2 -c XXX 1.3.6.1.2.1.4.22.1.2 | /bin/wc -l | /bin/awk '{printf$0}''
           cp /usr/bin/wc /bin/wc 就可以了

      Cacti LOG 出現下列訊息
           POLLER: Poller[0] WARNING: Poller Output Table not Empty. Issues Found: ..........
           找出該服務的設備後到 Data List 找出該 Data Sources 檢查詳細設定
           如確定為使用中請檢查 Client 防火牆相關設定
           如確定為不使用監控點則刪除該服務

     安裝nmap ( 可確認監控設備SNMPport是否有開。或掃描網段內主機,是Debug工具 )
            wget http://vault.centos.org/4.7/os/i386/CentOS/RPMS/nmap-3.70-1.i386.rpm
            rpm -ivh nmap-3.70-1.i386.rpm
           snmpwalk -c public -v 2c localhost       //檢查是否可吐出 SNMPv2c 資訊

若有錯誤log如下,為Mysql資料庫Table有問題(會造成流量顯示不出來,但是即時流量Realtime是可顯示),輸入mysqlcheck --auto-repair --databases cacti -p (修復指令)後,可恢復正常


0 回應:

Copyright © 2009 New Life in Taipei All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.