[вернуться назад]

Installing zabbix on SmartOS

26 июня, 2013

zabbixI chose server monitoring software not very long. Cancelled nagios for little functionality in free edition, did not consider Munin at all despite many Devops like it, tried to compile icinga (descendant of nagios) but failed…

At last I decided to install zabbix. I’ve heard about this package from guys who serve Skype’s and Ecwid’s servers. They use it and I think it is worth to try then.

Download latest version of zabbix to /opt/local/src:
shell> mkdir -p /opt/local/src; cd /opt/local/src
shell> wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.0.6/zabbix-2.0.6.tar.gz/download
shell> tar xzvf zabbix-2.0.6.tar.gz

Now you have to compile it. Do not forget to install gcc if it’s not installed:
shell> pkgin in gcc47

Then configure the package. You can configure it for the server and agent at the same time, but if you prefer compile only server or only agent it’s up to you:
shell> cd zabbix-2.0.6
shell> ./configure --prefix=opt/local --enable-server --enable-agent --withh-curl --with-iconv=/opt/local

If there are no errors do the final installation:
shell> make install

Hopefully compilation finished without errors and you could make small changes in configuration files (refer to zabbix site if needed):

1. Create special user and group:
shell> groupadd zabbix; useradd -g zabbix zabbix

2. Create database and load schema (we use mysql, if you use another database refer to zabbix site:
shell> cd /opt/local/src/zabbix-2.0.6
shell> mysql -u -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> quit;
shell> mysql -u -p zabbix < database/mysql/schema.sql
# stop here if you are creating database for Zabbix proxy
shell> mysql -u -p zabbix < database/mysql/images.sql
shell> mysql -u -p zabbix < database/mysql/data.sql

3. Edit config files:
We assume that zabbix server and zabbix agent are on the same virtual machine.
Then the configuration will be as follows:
3.1. /opt/local/etc/zabbix_agentd.conf

Leave other parameters default.

3.2. /opt/local/etc/zabbix_server.conf

Leave other parameters default.

4. Start daemons:
LD_LIBRARY_PATH=/opt/local/lib zabbix_server
LD_LIBRARY_PATH=/opt/local/lib zabbix_agentd

Environment variables required either here either during compilation (last preferred of course).
I’ve compiled without it and my installation does not recognize iconv library which is on the /opt/local/lib path. That’s why I use environment variable.

5. Now you have to copy zabbix frontend php files to your www docs directory
mkdir <htdocs>/zabbix
cd /opt/local/src/zabbix-2.0.6/frontends/php
cp -a . <htdocs>/zabbix

If your webserver has been set up with php and it is «looking» in your <htdocs> directory then you could contnue installation in your browser pointing it at name-or-address-of-your-server/zabbix.

Then you have to follow instructions on zabbix site.

The administration through the web interface is quite complex but you have to know that there are several helpers for Solaris hosts which seem to work on SmartOS well. Anything additiona you have to configure by hand.

In upcoming posts I will tell you how to setup Dtrace probes monitoring using zabbix.

Stay tuned!

Онлайн заявка

Отправляя данные этой формы, вы соглашаетесь с правилами обработки персональных данных