nagios極其簡單安裝配置教程

2021-08-26 06:58:16 字數 2218 閱讀 7596

# 更新yum庫

wget

rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm

#安裝nagios

yum -y install nagios nagios-nrpe nagios-plugins nagios-plugins-nrpe check_logfiles

#新增nagios到系統自動執行

chkconfig --add nagios

chkconfig nagios on

/etc/nagios  #配置檔案目錄:

/etc/nagios/objects  #模板相關配置

/usr/bin/nagios # nagios程式

配置apache密碼訪問

# nagiosadmin為使用者名稱,配置這個使用者名為省很多事

htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

啟動並測試

#開啟瀏覽器,輸入密碼,在host裡面應該有「localhost」這台機器

新增被監控裝置

# 更新yum庫

wget

rpm -ivh

#安裝nagios

yum -y install nagios-nrpe nagios-plugins nagios-plugins-nrpe

配置(client端)

vi /etc/nagios/nrpe.cfg

# 下列配置表示允許127.0.0.1, 192.168.121.55(server)這兩台機器訪問當前機器的資訊

allowed_hosts=127.0.0.1,192.168.121.55

測試(client端)

#啟動nrpe (nagios remote plugin executor)

service nrpe start

chkconfig --add nrpe

chkconfig nrpe on  

#檢視埠是否啟動

netstat -an | grep 5666

#本機測試服務是否正常

/usr/lib/nagios/plugins/check_nrpe -h 127.0.0.1 -c check_load

/usr/lib64/nagios/plugins/check_nrpe -h 127.0.0.1 -c check_load # 64 bit 命令

#伺服器端測試訪問是否正常。**在server上執行**

/usr/lib/nagios/plugins/check_nrpe -h -c check_load

#64bit /usr/lib64/nagios/plugins/check_nrpe -h -c check_load 

# 建立client配置(192.168.121.4為client ip)

vi  /etc/nagios/objects/192.168.121.4.cfg

define host

define service

# 將上面配置加到系統

vi /etc/nagios/nagios.cfg

cfg_file=/etc/nagios/objects/192.168.121.4.cfg

/usr/bin/nagios -v /etc/nagios/nagios.cfg #server端驗證配置

a: nagios找不到監控檔案,執行 "touch /var/www/html/index.html"

q: 64bit下錯誤「service check command 'check_nrpe' specified in service」

a: 發現commands.cfg裡面居然沒有「check_nrpe」這個命令定義,加上後ok

define command 附錄

nagios的發音:[ˈnædʒiɔs]

參考:centos下nagios報警飛信部署四步走

nagios/監控linux客戶端

nagios詳細配置

ganglia和nagios監控企業集群

-- end -- 

nagios極其簡單安裝配置教程

更新yum庫 wget rpm ivh rpmforge release 0.5.2 2.el5.rf.i386.rpm 安裝nagios yum y install nagios nagios nrpe nagios plugins nagios plugins nrpe check logfil...

nagios安裝配置

上線的伺服器有時會被人攻擊,導致服務不可用,今天安裝配置了nagios對上線伺服器進行監控,簡單記錄一下 安裝必要的軟體包 yum install y gcc glibc glibc common gd gd devel xinetd openssl devel 建立nagios使用者及授予目錄許可...

nagios安裝配置

nagios官網上2013 10 15更新了最新版nagios 4.0.1 install init 需root make install commandmode make install config make install webconf 需root 安裝nagios 外掛程式 tar zxv...