net-snmp 是一套廣泛使用在類 unix 系統上的 snmp 軟件, 包含一套 snmp agent 框架 ,一個 snmpd 和 一堆 snmp 工具 , 其前身爲 ucd-snmp. 關於 snmp 是什麼, 以及如何配置的文章,網上搜一下有一堆一堆的. 在這裏就不重複了.
http://tewuxiaoqiang.blog.51cto.com/279711/161207 Cacti Nagios比較
http://www.oschina.net/p/zabbix zabbix是一個基於WEB界面的提供分佈式系統監視以及網絡監視功能的企業級的開源解決方案。zabbix能監視各種網絡參數,保證服務器系統的安全運營;並提供柔軟的通知機制以讓系統管理員快速定位/解決存在的各種問題。
zabbix由2部分構成,zabbix server與可選組件zabbix agent。
zabbix server可以通過SNMP,zabbix agent,ping,端口監視等方法提供對遠程服務器/網絡狀態的監視,數據收集等功能,它可以運行在Linux, Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X等平臺之上。
zabbix agent需要安裝在被監視的目標服務器上,它主要完成對硬件信息或與操作系統有關的內存,CPU等信息的收集。zabbix agent可以運行在Linux ,Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X, Tru64/OSF1, Windows NT4.0, Windows 2000/2003/XP/Vista)等系統之上。
zabbix server可以單獨監視遠程服務器的服務狀態;同時也可以與zabbix agent配合,可以輪詢zabbix agent主動接收監視數據(trapping方式),同時還可被動接收zabbix agent發送的數據(trapping方式)。
另外zabbix server還支持SNMP (v1,v2),可以與SNMP軟件(例如:net-snmp)等配合使用。
zabbix的主要特點:
- 安裝與配置簡單,學習成本低
- 支持多語言(包括中文)
- 免費開源
- 自動發現服務器與網絡設備
- 分佈式監視以及WEB集中管理功能
- 可以無agent監視
- 用戶安全認證和柔軟的授權方式
- 通過WEB界面設置或查看監視結果
- email等通知功能
等等
Zabbix主要功能:
- CPU負荷
- 內存使用
- 磁盤使用
- 網絡狀況
- 端口監視
- 日誌監視
zabbix的License:GPL v2
標籤: Linux PHP C/C++ 系統監控
開發語言: PHP C/C++
項目主頁: http://www.zabbix.com/
文檔地址: http://www.zabbix.com/documentation.php
下載地址: http://www.zabbix.com/download.php
收錄時間:2008年09月16日
1. 主要對流量及主機在線狀態監控軟件,如最初的MRTG,PRGT,CACTI,Hobbit,
2. 能對服務器的關鍵服務及進程進行監控的軟件,如Big Brother,Nagios,
http://blog.chinaunix.net/u/12909/showart_1073431.html mrtg,cacti,rrdtool,nagios, zabbix安裝
安裝net-snmp
下載net-snmp-5.3.0.1-1.EL4.i386.rpm
安裝mrtg:www.mrtg.org
下載
mrtg-2.12.2.tar.gz
./configure --prefix=/usr/local/mrtg & make & make install cp /usr/local/mrtg/bin/* /usr/bin
安裝rrdtool:
www.rrdtool.org
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/doc/rrdbuild.en.html
(以下部分可以直接copy到linux shell下 自動安裝,我是分段copy,整體copy未嘗試)
BUILD_DIR=/tmp/rrdbuild
INSTALL_DIR=/usr/local/rrdtool
mkdir -p $BUILD_DIR
mkdir $BUILD_DIR/lb
cd $BUILD_DIR
#####zlib
wget
http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/zlib-1.2.2.tar.gz
tar zxvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR zlib*
#####libpng
wget
http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libpng-1.2.8-config.tar.gz
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" \
CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR libpng*
#########freetype
wget
http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/freetype-2.1.9.tar.gz
tar zxvf freetype-2.1.9.tar.gz
cd freetype-2.1.9
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR freetype*
####### libart_lgpl
wget
http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
tar zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
rm -fR libart*
########cgilib
wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs/cgilib-0.5.tar.gz
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make CC=gcc CFLAGS="-O3 -fPIC -I."
mkdir -p $BUILD_DIR/lb/include
cp *.h $BUILD_DIR/lb/include
mkdir -p $BUILD_DIR/lb/lib
cp libcgi* $BUILD_DIR/lb/lib
cd ..
rm -fR cgilib*
#########install rrdtool
ranlib $BUILD_DIR/lb/lib/*.a # 優化
IR=-I$BUILD_DIR/lb/include
CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
LDFLAGS="-L$BUILD_DIR/lb/lib"
CFLAGS=-O3
export CPPFLAGS LDFLAGS CFLAGS
cd $BUILD_DIR/
wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.2.12.tar.gz
tar zxvf rrdtool-1.2.12.tar.gz
cd rrdtool-1.2.12
./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
make
make install
cd ..
rm -fR rrdtool*
***********************RRDTOOL INSTALL SUCCESSFULLY**********************
安裝CACTI:www.cacti.net
cacti-0.8.6h.tar.gz
tar zxvf cacti-0.8.6h.tar.gz
cp –R cacti-0.8.6h /usr/local/cacti/
配置Mysql:
group-add cacti
useradd -g cacti cactiuser
/usr/local/mysql/bin/mysql – --user=root – --password=yanhannet
mysql> create database cactidb;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('yanhannet');
mysql> exit
# mysql --user=root --password=yanhannet cactidb
# chown -R cactiuser rra/ log/
# chmod –R 777 rra/ log/
# vi cacti/include/config.php
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "yanhannet";
$database_port = "3306";
vi /etc/ctrontab (crontab -u cactiuser –e)
*/5 * * * * cactiuser php /usr/local/cacti/poller.php > /dev/null 2>&1
配置apache
vi /usr/local/apache/conf/conf.d/cacti.conf
Alias /cacti /usr/local/cacti
Options None
AllowOverride None
Order allow,deny
Allow from all
# AuthName "XXXXX"
# AuthType Basic
# AuthUserFile /XXX/htpasswd.users
# Require valid-user
******************CACTI INSTALL SUCCESSFULLY ***********************
安裝nagios
www.nagios.org
useradd nagios
mkdir /usr/local/nagios
chown nagios.nagios /usr/local/nagios/
./configure --prefix=/usr/local/nagios --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
注:紅色部分爲gd庫位置,如果不加,這會出現The statusmap, trends and histogram CGIs are missing or dont work!
查看3-D status map 需要在本機下載插件contvrml
http://www.parallelgraphics.com/bin/cortvrml.exe
在apache配置文檔目錄下
vi nagios.conf
scriptalias /nagios/cgi-bin /usr/local/nagios/sbin
allowoverride authconfig
options execcgi
order allow,deny
allow from all
alias /nagios /usr/local/nagios/share
options none
allowoverride authconfig
order allow,deny
allow from all
在nagios sbin/ share/目錄下
vi .htaccess
authname "nagios access"
authtype basic
authuserfile /usr/local/nagios/etc/.nagios.users
require valid-user
生成用戶文件
htpasswd -c /usr/local/nagios/etc/.nagios.users nagiosadmin
具體參數配置參考官方文檔
工具插件:
www.nagiosexchange.org
fruity 要求php5以上
下載:
https://sourceforge.net/project/showfiles.php?group_id=136248
http://pear.php.net/get/HTML_TreeMenu-1.2.0.tgz
http://sourceforge.net/project/showfiles.php?group_id=42718
http://puzzle.dl.sourceforge.net/sourceforge/adodb/adodb471-1.tgz
直接解壓複製到fruity 下 分別改名爲HTML 和adodb 其他不做修改
修改 fruity/includes下的config.ifg,需要更改的地方有,路徑,mysql信息
mysql 添加fruity 數據庫和user,password.
*************************NAGIOS INSTALL SUCCESSFULLY*****************
安裝zabbix:
wget http://belnet.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.1beta6.tar.gz
tar zxvf zabbix-1.1beta6.tar.gz
mysql -u -p
> creat database zabbix;
>quit;
cd creat/mysql
mysql -u -p zabbix
cd ../data
mysql -u -p zabbix
cd ..
./configure --prefix=/usr/local/zabbix --with-mysql=/usr/local/mysql --enable-server --enable-agent
make
make install
cp misc/conf/* /etc/zabbix/conf/
cp frontends/php/* /usr/local/zabbix/php
修改apache添加zabbix.conf