亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2694 | 回復(fù): 3
打印 上一主題 下一主題

nagios 3.X 簡單部署及應(yīng)用。非常簡單的文檔 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2008-06-03 13:19 |只看該作者 |倒序?yàn)g覽
################################
# 歡迎與我交流                 #
# 作者:守住每一天             #
# QQ: 48431359                #
# BLOG: liuyu.blog.51cto.com   #
################################
本文主要參考官方文檔。
1、準(zhǔn)備工作
所需要的軟件包:
gcc
gd
glibc
httpd
yum install cc
yum install glibc glibc-common
yum install gd gd-devel
httpd 可以參照其它文檔
設(shè)置 nagios用戶  用戶組
/usr/sbin/useradd nagios
為了安全性設(shè)置為nologin
/usr/sbin/usermod -s /sbin/nologin nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd apache
2、下載軟件:
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.2.tar.gz
wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

3、tar xzf nagios-3.0.2.tar.gz
cd nagios-3.0.2
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf  ---可以自動(dòng)配置httpd.conf

4、vi /usr/local/nagios/etc/objects/contacts.cfg
改變E-MAIL 地址

5、APACHE 設(shè)置:
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
service httpd restart
就可以看到nagios界面了。

6、安裝插件:
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

7、設(shè)置nagios啟動(dòng)
chkconfig --add nagios
chkconfig nagios on
檢查配置文件是否正確 :/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start
注意:如果你開啟了selinux 需要配置如下二步:
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

8、3.X與2.X的配置文件區(qū)別
安裝方法沒有太多不同的地方。主要是配置文件的變化,3.X部署比較方便,特別是多服務(wù)器時(shí)。
配置文件默認(rèn)都在/usr/local/nagios/etc/objects/
主控制配置文件在/usr/local/nagios/etc/
這次不需要手動(dòng)創(chuàng)建那么多的文件。
也沒有hosts groups 等配置文件。
這些內(nèi)容直接寫在被監(jiān)控機(jī)的配置文件里面。寫這多也不好理解。直接看例子吧。

9、監(jiān)控其它機(jī)子
添加被監(jiān)控機(jī)A(linux)
在/usr/local/nagios/etc/objects/ 目錄下新建文件:a.cfg
官方說明:在Nagios里每個(gè)要監(jiān)控的服務(wù)都必須給出一個(gè)綁定在剛才定義出的主機(jī)上的一個(gè)服務(wù)對(duì)象。可以把服務(wù)對(duì)象放在任何一個(gè)由
cfg_file域指向的對(duì)象配置文件里或是放在cfg_dir域所指向的目錄下。
也就是說只需要在nagios.cfg 的配置文件里指定cfg_dir 就可以實(shí)現(xiàn)監(jiān)控機(jī)器的目的。
把A.cfg添加到nagios主機(jī):
echo "cfg_file=/usr/local/nagios/etc/objects/A.cfg" >> /usr/local/nagios/etc/nagios.cfg
如果要再添加B機(jī)器方法炮制就可以了
修改文件:
########################################################################
#
# 2008.05.05 add by 守住每一天
# blog: liuyu.blog.51cto.com
# NRPE COMMAND
#
################################################################
define host{
use                   generic-server                                                               
        host_name             A
        alias                 A
        address               A 的IP
        }
define service{
use   generic-service  
host_name  A
service_description HTTP
check_command  check_http
}
依次添加其它服務(wù)。

方法是不是比2.X 要簡單多了?
直接寫好一個(gè),再COPY HOHO 很舒服的。

10、監(jiān)控linux主機(jī)信息
這里需要nrpe 插件的支持。
與2.X一樣。
tar -zxvf nrpe-2.8.1.tar.gz
cd nrpe-2.8.1
./configure
make all
make install-daemon
make install-daemon-config

10.1 修改配置文件,設(shè)置允許連接的IP
vi /usr/local/nagios/etc/nrpe.conf
allowed_hosts=127.0.0.1,A的IP(最好使用內(nèi)網(wǎng)IP)

10.2 測(cè)試NAGIOS主機(jī)與被監(jiān)控機(jī)的連接
/usr/local/nagios/libexec/check_nrpe -H A的IP

10.3 啟動(dòng)nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
查看相應(yīng)的端口:netstat -net |grep 5666
防火墻開啟5666 允許局域網(wǎng)IP或固定IP連接

10.4 commands.cfg 添加nrpe的定義
########################################################################
#
# 2008.05.05 add by 守住每一天
# blog: liuyu.blog.51cto.com
# NRPE COMMAND
#
########################################################################
# 'check_nrpe ' command definition
define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

10.5 監(jiān)控方法
########################################################################
#
# 2008.05.05 add by 守住每一天
# blog: liuyu.blog.51cto.com
# NRPE COMMAND
#
################################################################
define service{
use   generic-service  
host_name  A
service_description load
check_command  check_nrpe!check_load
}
就是多加一個(gè)check_nrpe

11、監(jiān)控WIN
安裝 NSClient++
http://sourceforge.net/projects/nscplus
雙擊安裝再啟動(dòng)。
allowed_hosts允許連接的IP
防火墻開端口12489,你也可以換成別的
監(jiān)控:在nagios.cfg里cfg_dir去掉windods.cfg的注釋。
更改IP 就可以進(jìn)行監(jiān)控了。
里面的內(nèi)容跟其它的差不多,可以自行添加。

總結(jié):nagios 總體安裝比較簡單。特別是3.X 更加人性化。部署起來也沒有2.X麻煩,只要安裝過2.X的再安裝3.X更加速度~
默認(rèn)的郵箱也是自帶的,不需要再配置sendmail。
PNP的安裝還沒有完成呢。等完成了我再寫。
大伙可能會(huì)遇到一個(gè)很麻煩的問題。錯(cuò)誤如下:
CHECK_NRPE: Error - Could not complete SSL handshake
看官網(wǎng)FAQ 就知道。有如下一段:
Title: Debugging "CHECK_NRPE: Error - Could not complete SSL handshake" errors
FAQ ID: F0191
Submitted By: Greg Haygood, Ethan Galstad and Others
Last Updated: 11/03/2004
Description: When attempting to use the check_nrpe plugin, the following error message is printed:
CHECK_NRPE: Error - Could not complete SSL handshake
Solution: This error message could be due to several problems:
    * Different versions. Make sure you are using the same version of the check_nrpe plugin and the NRPE daemon. Newer
versions of NRPE are usually not backward compatible with older versions.
    * SSL is disabled. Make sure both the NRPE daemon and the check_nrpe plugin were compiled with SSL support and that
neither are being run without SSL support (using command line switches).
    * Incorrect file permissions. Make sure the NRPE config file (nrpe.cfg) is readable by the user (i.e. nagios) that
executes the NRPE binary from inetd/xinetd.
    * Pseudo-random device files are not readable. Greg Haygood noted the following... "After wringing my hair out and
digging around with truss, I figured out the problem on my Solaris 8 boxen. The files /devices/pseudo/random* (linked through
/dev/*random, and provided by Sun patch 11243 were not readable by the nagios user I use to launch NRPE. Making the
character devices world-readable solved it."
    * Unallowed address. If you're running the NRPE daemon under xinetd, make sure that you have a line in the xinetd config
file that say "only_from = xxx.xxx.xxx.xxx", where xxx.xxx.xxx.xxx is the IP address that you're connected to the NRPE daemon
from.

Dave van Nierop added that "Fortunately, for HPUX 11.i (11.11) and later Nagios users, HP now supports /dev/random and
/dev/urandom via a kernel loadable module. Prior to running the NRPE 2.0 configure script, you will need to download this
program from http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=KRNG11I.
Installation does require a server reboot. For detailed information, consult

也就是有5點(diǎn)需要注意的。
石頭大哥(http://www.itnms.net/discuz/)的翻譯如下:
簡單說一下,大概的內(nèi)容,不是嚴(yán)格翻譯。
     1.  確認(rèn)check_nrpe 和 nrpe daemon的版本一定要一致。
     2.  確認(rèn) check_nrpe和nrpe deamon端同時(shí)啟用或者禁用ssl支持。
     3.  確認(rèn)nrep.cfg可以被nrpe(或者nagios,反正是執(zhí)行nrep或者xinetd/inetd程序的)用戶正常讀取。
     4.  有關(guān)偽隨機(jī)設(shè)備的問題。這個(gè)只會(huì)在solaris 8上出現(xiàn),需要一個(gè)補(bǔ)丁Sun patch 112438。
     5.  確定nagios主機(jī)在xinetd的 only_from中,如果沒有使用xinetd,則要確認(rèn)nrpe.cfg中的配置。
另外,贈(zèng)送l兩個(gè),
1. 檢查一下你的Windows或者Linux自帶的防火墻,是否把端口給filter掉了。
2. 把nrpe的的log打開,可以發(fā)現(xiàn)更多有用的信息。

nagios 3.X的中文文檔:http://www.itnms.net/docs/nagios/cn/build/html/index.html

[ 本帖最后由 守住每一天 于 2008-6-3 13:22 編輯 ]

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2008-06-03 14:22 |只看該作者
監(jiān)控windows的話可以用snmp,那個(gè)nrpe_nt在windows server 2003打過sp2補(bǔ)丁以后就不好使了

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2008-06-03 14:22 |只看該作者
貌似有點(diǎn)復(fù)雜啊,覺得cacti比較簡單

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2008-06-03 20:21 |只看該作者
哦,2003 我還沒有遇到你所說的情況。
謝謝指點(diǎn)哈~~

監(jiān)控方式不一樣嘛。NAGIOS報(bào)警還是不錯(cuò)的。
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP