欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

centos安裝nagios+nrpe

linux下有2大監(jiān)控神器cacti+nagios,下面我把我自己搭建nagios的步驟記錄下來,以便以后需要的時候看。
首先安裝依賴包
#yum install -y httpd MySQL mysql-devel mysql-server php php-mysql gcc gcc-c++ gblic gblic-devel gd gd-devel openssl-devel
添加nagios用戶,用戶組
#groupadd nagcmd
#useradd nagios
#usermod -a -G nagcmd nagios
#usermod -a -G nagcmd daemon(http的user)
下載nagios安裝包,解壓
開始編譯
#./configure --prefix=/etc/nagios \
>--with-nagios-user=nagios \
>--with-nagios-group=nagios \
>--enable-event-broker
#make all
#make install
#make install-init
#make install-commandmode
#make install-config
#make install-webconf(編譯安裝的httpd會出現(xiàn)錯誤)
安裝nagios-plugins
#./configure --with-nagios-user=nagios \
>--with-nagios-group=nagios \
>--with-mysql=/path/to/mysql(監(jiān)控mysql必須添加此選項)
#make && make install
下面開始安裝nrpe
首先確定開發(fā)環(huán)境
#yum grouplist
確定有Development tools和Development Libraries
如果沒有就安裝
#yum groupinstall -y "Development tools" "Development Libraries"
開始安裝nrpe
#./configure --with-nagios-user=nagios \
>--with-nagios-group=nagios \
>--with-nrpe-user=nagios \
>--with-nrpe-group=nagios \
>--enable-command-args \
>--enable-ssl
#make all
#make install-plugin
服務(wù)器端不需要開始nrpe服務(wù)


下面開始配置客戶端
nrpe依賴于nagios-plugins,首先安裝nagios-plugins
#./configure --with-nagios-user=nagios \
>--with-nagios-group=nagios \
>--with-mysql=/path/to/mysql(監(jiān)控mysql必須添加此選項)
#make && make instal
下面開始安裝nrpe
#./configure --with-nagios-user=nagios \
>--with-nagios-group=nagios \
>--with-nrpe-user=nagios \
>--with-nrpe-group=nagios \
>--enable-command-args \
>--enable-ssl
#make all
#make install-plugin
#make install-daemon(安裝守護進(jìn)程)
#make install-daemon-config(安裝守護進(jìn)程配置文件)

修改nrpe.cfg文件
找到allowed_hosts添加你的服務(wù)器的IP

啟動nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
下面就可以在服務(wù)器端定義主機,定義命令開始監(jiān)控
定義命令
define command{
         command_name        check_nrpe
         command_line           $USER1$/check_nrpe -H  $HOSTADDRESS$  -c $ARG1$(-c表示在遠(yuǎn)程執(zhí)行命令)
}
定義主機
define host {
         use                            linux-server
         host_name                 webserver
         alias                           web-server
         address                      192.168.0.4
}
定義服務(wù)
define service {
         use                             linux-service
         host_name                  webserver
         service_description     PING
         check_command         check_nrpe!check_ping
}
想要監(jiān)控什么就在客戶端上定義命令,在服務(wù)器上填寫檢測內(nèi)容就可以了


下面附上nrpe的啟動腳本
#!/bin/sh
#
# Source function library
if [ -f /etc/rc.d/init.d/functions ]; then
   . /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
   . /etc/init.d/functions
elif [ -f /etc/rc.d/functions ]; then
   . /etc/rc.d/functions
fi
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
NrpeBin=/usr/local/nagios/bin/nrpe
NrpeCfg=/usr/local/nagios/etc/nrpe.cfg
LockFile=/var/lock/subsys/nrpe
# See how we were called.
case "$1" in
 start)
    # Start daemons.
    echo -n "Starting nrpe: "
    daemon $NrpeBin -c $NrpeCfg -d
   echo
   touch $LockFile
    ;;
 stop)
   # Stop daemons.
   echo -n "Shutting down nrpe: "
    killproc nrpe
   echo
   rm -f $LockFile
    ;;
 restart)
   $0 stop
   $0 start
    ;;
 status)
   status nrpe
    ;;
 *)
   echo "Usage: nrpe {start|stop|restart|status}"
    exit 1
esac
exit 0

網(wǎng)站建設(shè)公司,為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁設(shè)計及定制網(wǎng)站建設(shè)服務(wù),專注于企業(yè)網(wǎng)站制作,高端網(wǎng)頁制作,對資質(zhì)代辦等多個行業(yè)擁有豐富的網(wǎng)站建設(shè)經(jīng)驗的網(wǎng)站建設(shè)公司。專業(yè)網(wǎng)站設(shè)計,網(wǎng)站優(yōu)化推廣哪家好,專業(yè)seo優(yōu)化排名優(yōu)化,H5建站,響應(yīng)式網(wǎng)站。

網(wǎng)站標(biāo)題:centos安裝nagios+nrpe
分享網(wǎng)址:http://www.chinadenli.net/article6/joieog.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航云服務(wù)器網(wǎng)站改版網(wǎng)頁設(shè)計公司網(wǎng)站排名用戶體驗

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

手機網(wǎng)站建設(shè)