Zabbix on OpenBSD

Installing and using the monitoring tool Zabbix on OpenBSD is quite simple. Take just these steps to get started.

Step 1: Install a few packages.

Use pkg_add to add these packages: (Versions could change over time.)

curl-7.19.3
gettext-0.17p0
jpeg-6bp3
libiconv-1.12
libidn-1.11
libxml-2.6.32p2
net-snmp-5.4.2.1p1
php5-core-5.2.8p0
php5-gd-5.2.8-no_x11
php5-pgsql-5.2.8
png-1.2.33
postgresql-client-8.3.6
postgresql-server-8.3.6
t1lib-5.1.0p1

Follow all hints the package manager tells you.

Step 2: Configure some items.

Make sure the apache daemons is started at boot time. (/etc/rc.conf.local)

Modify PHP to allow longer execution times and set the timezone:

$ grep max_execution_time /var/www/conf/php.ini
max_execution_time = 300
$ grep date.timezone /var/www/conf/php.ini
date.timezone = Europe/Amsterdam
$ sudo pkill httpd
$ sudo /usr/sbin/httpd

Step 3: Compile and install Zabbix.

Get the latest release of Zabbix, untar it and use these options to configure it:

./configure --enable-server --with-pgsql --with-net-snmp --with-libcurl --enable-agent

Use "make install" to install all items. The binaries will be placed in /usr/local.

Import database schemes as described in the Zabbix documentation, chapter 2.4.3: "Zabbix Server"

Create /etc/zabbix/zabbix_agentd.conf and /etc/zabbix/zabbix_server.conf by copying them from the untarred zabbix release:

# mkdir /etc/zabbix
# cp zabbix-1.6.5/misc/conf/zabbix_agentd.conf /etc/zabbix
# cp zabbix-1.6.5/misc/conf/zabbix_server.conf /etc/zabbix

Set DBName DBUser and DBPassword in /etc/zabbix/zabbix_server.conf.

Step 4: Automatically start Zabbix items.

$ cat /etc/rc.local
#       $OpenBSD: rc.local,v 1.39 2006/07/28 20:19:46 sturm Exp $

# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode.  For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.

echo -n 'starting local daemons:'

# Add your local startup actions here.

if [ -x /usr/local/sbin/zabbix_agentd ] ; then
echo -n ' zabbix_agentd'
/usr/local/sbin/zabbix_agentd
fi

if [ -x /usr/local/sbin/zabbix_server ] ; then
echo -n ' zabbix_server'
/usr/local/sbin/zabbix_server
fi

echo '.'

Step 5: Install the webfrontend.

You are practically done, now copy the php files and visit your zabbix installation:

# cp -Rip zabbix-1.6.5/frontends/php/* /var/www/htdocs/zabbix/

That's it, not extremely difficult!

Comments

Indeed, it's easy and simple

Indeed, it's easy and simple to use. And this is just very useful. - Mark Zokle

i'm wondering if you've

i'm wondering if you've followed along and tried to compile zabbix 2.0.2 on openbsd 5.1/amd64? i'm getting errors during make install. if it helps here are the steps i followed and the resultant errors:

sudo pkg_add curl gettext jpeg libiconv libidn libxml net-snmp php-5.3.10 php-gd-5.3.10 php-pgsql-5.3.10 png postgresql-client postgresql-server
sudo ln -s /var/www/conf/modules.sample/php-5.3.conf /var/www/conf/modules
sudo ln -fs /etc/php-5.3.sample/gd.ini /etc/php-5.3/gd.ini
sudo ln -fs /etc/php-5.3.sample/pgsql.ini /etc/php-5.3/pgsql.ini

sudo vi /etc/rc.conf.local
* add
httpd_flags="-u"

sudo vi /etc/php-5.3.ini
* replace
max_execution_time = 30
* with
max_execution_time = 300
* and
;date.timezone =
* with
date.timezone = US/Eastern

tar xf zabbix-2.0.2.tar
rm zabbix-2.0.2.tar
cd zabbix-2.0.2
./configure --enable-server --with-postgresql --with-net-snmp --with-libcurl --enable-agent
sudo make install
...
gcc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -O2 -I/usr/local/include/postgresql -I/usr/local/include -I/usr/libdata/perl5/amd64-openbsd/5.12.2/CORE -I. -I/usr/local/include -I/usr/local/include -MT libspecsysinfo_a-proc.o -MD -MP -MF .deps/libspecsysinfo_a-proc.Tpo -c -o libspecsysinfo_a-proc.o `test -f 'proc.c' || echo './'`proc.c
proc.c: In function 'PROC_MEM':
proc.c:227: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:232: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:244: error: 'struct kinfo_proc' has no member named 'kp_eproc'
proc.c:245: error: 'struct kinfo_proc' has no member named 'kp_eproc'
proc.c:246: error: 'struct kinfo_proc' has no member named 'kp_eproc'
proc.c: In function 'PROC_NUM':
proc.c:395: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:399: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:399: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:400: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:401: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:401: error: 'struct kinfo_proc' has no member named 'kp_proc'
proc.c:405: error: 'struct kinfo_proc' has no member named 'kp_proc'
*** Error code 1

Stop in /home/admin/zabbix-2.0.2/src/libs/zbxsysinfo/openbsd (line 458 of Makefile).
*** Error code 1

Stop in /home/admin/zabbix-2.0.2/src/libs/zbxsysinfo (line 490 of Makefile).
*** Error code 1

Stop in /home/admin/zabbix-2.0.2/src/libs (line 387 of Makefile).
*** Error code 1

Stop in /home/admin/zabbix-2.0.2/src (line 369 of Makefile).
*** Error code 1

Stop in /home/admin/zabbix-2.0.2 (line 383 of Makefile).

Hello, I have the same

Hello,

I have the same problem, with the same error messages like above.
Is there any workaround / fix for this?

Thx: Jeefoo

I would guess this is a bug,

I would guess this is a bug, so it needs to be filed as a bug to the Zabbix developers. This can be done here.

Hi, I've been escalated the

Hi,

I've been escalated the problem, you can find it under this link:

https://support.zabbix.com/browse/ZBX-5614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#issue-tabs

Thanks for your help,

cheers: Jeefoo

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning [email protected]