安裝配置nagios

一、安裝nagios前的準備工作

我們提供的服務有:成都網(wǎng)站制作、網(wǎng)站設計、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、華州ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的華州網(wǎng)站制作公司

1.解決安裝Nagios的依賴關系:Nagios基本組件的運行依賴于httpd、gcc和gd

2. 所需要安裝組件:

服務端所用的安裝包為 nagios nagios-plugins

linux客戶端 nrpe

windows客戶端 NSClient++

二.下載需求軟件

nagios主程序:wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz

nagios插件程序:wget http://down1.chinaunix.net/distfiles/nagios-plugins-1.4.13.tar.gz

apache程序:wget http://autosetup1.googlecode.com/files/httpd-2.2.11.tar.gz

php程序:wget http://museum.php.net/php5/php-5.3.0.tar.gz

三.編譯安裝nagios

1.tar zxf nagios-3.1.2.tar.gz

[root@localhost nagios-3.1.2]#   cd nagios-3.1.2

[root@localhost nagios-3.1.2]#./configure --enable-event-broker--prefix=/usr/local/nagios

[root@localhost nagios-3.1.2]#make all

[root@localhost nagios-3.1.2]#make install

[root@localhost nagios-3.1.2]#make install-init

[root@localhost nagios-3.1.2]#make install-config

[root@localhost nagios-3.1.2]#make install-commandmode

在httpd的配置文件目錄(conf.d)中創(chuàng)建Nagios的Web程序配置文件:

  [root@localhost nagios-3.1.2]#make install-webconf

創(chuàng)建一個登錄nagiosweb程序的用戶,這個用戶帳號在以后通過web登錄nagios認證時所用:

# htpasswd -c/var/www/nagios/etc/htpasswd.users nagiosadmin

2.編譯安裝nagios-plugins

nagios的所有監(jiān)控工作都是通過插件完成的,因此,在啟動nagios之前還需要為其安裝官方提供的插件。

tar zxf nagios-plugins-1.4.13.tar.gz

[root@localhost nagios-plugins-1.4.13]#cd nagios-plugins-1.4.13

[root@localhost nagios-plugins-1.4.13]#./configure --with-nagios-user=nagios --with-[root@localhost nagios-plugins-1.4.13]#nagios-group=nagios -with-MySQL

[root@localhost nagios-plugins-1.4.13]#make

[root@localhost nagios-plugins-1.4.13]#make install

4.配置并啟動Nagios

/etc/init.d/nagios start

注:如果啟動時會報錯

Error: Cannot open main configuration file '/root/nagios-plugins-1.4.13/start' for reading!

Nagios 3.1.2 starting... (PID=14327)

Local time is Fri Feb 28 02:52:22 CST 2014

Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=14327)

使用: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg檢查配置文件沒有發(fā)現(xiàn)錯誤

可使用:/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg 嘗試啟動

啟動成功之后 可以使用top命令查看是否有nagios進程(有nagios進程說明啟動成功)

注: service nagios restart 啟動時再次失敗

Running configuration check...done.

Stopping nagios: done.

Starting nagios:su: warning: cannot change directory to /home/nagios: No such file or directory

This account is currently not available.

done.

可以使用: mkdir /home/nagios 解決

service nagios restart 如果啟動時仍然失敗 但錯誤提示是:  

Running configuration check...done.

Stopping nagios: done.

Starting nagios:This account is currently not available.

done.

可以在:vi  /etc/passwd

找到此行:nagios:x:500:500::/home/nagios:/sbin/nologin(注意紅色字體),把此行改成如下一行

       nagios:x:500:500::/home/nagios:/bin/bash

修改后再次重啟 ,啟動成功

[root@localhost nagios-3.1.2]# service nagios restart

Running configuration check...done.

Stopping nagios: done.

Starting nagios: done.





網(wǎng)頁標題:安裝配置nagios
路徑分享:http://bm7419.com/article6/igcsig.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設計、定制網(wǎng)站、外貿(mào)網(wǎng)站建設微信公眾號、域名注冊、網(wǎng)站排名

廣告

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

成都定制網(wǎng)站網(wǎng)頁設計