您好,登錄后才能下訂單哦!
#################################Server端####################################
----------------
Nagios
----------------
源碼包地址:http://sourceforge.net/projects/nagios/?source=directory
建立nagios賬號:
# useradd nagios && passwd nagios
# groupadd nagcmd //nagcmd用于從web接口執行外部命令
# 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
監控linux本地主機時,我們可以直接更改配置文件進行監控,如果需要監控的主機與nagios不在同一機器上,即監控遠程linux主機時,需要借助NRPE插件實現。
-----------------------
源碼地址: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端安裝##################################
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。