CentOS 6.5 安裝 Nagios Core 4.0.1

CentOS 6.5 安裝Nagios Core 4.0.1 筆記

使用yum install 安裝必要的套件

yum install -y httpd php gcc glibc glibc-common gd gd-devel make net-snmp

建立使用者集群組

指令:
useradd nagios
groupadd nagcmd

nagios-4

將 apache 及 nagios 用戶加入nagcmd群組

usermod -G nagcmd nagios
usermod -G nagcmd apache

nagios-4-1

下載 Nagios Core 4.0.1 and Nagios Plugin 1.5

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.1.tar.gz
wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz

將下載的套件解壓縮

tar -xvf nagios-4.0.1.tar.gz孬
tar -xvf nagios-plugins-1.5.tar.gz

nagios-4-2

切換到 解壓縮後的 nagios-4.0.1 目錄

執行 ./configure –with-command-group=nagcmd

nagios-4-4

nagios-4-3

再來執行

make all
make install

install the init scripts for Nagios => 該目錄執行 make install-init

install command-mode => 該目錄執行 make install-commandmode

nagios-4-5

install sample nagios files  => 該目錄執行 make install-config

nagios-4-6

安裝 web 介面 for Nagios

make install-webconf

nagios-4-7

htpasswd 設定使用者和密碼

指令: htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

nagios-4-8

重新啟動 apache

指令 : service httpd restart

安裝 Nagios Plugin

切換至前面步驟plugin 解壓縮目錄  nagios-plugins-1.5

執行以下指令:

./configure –with-nagios-user=nagios –with-nagios-group=nagiosmake

nagios-4-9
make
make instll

確定設定檔是否有問題

指令
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

nagios-4-10

啟動Nagios 服務 => 指令 service nagios start

開機自動啟動 => 指令 chkconfig nagios on

Nagios 登入網址 http://ip/nagios

nagios-4-11



本篇瀏覽人數: 6258
分類: Nagios篇。這篇內容的永久連結

在〈CentOS 6.5 安裝 Nagios Core 4.0.1〉中有 14 則留言

  1. Austin Hsieh表示:

    執行 ./configure –with-command-group=nagcmd
    應該是 –with才對

  2. Austin Hsieh表示:

    – – 兩個dash會被此網站縮減為一個

  3. jackie表示:

    您好,請問安裝完畢後~除了首頁外出現Internal Server Error是什麼問題呢?

  4. max表示:

    請問 make install-config 顯示沒有此一目錄怎麼回事

  5. peter表示:

    service nagios start一直開不起來 (status:activating,過幾分鐘又變成failed),請問該如何解決,謝謝。

  6. Mark表示:

    安裝 Nagios Plugin

    切換至前面步驟plugin 解壓縮目錄 nagios-plugins-1.5

    執行以下指令:

    ./configure –with-nagios-user=nagios –with-nagios-group=nagiosmake

    #上面這行最後面多了(make),改成下列就可以正常執行了
    ./configure –with-nagios-user=nagios –with-nagios-group=nagios

發佈回覆給「peter」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *