nagios安裝配置

2022-08-28 13:06:11 字數 3141 閱讀 4425

nagios官網上2013-10-15更新了最新版nagios-4.0.1

install-init(需root)

$ make

install-commandmode

$ make

install-config

# make

install-webconf(需root)

安裝nagios 外掛程式

$ tar zxvf nagios-plugins-1.5.tar

.gz$ cd nagios-plugins-1.5/$ ./configure --prefix /home/nagios/nagios

$ make && make

install

#setting for nagios 

scriptalias /nagios/cgi-bin "/home/nagios/nagios/sbin"

<

directory

"/home/nagios/nagios/sbin"

>

authtype basic

options execcgi

allowoverride none

order allow,deny

allow from all

authname "nagios access"

authuserfile /home/nagios/nagios/etc/htpasswd.user

require valid-user

directory

>

alias /nagios "/home/nagios/nagios/share"

<

directory

"/home/nagios/nagios/share"

>

authtype basic

options none

allowoverride none

order allow,deny

allow from all

authname "nagios access"

authuserfile /home/nagios/nagios/etc/htpasswd.user

require valid-user

directory

>

$ htpasswd -c /home/nagios/nagios/etc/htpasswd.user

# ln -s /home/nagios/nagios/share /var/www/html/nagios

# service nagios restart
如果碰到「error: could not read object configuration data!

」,檢查是否啟動nagios服務

解壓編譯安裝

$ tar zxvf nrpe-2.15.tar

.gz$ cd nrpe-2.15/$ ./configure --prefix /home/nagios/nagios

$ make

all$

make

install-plugin

$ make

install-daemon

$ make

install-daemon-config

# make

install-xinetd(需root)

在ubuntu下安裝的時候,顯示error:cannot find ssl libraries錯誤

需要安裝openssl 並使用下面引數

$ ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
新增到服務(需root)

在/etc/service檔案中新增以下行

nrpe            5666/tcp        #nrpe

並修改/etc/xinetd.d/nrpe檔案中的only_from項,加入nagios主機的ip,空格隔開
驗證是否安裝成功
# service xinetd restart

stopping xinetd: [ ok ]

starting xinetd: [ ok ]

#netstat -an |grep

5666

tcp 00

172.16.3.100:56661

172.16.3.110:9000

time_wait

tcp

00 :::5666 :::*listen

#../nagios/libexec/check_nrpe -h localhost

nrpe v2.

15

看到版本號說明已經安裝成功

被監控機要安裝angios-plugin和nrpe-daemon,因為的home目錄是用的nfs所以,就裝在一起就好了

但是/etc/service和/etc/xinetd.d/nrpe檔案還是要在每台被監控主機上修改

基本安裝就到這裡,剩下的就是修改配置檔案了

nagios安裝配置

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

Nagios太陽(pnp)安裝配置

一 安裝rrdtool rrdtool將nagios採集的資料繪製成圖表。with perl options usr bin perl 指定perl路徑 make make install 二 安裝pnp with rrdtool usr local rrdtool bin rrdtool 指定rr...

nagios 外掛程式ndoutils 安裝配置

nagios 外掛程式ndoutils 安裝配置 nagios install ndoutils 安裝ndoutils外掛程式 root cagios ndoutils 2.0.0 chown nagios.nagcmd usr local nagios etc ndo root cagios nd...