Ads 468x60px

Pages

2011年3月17日 星期四

網路監控 : 活用 Nagios + ndo2db + Cacti + NPC (一)


說到 Linux 免費網路監控軟體,前三名不外乎是 Nagios, Ntop, Cacti. 它們各有各自的強項。這裡我是取 Nagios 強大的監測及通知的功能,Cacti 強大的繪圖及 plugin 能力。所以才會使用 Nagios + Cacti + NPC。它們的基本的安裝方式,去 google 一下就很多了,這裡只列安裝要點,主要說明 nagios 配置檔, ndo2db及NPC 的設定及使用方式。

1. 安裝 Nagios
RHEL5.x 的 repository 裡的 nagios 還是 2.x 的,所以自行去下載
$ yum install libtool-ltdl.x86_64 fping perl-Net-SNMP
$ wget http://packages.sw.be/nagios/nagios-3.2.3-3.el5.rf.x86_64.rpm
$ rpm -ivh nagios-3.2.3-3.el5.rf.x86_64.rpm
$ yum install nagios-common-2.12-10.el5 
$ yum install nagios-plugins-1.4.15-2.el5
$ yum install nagios-plugins-all-1.4.15-2.el5
裝完之後,基本的設定檔 /etc/nagios 就已經可以執行了,只要再修改二個地方就可以。
  1. 修改 /etc/nagios/objects/contacts.cfg 檔裡的 email address 成你的 email ,這樣你才可以收到通知信。
  2. 修改 nagiosadmin 的 password (瀏覧器介面的帳號)
# cd /etc/nagios 
# htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
....你的密碼....

# /sbin/service nagios restart
接著打開 Browser,輸入 http://localhost/nagios 就可以看到畫面了。