logIt Log Around The Clock

Compile Zabbix Proxy in Ubuntu ARM (BeagleBoard)

I needed to tackle practical limitation of SNMP monitoring under unreliable communication, a serious consideration was made for Zabbix Proxy. It was an option said to be ready for embedded hardware. I already had BeagleBoard xM Rev C running Ubuntu 11.10 Oneiric and needed to proof that it would port functionally to this Linux ARM board. There existed zabbix-proxy-mysql in Oneiric repository, but sqlite seemed to be a better scale option for embedded deployment.

zabbix-proxy-abstract-illustration.png

Zabbix Proxy Distributed NMS

An example set out for Zabbix Proxy on Debian appears to be pretty straightforward to follow. With the ARM board already installed with build-essential, snmp, and snmpd, the following needs to be added:

$ sudo apt-get install libsnmp-dev libcurl4-openssl-dev fping curl sqlite libsqlite3-dev ntpdate

then start the pre-compilation configure (in this case Zabbix 1.8.7 is used):

cd zabbix-1.8.7
./configure --enable-proxy --enable-agent --with-sqlite3 --with-net-snmp --with-libcurl

It will go smooth. However, during make there are complains about undefined references to ‘sqlite3_open‘, ‘sqlite3_close‘, etc.:

../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_connect':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:331: undefined reference to `sqlite3_open'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:343: undefined reference to `sqlite3_busy_timeout'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:334: undefined reference to `sqlite3_errmsg'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:335: undefined reference to `sqlite3_close'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_init':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:385: undefined reference to `sqlite3_open'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:387: undefined reference to `sqlite3_errmsg'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_close':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:446: undefined reference to `sqlite3_close'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_vexecute':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:827: undefined reference to `sqlite3_exec'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:852: undefined reference to `sqlite3_changes'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:833: undefined reference to `sqlite3_free'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `SQ_DBfree_result':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:1363: undefined reference to `sqlite3_free_table'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_vselect':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:1121: undefined reference to `sqlite3_get_table'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:1127: undefined reference to `sqlite3_free'

this is obviously from the database related code compilation. I run the gcc manually for the db.c file inside its directory by adding the flag ‘-lsqlite3‘ in the tail of ‘../../src/libs/zbxdb/libzbxdb.a‘ to make it work. Afterward by going to the initial directory first, running make again will then continue successfully.

$ cd src/zabbix_proxy
$ gcc -DZABBIX_DAEMON -g -O2     -L/usr/lib/arm-linux-gnueabi    -I/usr/local/include -I/usr/lib/perl/5.12/CORE -I. -I/usr/include      -I/usr/include -lsqlite3  -L/usr/lib/arm-linux-gnueabi -lcurl  -L/usr/lib -lnetsnmp -lcrypto  -L/usr/lib -lnetsnmp -lcrypto   -rdynamic    -o zabbix_proxy zabbix_proxy-servercomms.o zabbix_proxy-events.o zabbix_proxy-zlog.o zabbix_proxy-proxy.o heart/libzbxheart.a ../../src/zabbix_server/dbsyncer/libzbxdbsyncer.a ../../src/zabbix_server/discoverer/libzbxdiscoverer.a housekeeper/libzbxhousekeeper.a ../../src/zabbix_server/httppoller/libzbxhttppoller.a proxyconfig/libzbxproxyconfig.a ../../src/zabbix_server/pinger/libzbxpinger.a ../../src/zabbix_server/poller/libzbxpoller.a ../../src/zabbix_server/trapper/libzbxtrapper.a ../../src/zabbix_server/nodewatcher/libzbxnodewatcher.a datasender/libzbxdatasender.a ../../src/zabbix_server/selfmon/libzbxselfmon.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/linux/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a -lsqlite3 -lcurl  -lnetsnmp    -lm  -lresolv
$ cd ../../
$ make

Leave a Reply