使用者工具

網站工具


linux:monitor:nagios

Nagios

Nagios是一個受歡迎的即時監控軟體。它一開始設計就是以模組方式,因此功能多樣性可以用插件(Plugin)來擴展他的功能。設定檔是以物件 概念方式來調校。更多介紹訊息請看Nagios_Wiki

Nagios安裝

Nagios安裝很簡單,這裡用epel套件來源安裝Nagios,再用開源流行的架構LAMP,另配合perl(Nagios有很多功能以perl執行)。 為了使環境更簡單把iptable及selinux(#setenforce 0)取消掉(若要提供對外服務,強烈建議一定要打開iptable及Selinux)

#cd /etc/yum.repos.d/
#rpm -ivh http://mirror01.idc.hinet.net/EPEL/6/i386/epel-release-6-8.noarch.rpm
#vim epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1    ==>更改為0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
~略~
#yum --enablerepo=epel install nagios nagios-plugins

配置Httpd

用yum安裝,Nagios非常貼心將httpd設定檔For Nagios 寫好了 /etc/httpd/conf.d/nagios.conf,可以根據需求加以修改。 現在只要新增一個使用者帳戶來認證網頁

#htpasswd /etc/nagios/passwd nagiosadmin
New password:# set password
Re-type new password:

分別啟動Nagios及Httpd

#/etc/init.d/httpd start
#/etc/init.d/nagios start
#chkconfig  nagios on && chkconfig  httpd on

安裝check_ping插件Plugin

#yum --enablerepo=epel install nagios-plugins-ping.x86_64

結果展示

點選左半部Current Status/Host選項,看到右半部localhost出現UP,表示已建置完成。

參考資料

linux/monitor/nagios.txt · 上一次變更: 2013/07/06 01:28 (外部編輯)