搭建syslog服務(wù)器流程_第1頁
搭建syslog服務(wù)器流程_第2頁
搭建syslog服務(wù)器流程_第3頁
搭建syslog服務(wù)器流程_第4頁
搭建syslog服務(wù)器流程_第5頁
已閱讀5頁,還剩18頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、安裝系統(tǒng)安裝要求PC配置:CPU:Intel P E2160(1.8GHz)以上內(nèi)存:1G以上硬盤:80G以上虛擬機(jī)要求:Kernel:linux 2.6內(nèi)存:512以上硬盤:40G以上安裝系統(tǒng)Linux syslog server要求用centos 5.5下載地址:ed2k:/|file|CentOS.5.5.32bit光盤鏡像.CentOS-5.5-i386-bin-DVD.iso|4185118720|a1ce64b6d36d945f562cb1250d8d665f|h=fnfai2pqdbdxmz5i5wshkaj22ttscbkg|/配置網(wǎng)絡(luò)點(diǎn)擊桌面上方的系統(tǒng)管理網(wǎng)絡(luò),配置eth0和

2、DNSNetwork Abapter修改為橋接模式安裝工具安裝GCC和makerootFDWIN # yum install gcc make安裝LAMP平臺(tái)rootFDWIN # yum install php-mysql mysql mysql-server php-snmp php-pdo perl-DBDMySQL httpd php yrootFDWIN # service mysqld startrootFDWIN # chkconfig mysqld onrootFDWIN #service httpd startrootFDWIN #chkconfig httpd onroot

3、FDWIN # mysqladmin -uroot password 000000rootFDWIN #vim /var/www/html/index.php添加:然后網(wǎng)頁訪問下出現(xiàn)OK說明沒問題了。進(jìn)入centos的DVD盤然后安裝rpm -vih php-gd-5.1.6-15.el5.i386.rpm進(jìn)入centos的DVD盤然后安裝rpm -ivh freetype-2.2.1-19.el5.i386.rpm安裝NET-SNMP1. 下載net-snmp源碼,并解壓rootFDWIN proc#wget /project/net-snmp/netsnmp/5.6/net-snmp-5.

4、6.tar.gzrootFDWIN proc#tar -xvzf net-snmp-5.6.tar.gz2. Configurea) 進(jìn)入源文件目錄rootFDWIN proc#cd net-snmp-5.6b) ConfigurerootFDWIN proc#./configure -prefix=/usr/local/net-snmp enable-mfd-rewrites-with-default-snmp-version=”2” -with-persistent-directory=”/var/net-snmp”3. 編譯、安裝rootFDWIN proc#make & make in

5、stall4. 配置snmpd.confa) 將EXAMPLE.conf文件復(fù)制到/usr/local/net-snmp/share/snmp/snmpd.confrootFDWIN proc#cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.confb) 修改snmpd.conf1.查找以下字段:# source communitycom2sec notConfigUser default public將comunity字段改為你要設(shè)置的密碼.比如bizcnpublic.將“default”改為你想哪臺(tái)機(jī)器可以看到你的snmp信息,如0

6、。授權(quán)服務(wù)器IP2.查找以下字段:# Finally, grant the group read-only access to the systemview view.# group context sec.model sec.level prefix read write notifaccess notConfigGroup any noauth exact systemview none none將read字段改為all.代碼:#access notConfigGroup any noauth exact all none none3.查找以下字段:# incl/excl subtree

7、mask#view all included .1 80將該行前面的#去掉.4.查找以下字段:#name incl/excl subtree mask(optional)添加一行view all included .1變成#name incl/excl subtree mask(optional)view all included .15.查找以下字段:#view mib2 included .ernet.mgmt.mib-2 fc將該行前面的#去掉.保存、關(guān)閉c) 設(shè)置net-snmp自啟動(dòng)rootFDWIN proc#chkconfig -level 35 snmpd onrootFDWI

8、N proc#chkconfig -add snmpdd) SNMP測(cè)試(本機(jī))rootFDWIN proc#snmpwalk -v -2c -c public FDWIN若有大量數(shù)據(jù)返回,說明SNMP配置正確e) 防火墻打開udp 161端口f) 檢查SNMP服務(wù)是否運(yùn)行rootFDWIN proc#netstat -ln |grep 161udp 0 0 :161 :* 表示SNMP已運(yùn)行正常CACTI安裝a) RRDtool的安裝1.cgilibwget /source/cgilib-0.5.tar.gztar -zxvf cgilib-0.5.tar.gzcd cgilib-0.5ma

9、kecp libcgi.a /usr/local/libcp cgi.h /usr/include2.fontconfigwget /release/fontconfig-2.8.0.tar.gzcd fontconfig-2.8.0./configuremake & make install3.pixmanwget /releases/pixman-0.21.2.tar.gzcd pixman-0.21.2./configuremake;make install4.cairowget /releases/cairo-1.10.0.tar.gztar -zxvf cairo-1.10.0.ta

10、r.gzcd cairo-1.10.0export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH #這里很重要./configuremake;make install5.pangowget /pub/gnome/sources/pango/1.17/pango-1.17.5.tar.gztar -zxvf pango-1.17.5.tar.gzcd pango-1.17.5./configuremake & make install6.rrdtoolwget /rrdtool/pub/rrdtool-1.4.4.tar.gz

11、tar -xvzf rrdtool-1.4.4.tar.gzcd rrdtool-1.4.4./configure prefix=/usr/local/rrdtoolmake;make isntallb) Cacti的安裝1.下載Cacti軟件包,并安裝到/var/www/html/cactiwget /downloads/cacti-0.8.7g.tar.gztar -xvzf cacti-0.8.7g.tar.gzmv cacti-0.8.7g /var/www/html/cacti2.配置數(shù)據(jù)庫mysql -u root -p 123456mysql create database ca

12、cti;mysql grant all privileges on cacti.* to cactiFDWIN identified by cactiwith grant option;mysql grant all privileges on cacti.* to cacti identified by cactiwith grant option;mysqlflush privileges;mysql use cacti;mysql source /var/www/html/cacti/cacti.sql;3.配置Cacti以連接數(shù)據(jù)庫vi /var/www/html/cacti/incl

13、ude/config.php 依照如下修改:/* make sure these values refect your actual database/host/user/password */$database_type = mysql;$database_default = cacti;$database_hostname = FDWIN;$database_username = cacti;$database_password = cacti;$database_port = 3306;vi /var/www/html/cacti/include/global.php 依照如下修改:/*

14、 Default database settings*/$database_type = mysql;$database_default = cacti;$database_hostname = FDWIN;$database_username = cacti;$database_password = cacti;$database_port = 3306;$configurl_path = /cacti/;4.添加cacti用戶rootFDWIN proc#useradd -s nologin cactirootFDWIN proc#passwd cacti5.修改cacti目錄屬主root

15、FDWIN proc#chown -R cacti:cacti /var/www/html/cacti/6.編輯crontabrootFDWIN proc#crontab -e*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php /dev/null 2&17.關(guān)閉SELinuxrootFDWIN proc#setenforce 08.用瀏覽器訪問http:/FDWIN/cacti/9.配置Cacti首先點(diǎn)開settings的path頁,正確設(shè)置相應(yīng)的路徑,然后finish保存10.安裝補(bǔ)丁按照C上的步驟,打上補(bǔ)丁程序必須在Cacti的安

16、裝目錄下,即/var/www/html/cacti/rootFDWIN proc#wget /downloads/patches/0.8.7g/data_source_deactivate.patchrootFDWIN proc#wget /downloads/patches/0.8.7g/graph_list_view.patchrootFDWIN proc#wget /downloads/patches/0.8.7g/html_output.patchrootFDWIN proc#wget /downloads/patches/0.8.7g/ldap_group_authenication

17、.patchrootFDWIN proc#wget/downloads/patches/0.8.7g/script_server_command_line_parse.patchrootFDWIN proc#wget /downloads/patches/0.8.7g/ping.patchrootFDWIN proc#wget /downloads/patches/0.8.7g/poller_interval.patchrootFDWIN proc#patch -p1 -N data_source_deactivate.patchpatch -p1 -N graph_list_view.pat

18、chpatch -p1 -N html_output.patchpatch -p1 -N ldap_group_authenication.patchpatch -p1 -N script_server_command_line_parse.patchpatch -p1 -N ping.patchpatch -p1 -N poller_interval.patchCACTI的配置和插件必須現(xiàn)安裝好插件擴(kuò)展PIA 2.8,才能安裝、使用其他插件wget /downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gztar -xvzf cacti-plu

19、gin-0.8.7g-PA-v2.8.tar.gzmv cacti-plugin-arch /var/www/html/cacti/cd /var/www/html/cacti/mysql -u root -p 123456 cacti cacti-plugin-arch/pa.sqlpatch -p1 -N admin or other user - Realm Permissions - PluginManagement - 打勾并保存3. 安裝插件a)下載插件wget /downloads/settings.tar.gzwget /downloads/monitor.tar.gzwget

20、 /downloads/realtime.tar.gzwget /downloads/syslog.tar.gzwget /downloads/thold.tar.gzwget /downloads/tools.tar.gzwget /downloads/update.tar.gzwget /project/cacti-reportit/cactireportit/reportit_v061/reportit_v061.tar.gzwget /downloads/npc-2.0.4.tar.gzb)解壓插件tar -xvzf settings.tar.gztar -xvzf monitor.t

21、ar.gztar -xvzf realtime.tar.gztar -xvzf syslog.tar.gztar -xvzf thold.tar.gztar -xvzf tools.tar.gztar -xvzf update.tar.gztar -xvzf reportit_v06.tar.gztar -xvzf npc-2.0.4.tar.gzc)修改global.php,增加插件說明vi /var/www/html/cacti/include/global.php$plugins = settings;$plugins = thold;$plugins = npc;$plugins =

22、syslog;$plugins = aggregate;$plugins = reportit;$plugins = update;$plugins = tools;d)下載安裝json(NPC插件需要json支持)wget /get/json-1.2.1.tgztar -xvzf json-1.2.1.tgz/usr/bin/phpize # 如果phpize 沒有此指令,請(qǐng)yum安裝php-devel包./configuremake & make installe) 修改權(quán)限將所有插件mv到/var/www/html/cacti/plugins目錄下,然后User Management -

23、 adminor other user - Realm Permissions - Plugin Management - 打勾并保存f) 啟用插件點(diǎn)擊configuration下的plugins management,將各個(gè)插件install/enable。4. 插件安裝排錯(cuò)a)realtime插件安裝問題realtim插件安裝好后,點(diǎn)擊web界面的graphs頁,選一個(gè)圖,可發(fā)現(xiàn)在其右下角已經(jīng)出現(xiàn)了一個(gè)realtime的logo,但當(dāng)點(diǎn)此logo進(jìn)行realtime查看時(shí),會(huì)發(fā)現(xiàn)彈出的窗口中顯示:“The image cache directory doesnt exist.Please

24、create it and set permissionsand then attempt to open an other realtime graph.”提示沒有Cache目錄以及權(quán)限等。解決方案:rootlocalhost proc#makedir /var/www/html/cacti/cacherootlocalhost proc#chmod 777 -R /var/www/html/cacti/cache之后,還要進(jìn)入console-configuration-settings-misc,設(shè)置”Cache Directory”為/var/www/html/cacti/cache/b

25、) Syslog插件安裝問題在cacti中訪問syslog欄目是會(huì)出現(xiàn)以下提示:1 Warning: include(./include/html/inc_timespan_settings.php) function.include:failed to open stream: No such file or directory in/var/www/html/plugins/syslog/syslog.php on line 1262 Warning: include() function.include: Failed opening./include/html/inc_timespan

26、_settings.php for inclusion(include_path=.:/usr/share/pear) in /var/www/html/plugins/syslog/syslog.php online 126只需將/plugins/syslog/syslog.php的第126行#include($syslog_configgraphtime ? ./include/html/inc_timespan_settings.php: plugins/syslog/html/syslog_timespan_settings.php);修改為:#include($syslog_conf

27、iggraphtime ?./lib/timespan_settings.phpplugins/syslog/html/syslog_timespan_settings.php);即可搭建SYSLOG 日常的Linux服務(wù)器都會(huì)安裝syslogd或者rsyslog等日志監(jiān)控服務(wù)。不過,由于日志文件都已文本形式放到服務(wù)器上,一個(gè)一個(gè)的去查找還是比較麻煩的。不過使用cacti可以為我們找到一條捷徑。1. 安裝syslog-ng服務(wù)Syslog-ng,下一代syslog服務(wù)。Cacti的syslog監(jiān)控插件只支持這一種日志服務(wù)。rootFDWIN proc#yum install syslog-ng

28、2. 配置syslog插件rootFDWIN proc#cd /var/www/html/cacti/plugins/syslog/rootFDWIN proc#vi config.php$syslogdb_type = mysql;$syslogdb_default = syslog;$syslogdb_hostname = FDWIN;$syslogdb_username = ;$syslogdb_password = ;3. 配置數(shù)據(jù)庫rootFDWIN proc#mysql -u root -p 123456mysqlcreate database syslog;mysqlgrant

29、all on syslog.* to cactiloaclhost;mysqlflush privileges;mysqlexit;mysql ucacti p syslog syslog.sql4. 配置syslog-ng.confvi /etc/syslog-ng/syslog-ng.confversion: 3.0options keep_hostname(yes);long_hostnames(off);flush_lines(1);log_fifo_size(1024);create_dirs(yes); # if a dir does not exist create itowner(root); # owner of created filesgroup(root); # group of created filesperm(0600); # permissions of created filesdir_perm(0700); # permissions of created dirs;source n

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論