======Nagios======
Nagios是一個受歡迎的即時監控軟體。它一開始設計就是以模組方式,因此功能多樣性可以用插件(Plugin)來擴展他的功能。設定檔是以物件
概念方式來調校。更多介紹訊息請看[[http://zh.wikipedia.org/wiki/Nagios|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
=====結果展示=====
{{:linux:web:screenshot-1.png?300|}}
點選左半部Current Status/Host選項,看到右半部localhost出現UP,表示已建置完成。
{{:linux:web:screenshot-2.png?800|}}
======參考資料======
- [[http://www.server-world.info/en/note?os=CentOS_6&p=nagios|Nagios安裝及配置on Centos6]]
- [[http://kuma-uni.blogspot.tw/2012/08/nagios.html|Nagios的安裝與配置 ]]
- [[http://www.vitki.net/static/docs/nsclient/nsclient-readme.html#Custom Counter|NSClient documentation]]
- [[http://www.cszhi.com/20120527/nagios-nsca.html|Linux監控利器nagios–NSCA被動監控]]
- [[http://www.on-sky.net/~hs/misc/?NSCA+Howto|Nagios NSCAによる遠隔サーバの内部リソース監視]]
- [[http://www.wretch.cc/blog/aflyfish/34466633|NSCA]]
- [[http://www.nagios.org/download/addons/|Nagios一些常見的專案]]