歡迎您光臨本站 註冊首頁

使用AS5配置cact求助i

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

使用AS5配置cact求助i

請教高手幫我指點一下這是我寫的配置文檔
本安裝手冊假定計算機上已經成功安裝MySQL,Apache,PHP;PHP安裝目錄為/usr/local/php;Apache
及PHP的DocumentRoot為/var/web;且MySQL資料庫的root用戶密碼為taiyu。

1.建立cactiuser用戶
    useradd cactiuser

2.設置mysql
    create database cacti;
    grant all privileges on cacti.* to cacti identified by 'taiyu';
    grant all privileges on cacti.* to cacti@localhost identified by 'taiyu';

3.安裝net-snmp相關包
    安裝前請先檢查系統中是否有snmpwalk和snmpget兩個命令。如果有,則可以跳過以下步驟。
    rpm -ivh net-snmp-5.0.9-2.30E.6.i386.rpm
    rpm -ivh net-snmp-devel-5.0.9-2.30E.6.i386.rpm
    rpm -ivh net-snmp-perl-5.0.9-2.30E.6.i386.rpm
    rpm -ivh net-snmp-utils-5.0.9-2.30E.6.i386.rpm

4.下載並安裝rrdtool
    a.下載網址:
        http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.x/rrdtool-1.0.50.tar.gz
    b.安裝:
        (1) ./configure
        (2) make && make install
我這裡使用的是rpm包安裝的,文件包里有。
        rpm –ivh rrdtool-1.0.38-1.i386
        rpm –ivh rrdtool-1.0.38-1.src
        rpm –ivh rrdtool-devel-1.0.38-1.i386
註:由於rrdtool1.2版本已經不再自帶外部的lib庫,所以需要從http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs/
下載這些庫來安裝。建議還是使用1.0的版本,比較方便。

5.安裝Cacti
    a.下載:
        http://www.cacti.net/downloads/
    b.安裝:
        (1)tar -xzvf cacti-*.tar.gz -C /www/web/
        (2)mv cacti-* cacti
        (3)cd cacti
        (4)mysql -uroot -ptaiyu cacti < cacti.sql
        (5)chown -R cactiuser rra/ log/
        (6)vi include/config.php
        找到以下內容:
            $database_type = "mysql";
            $database_default = "cacti";
            $database_hostname = "localhost";
            $database_username = "cactiuser";
            $database_password = "cactipw";
        修改為以下內容:
            $database_type = "mysql";
            $database_default = "cacti";
            $database_hostname = "localhost";
            $database_username = "cacti";
            $database_password = "taiyu";
下面要創建:
# crontab -u cactiuser -e
        加入以下內容:
            */5 * * * * php /var/web/cacti/poller.php > /dev/null 2>&1

6.配置snmpd 的配置文件/etc/snmp/snmp.conf

vi /etc/snmp/snmp.con 進入配置文件找到修改以下幾處:
#       sec.name  source          community
com2sec notConfigUser  192.168.1.232 public   //這裡是我本地的機器ip地址,請改成你自己的機器地址就ok了。

#       groupName      securityModel securityName
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser  //這幾行是系統默認開啟的。

#       name           incl/excl     subtree         mask(optional)
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1   //找到此去掉后兩行的#

#       group          context sec.model sec.level prefix read   write  notif
access  notConfigGroup ""      any       noauth    exact all none none       ///找到次處,這裡要修改成這樣。

##           incl/excl subtree                          mask
view all    included  .1                               80      //找到次處,修改去掉80這一行的#號。

這裡如有錯誤,請到本文檔外面有個snmp.conf文件里去做對比。

保存關閉.
11.重新能啟動snmpd 啟動命令 /etc/init.d/snmpd start
如果有防火牆,打開UDP 161埠。
最後運行查看snmp的埠號
# netstat -ln|grep 161
udp        0      0 0.0.0.0:161             0.0.0.0:*
如果看到161埠,說明snmpd伺服器啟動成功。

12.設置snmpd服務默認啟動:chkconfig --level 3 snmpd on
如果沒有安裝snmp服務,請在RH的安裝光碟上找到net-snmp.rpm,再安裝。

13.打開本機的SNMP服務,
這樣就基本配置好了,現在做一個測試:
# ps -ef |grep snmpd         //應該出現下面兩行。
root     16874     1  0 14:53 ?        00:00:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd -a
root     16880 16763  0 14:53 pts/1    00:00:00 grep snmpd
測試二,如下:
# free -m
             total       used       free     shared    buffers     cached
Mem:           939        913         26          0        125        561
-/+ buffers/cache:        226        713
Swap:         1983          0       1983

這裡的測試,不知道怎麼會事,正常的在下面,我應該怎麼解決呢?
# php /var/www/html/cacti/poller.php
No log handling enabled - turning on stderr logging
Cannot find module (NONE): At line 0 in (none)
04/30/2008 01:51:18 PM - SYSTEM STATS: Time:1.0568 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSources:5 RRDsProcessed:5
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
No log handling enabled - turning on stderr logging
Cannot find module (NONE): At line 0 in (none)
No log handling enabled - turning on stderr logging
Cannot find module (NONE): At line 0 in (none)


下面的是正常的
No log handling enabled - turning on stderr logging
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
OK u:0.00 s:0.02 r:1.10
Cannot find module (NONE): At line 0 in (none)
OK u:0.00 s:0.03 r:1.15
OK u:0.00 s:0.03 r:1.15
OK u:0.00 s:0.03 r:1.15
OK u:0.00 s:0.03 r:1.16
OK u:0.00 s:0.03 r:1.16
OK u:0.00 s:0.04 r:1.16
OK u:0.00 s:0.04 r:1.16
OK u:0.00 s:0.04 r:1.17
OK u:0.00 s:0.04 r:1.17
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
Cannot find module (NONE): At line 0 in (none)
OK u:0.00 s:0.04 r:2.13
OK u:0.00 s:0.04 r:2.13
OK u:0.00 s:0.05 r:2.15
OK u:0.00 s:0.05 r:2.15
OK u:0.00 s:0.05 r:2.17
OK u:0.00 s:0.05 r:2.17
OK u:0.00 s:0.05 r:2.18
OK u:0.00 s:0.05 r:2.18
OK u:0.00 s:0.05 r:2.20
OK u:0.00 s:0.05 r:2.20
OK u:0.00 s:0.05 r:2.21
OK u:0.00 s:0.06 r:2.21
OK u:0.00 s:0.06 r:2.23
OK u:0.00 s:0.06 r:2.23
OK u:0.00 s:0.06 r:2.24
OK u:0.00 s:0.06 r:2.24
OK u:0.01 s:0.06 r:2.26
OK u:0.01 s:0.06 r:2.26
OK u:0.01 s:0.06 r:2.27
OK u:0.01 s:0.06 r:2.27
Content-type: text/html
X-Powered-By: PHP/4.3.9

01/22/2008 10:21:47 PM - SYSTEM STATS: Time:2.3808 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:15 RRDsProcessed:15



.頁面設置:
(1)在瀏覽器輸入:http://ip/cacti
進入cacti的初始設置頁面,在這裡我們要輸入一些原始的信息。流程如下:
NEXT -> 輸入一些信息,如rrdtool、php、snmpwalk、snmpget的位置
使用ucd-snmp還是net-snmp等 -> 輸入原始的用戶名和密碼(admin/admin) -> 更改admin用戶的密碼 -> Save
至此,Cacti的安裝已經完成,現在可以在瀏覽器中進入Cacti的界面了

[火星人 ] 使用AS5配置cact求助i已經有381次圍觀

http://coctec.com/docs/service/show-post-30818.html