ZABBIX
======
http://www.zabbix.com [^]
This is an open source and seems quite good.
It is available through Debian Repository as packages:
zabbix-frontend-php (for central monitoring host) installed in monitoring server
zabbix-server-mysql (for central monitoring host) installed in monitoring server
zabbix-agent (for each monitored host) Installed in ALL 8 Hosts
The mysql data:
DB: zabbix
user: zabbix
PW: see logins document
Zabbix Admin login:
First is WEB auth then Zabbix login
Name: admin
PW: see logins document
The zabbix-agent is a daemon that runs in all of the monitored
hosts and watches the port 10050. It also connects directly to the main server
through the port 10051. The following configuration entries need to be changed
or checked for the zabbix-agent to work well:
File: /etc/zabbix/zabbix_agent.conf
Server=192.168.0.200
File: /etc/zabbix/zabbix_agentd.conf
Server=192.168.0.200
EnableRemoteCommands=1
The zabbix-agent is a system-V service controlled by commands:
/etc/init.d/zabbix-agentd {start|stop|restart}
CONFIGURATION of main monitoring server:
========================================
Basic monitoring configuration is already done on all servers but no
‘actions response to events’ are programmed yet.
I installed the full monitoring solution as Debian packages on monitoring server:
zabbix-frontend-php (for central monitoring host)
zabbix-server-mysql (for central monitoring host)
zabbix-agent (for each monitored host)
Current stable Debian installed version on all the machines:
1.1.4-10etch1
INSTALLATION:
=============
I had trouble during the creation of the database with SQL syntax problem.
The problem is that some comments in the SQL file were not properly made written
which were:
–comment
The allowed format is:
— comment
So I had to:
– Bypass the automatic creation and data filling of the zabbix database during
the Debian package installation of zabbix-server-mysql package.
– Edit and correct the comments in the SQL files:
/usr/share/zabbix-server/data.sql
/usr/share/zabbix-server/schema.sql
– Create and load the Zabbix DB by hand using the commands:
cd /usr/share/zabbix-server/
mysql -u root -p zabbix < data.sql
mysql -u root -p zabbix < schema.sql
- Open the database:zabbix & table:users using phpMyAdmin and change the login
name and password of user Admin to:
Name: admin
PW type: MD5
PW: see logins file
NOTE: After experiencing huge CPU loads and many query timouts,
I tweaked the INNODB writing performance in my.cnf as follows:
(It made a huge difference in performance)
--------------------------------------
innodb_file_per_table
innodb_buffer_pool_size=1000M
innodb_log_buffer_size=16M
innodb_support_xa=0
innodb_flush_log_at_trx_commit=0
innodb_checksums=0
innodb_doublewrite=0
---------------------------------------
To clean-up dead data from INNODB :
mysql zabbix -u root -p
—————————————————————————
DELETE history_str.* FROM history_str LEFT OUTER JOIN items ON history_str.itemid = items.itemid WHERE items.itemid IS NULL;
DELETE history_uint.* FROM history_uint LEFT OUTER JOIN items ON history_uint.itemid = items.itemid WHERE items.itemid IS NULL;
DELETE history_str_sync.* FROM history_str_sync LEFT OUTER JOIN items ON history_str_sync.itemid = items.itemid WHERE items.itemid IS NULL;
DELETE history_sync.* FROM history_sync LEFT OUTER JOIN items ON history_sync.itemid = items.itemid WHERE items.itemid IS NULL;
DELETE history_log.* FROM history_log LEFT OUTER JOIN items ON history_log.itemid = items.itemid WHERE items.itemid IS NULL;
DELETE history.* FROM history LEFT OUTER JOIN items ON history.itemid = items.itemid WHERE items.itemid IS NULL;
DELETE trends.* FROM trends LEFT OUTER JOIN items ON trends.itemid = items.itemid WHERE items.itemid IS NULL;
—————————————————————————
=========================== COMPILING ZABBIX ON DEBIAN ======================
————————————————— LENNY ——————————————————————-
Debian: Packages:
apt-get install libmysqlclient15-dev libmysql++-dev liblua5.1-sql-mysql-dev libiksemel-dev libiksemel-utils libiksemel3 liblua5.1-curl-dev libcurl4-dev libghttp-dev libgnutls-dev libsnmp-dev g++ cpp make autoconf
libmysqlclient15-dev
libmysql++-dev
liblua5.1-sql-mysql-dev
libiksemel-dev
libiksemel-utils
libiksemel3
liblua5.1-curl-dev
libcurl4-openssl-dev
libghttp-dev
libgnutls-dev
libsnmp-dev
g++
cpp
make
autoconf
With local library dependancy (requires more dev packages
(I could not compile this way under Lenny so far)
./configure --enable-server --enable-static --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-jabber
With local library dependancies
./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-jabber
make install
Add to /etc/services
=================
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
zabbix-trapper 10051/tcp Zabbix Trapper
zabbix-trapper 10051/udp Zabbix Trapper
Copy start/stop scripts
misc/init.d/debian/*
–> /etc/init.d/
Modify /etc/init.d/zabbix_agentd
as follows:
———————————————————–
NAME=zabbix_agentd
PATH=/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix agent daemon"
PID=/var/tmp/$NAME.pid
———————————————————–
Modify /etc/init.d/zabbix_server
as follows:
———————————————————–
NAME=zabbix_server
PATH=/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix server daemon"
PID=/var/tmp/$NAME.pid
———————————————————–
Copy config files as follows:
mkdir /etc/zabbix/
misc/conf/* --> /etc/zabbix/
Modify config files as needed.
– change the server IP in zabbix_agentd.conf
– Change DBName, DBUser, DBPassword
– Leave the log files to /tmp or /var/tmp othewise the daemon
will not have the rights to write it.
Copy recursively WEB interface in desired place:
frontends/php/*
-> /www/zabbix/
Start the zabbix_server and Zabbix_agent
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start
Using the Browser enter the URL that leads to zabbix iweb interface
and follow the instructions to prepare the final check and set-up.
——————————————————————————————————————-
———————————————- ETCH ————————————————————–
——————————————————————————————————————-
apt-get install libmysqlclient15-dev libmysql++-dev liblua5.1-sql-mysql-dev libiksemel-dev libiksemel-utils libiksemel3 liblua5.1-curl-dev libcurl3-dev libghttp-dev libgnutls-dev libsnmp9-dev g++ cpp make autoconf
Configure the makefile for compilation
Including the Agentd
—————————-
./configure --enable-server --enable-static --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-jabber
EXcluding the Agentd
—————————-
./configure --enable-server --enable-static --with-mysql --with-net-snmp --with-libcurl --with-jabber
With local library dependancy (requires more dev packages
(I could not compile this way under ETCH so far)
./configure --enable-server --enable-static --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-jabber
With local library dependancies
./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-jabber
make install
The new zabbix_agentd, zabbix_agent and zabbix_server binaries will be then installed in:
/usr/local/sbin/
To compile only the agent:
./configure --enable-agent
make install
it will compile and be installed in /usr/local/sbin/
You can copy misc/init.d/debian/zabbix-agent –> /etc/init.d/
Add to /etc/services
=================
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
zabbix-trapper 10051/tcp Zabbix Trapper
zabbix-trapper 10051/udp Zabbix Trapper
Copy start/stop scripts
misc/init.d/debian/* --> /etc/init.d/
Modify /etc/init.d/zabbix_agentd as follows:
———————————————————–
NAME=zabbix_agentd
PATH=/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix agent daemon"
PID=/var/tmp/$NAME.pid
———————————————————–
Modify /etc/init.d/zabbix_server as follows:
———————————————————–
NAME=zabbix_server
PATH=/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix server daemon"
PID=/var/tmp/$NAME.pid
———————————————————–
Copy config files as follows:
mkdir /etc/zabbix/
misc/conf/* --> /etc/zabbix/
Modify config files as needed.
– change the server IP in zabbix_agentd.conf
– Change DBName, DBUser, DBPassword
– Leave the log files to /tmp or /var/tmp othewise the daemon
will not have the rights to write it.
Copy recursively WEB interface in desired place:
frontends/php/* -> /www/zabbix/
Start the zabbix_server and Zabbix_agent
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start
Using the Browser enter the URL that leads to zabbix iweb interface
and follow the instructions to prepare the final check and set-up.
You might have to change the following entries in /etc/php5/apache2/php.ini
date.timezone = Europe/Berlin
max_execution_time = 300