#################################Server端####################################
創(chuàng)新互聯(lián)公司是一家網(wǎng)站設計公司,集創(chuàng)意、互聯(lián)網(wǎng)應用、軟件技術為一體的創(chuàng)意網(wǎng)站建設服務商,主營產(chǎn)品:成都響應式網(wǎng)站建設公司、成都品牌網(wǎng)站建設、營銷型網(wǎng)站。我們專注企業(yè)品牌在網(wǎng)站中的整體樹立,網(wǎng)絡互動的體驗,以及在手機等移動端的優(yōu)質(zhì)呈現(xiàn)。成都做網(wǎng)站、成都網(wǎng)站制作、移動互聯(lián)產(chǎn)品、網(wǎng)絡運營、VI設計、云產(chǎn)品.運維為核心業(yè)務。為用戶提供一站式解決方案,我們深知市場的競爭激烈,認真對待每位客戶,為客戶提供賞析悅目的作品,網(wǎng)站的價值服務。
----------------
Nagios
----------------
源碼包地址:http://sourceforge.net/projects/nagios/?source=directory
建立nagios賬號:
# useradd nagios && passwd nagios
# groupadd nagcmd //nagcmd用于從web接口執(zhí)行外部命令
# usermod -G nagcmd nagios
# usermod -G nagcmd daemon
安裝nagios:
# tar xf nagios.xx.xx
# ./configure --with-command-group=nagcmd --with-nagios-user=nagios --with-nagios-group=nagios
# make all
# make install
# make install-init --> 生成init啟動腳本
# make install-commandmode --> 設置相應的目錄權限
# make install-config --> 生成模板配置文件
# make install-webconf --> 生成apache配置文件
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
# yum install httpd
# cp /etc/httpd/conf/nagios.conf /usr/local/apache2/conf/extra/nagios.conf
# vim /usr/local/apache2/conf/httpd.conf
include conf/extra/nagios.conf
# chkconfig --add nagios
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# /etc/init.d/nagios start
測試:http://IP/nagios/
###############################################Server端###############################################
#################################Server端和Client端安裝################################
安裝nagios插件
-----------------------
nagios-plugin.xx.xx
-----------------------
源碼地址:http://sourceforge.net/projects/nagiosplug/
# tar xf nagios-plugin.xx.xx
# cd nagios-plugin.xx.xx
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
# make && make install
# pwd
/usr/local/nagios/libexec
// 插件安裝后的文件
-----------------------
nrpe
監(jiān)控linux本地主機時,我們可以直接更改配置文件進行監(jiān)控,如果需要監(jiān)控的主機與nagios不在同一機器上,即監(jiān)控遠程linux主機時,需要借助NRPE插件實現(xiàn)。
-----------------------
源碼地址:http://sourceforge.net/projects/nrpe/?source=directory
# ./configure
# make
# make all
# make install-plugin
# make install-daemon
# make install-daemon-config
# vim /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,192.168.1.20 #逗號隔開,授權Server獲取check_nrpe
# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg ‐d //啟動
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 //輸出表示nrpe配置成功
NRPE v2.12
###############################Server端和Client端安裝##################################