ZABBIX †
ZABBIX HP †
System要件 †
ZABBIX Server †
- Software
- Apache (1.3.2以上)
- PHP (4.0以上) + PHP GD Module (2.0以上)
- MySQL (3.22以上) または PostgreSQL (7.0.2以上)
- OS
- AIX
- FreeBSD
- HP-UX
- Linux
- MacOS X
- OpenBSD
- SCO Open Server
- Solaris
- Tru64/OSF
ZABBIX Agent †
- OS
- AIX
- FreeBSD
- HP-UX
- Linux
- MacOS X
- OpenBSD
- SCO Open Server
- Solaris
- Tru64/OSF
- Windows NT 4.0, Windows 2000, Windows 2003, Windows XP
- Novell NetWare?
ダウンロード †
need rpm(RedHat?) †
- mysql
- mysql-devel-4.1.20-2.RHEL4.1.0.1.i386.rpm
- mysql-server-4.1.20-2.RHEL4.1.0.1.i386.rpm
- mysqlclient10-3.23.58-4.RHEL4.1.i386.rpm
- net-snmp
- net-snmp-5.1.2-11.EL4.11.i386.rpm
- net-snmp-devel-5.1.2-11.EL4.11.i386.rpm
- net-snmp-libs-5.1.2-11.EL4.11.i386.rpm
- net-snmp-perl-5.1.2-11.EL4.11.i386.rpm
- net-snmp-utils-5.1.2-11.EL4.11.i386.rpm
- etc
- perl-DBD-MySQL-2.9004-3.1.i386.rpm
- beecrypt-devel-3.1.0-6.i386.rpm
- elfutils-devel-0.97.1-5.i386.rpm
- elfutils-libelf-devel-0.97.1-5.i386.rpm
- php
- php-4.3.9-3.22.9.i386.rpm
- php-devel-4.3.9-3.22.9.i386.rpm
- php-gd-4.3.9-3.22.9.i386.rpm
- php-mysql-4.3.9-3.22.9.i386.rpm
- php-snmp-4.3.9-3.22.9.i386.rpm
インストール †
zabbix server †
- build
tar zxvf zabbix-1.4.4.tar.gz
cd zabbix-1.4.4
./configure --enable-server --with-mysql --with-net-snmp
make
su
make install
- zabbix user
groupadd zabbix
useradd -g <zabbixグループのgid> -s /sbin/nologin zabbix
- mysql
mysql -uroot -p<パスワード>
create database zabbix;
grant all privileges on zabbix.* to zabbix@localhost identified by '<パスワード>';
flush privileges;
quit
cd create/schema
cat mysql.sql | mysql -uroot -p<パスワード> zabbix
cd ../data
cat data.sql | mysql -uroot -p<パスワード> zabbix
cat images_mysql.sql | mysql -uroot -p<パスワード> zabbix
- config file
su
mkdir /etc/zabbix
cp misc/conf/zabbix_server.conf /etc/zabbix/
- log/id files
mkdir /var/run/zabbix
mkdir /var/log/zabbix
chown zabbix:zabbix /var/run/zabbix
chown zabbix:zabbix /var/log/zabbix
- init script
cp misc/init.d/redhat/zabbix_server_ctl /etc/init.d/
- change script
# base zabbix dir
BASEDIR=/usr/local
# PID file
PIDFILE=/var/run/zabbix/zabbix_server.pid
# binary file
ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server
- start zabbix servetr
/etc/init.d/zabbix_server_ctl start
- frontends
mkdir /var/www/html/zabbix
cp -a frontend/php/* /var/www/html/zabbix/
- PHP Parse errorがinclude/copt.lib.phpで出たら、[static function]を[function]に書き換える
- http://${SERVER_NAME}/zabbix/setup.php にアクセス
- PHP max execution timeがNGになっていたら、/etc/php.iniを書き換える
max_execution_time = 300
- 手順通りに進める。zabbix.conf.phpをダウンロードして、zabbix/confにアップロード(なんか面倒・・・)
- 最終的に http://${SERVER_NAME}/zabbix/index.php にアクセス
- ID:admin PW:なし でログインしちゃう
zabbix agent †
- build
tar zxvf zabbix-1.4.4.tar.gz
cd zabbix-1.4.4
./configure --enable-agent
make
su
make install
- zabbix user
groupadd zabbix
useradd -g <zabbixグループのgid> -s /sbin/nologin zabbix
- config file
su
mkdir /etc/zabbix
cp misc/conf/zabbix_agentd.conf /etc/zabbix/
- log/id files
mkdir /var/run/zabbix
mkdir /var/log/zabbix
chown zabbix:zabbix /var/run/zabbix
chown zabbix:zabbix /var/log/zabbix
- init script
cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/
- change script
# base zabbix dir
BASEDIR=/usr/local
# pid file (as of 1.0 beta 10)
PIDFILE=/var/run/zabbix/zabbix_agentd.pid
# binary file
ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd
- start zabbix agent
/etc/init.d/zabbix_agentd_ctl start
- rc symlink
cd /etc/rc.d/rc0.d
ln -s ../init.d/zabbix_agentd K20zabbix-agentd
cd /etc/rc.d/rc1.d
ln -s ../init.d/zabbix_agentd K20zabbix-agentd
cd /etc/rc.d/rc2.d
ln -s ../init.d/zabbix_agentd S20zabbix-agentd
cd /etc/rc.d/rc3.d
ln -s ../init.d/zabbix_agentd S20zabbix-agentd
cd /etc/rc.d/rc4.d
ln -s ../init.d/zabbix_agentd S20zabbix-agentd
cd /etc/rc.d/rc5.d
ln -s ../init.d/zabbix_agentd S20zabbix-agentd
cd /etc/rc.d/rc6.d
ln -s ../init.d/zabbix_agentd K20zabbix-agentd
apt-getでインストール †
sudo apt-get install zabbix-server-mysql
sudo apt-get install zabbix-frontend-php
ubuntuのメモ †
- 追加パッケージ
mysql-server
mysql-client
apache2
php5
gcc
ntp
dbconfig-common
fping
libiksemel3
libopenipmi0
libsnmp15
snmpd
snmp
libmysqlclient-dev
libdbd-mysql
libmysql-cil-dev
libsnmp-dev
php-date
php5-gd
php5-mysql
otf-ipafont
ttf-monapo
- configure
./configure --enable-server --with-mysql --with-net-snmp
- font
sudo ln -s /usr/share/fonts/opentype/ipafont/ipag.otf ipag.ttf
- defines.inc.php
sudo vim /var/www/zabbix/include/defines.inc.php
define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans'); →define('ZBX_GRAPH_FONT_NAME', 'ipag');
Windwos用エージェントのインストール †
- Windows版のバイナリは、ZABBIXのソースコードに32bit版、64bit版のバイナリが含まれています。
zabbix_dir/bin/Win32 # 32bit版
zabbix_dir/bin/Win64 # 64bit版
- confファイル
misc/conf/zabbix_agentd.conf
- バイナリとconfファイルをWindowsの任意の場所へコピーする
- confファイルを書き換える(IPアドレス、ホスト名、ポート番号等)
- サービス登録
zabbix_agentd.exe -i --config <confファイルのフルパス>
- サービス削除
zabbix_agentd.exe -d --config <confファイルのフルパス>
iptables †
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT
Linux Disk System †
- zabbix_agentd
UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'
UserParameter=custom.vfs.dev.read.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$7}'
UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$8}'
UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$11}'
UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$12}'
UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$13}'
UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$6}'
UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$10}'