ODT Export
 

Zabbix Proxy on Debian using sqlite

Verified to work with

  • Debian Lenny 5.01 and Zabbix 1.6.5 on September 3, 2009.
  • Debian 4.0r4 with Zabbix version 1.6 on October 9, 2008.

This is a super light weight way to get a zabbix proxy up and running without the overhead of running a mysql database. sqlite is basically an entire database that lives inside of a single file. The 1.6 docs say that zabbix will create a database if none exists. This is only true for sqlite.

I recommend downloading the sources for the latest 1.6.x and using those instead. It shouldn't change any of these steps except for 1.6 ⇒ 1.6.x.

1 - Install pre-requisites: Net-Snmp libraries, Curl libraries, SQLite, fping.

apt-get install build-essential snmp libsnmp9-dev snmpd libcurl3-dev fping curl sqlite libsqlite3-dev ntpdate

If you aren’t going to be using Web Monitoring, you can exclude libcurl3-dev from above.

Log into your server as root.

2 - Make the zabbix user and group:

adduser zabbix
enter in new password
confirm

use the remaining defaults. Add zabbix to the admin group:

adduser zabbix adm

3 - Download and Untar the sources:

su - zabbix
cd ~
wget http://optusnet.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.6.tar.gz
tar zxvpf zabbix-1.6.tar.gz

You might want to confirm that this is actually the latest version. You might also want to find a mirror closer to you by going to http://sourceforge.net/project/showfiles.php?group_id=23494.

4 - Configure, compile and install the server:

cd zabbix-1.6/
./configure --prefix=/usr --enable-proxy --enable-agent --with-sqlite3 --with-net-snmp --with-libcurl && make
su
make install

5 - Prepare the rest of the system:

nano /etc/services

Add at the end:

zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp

Save and exit.

6- Create the configuration directories and copy the default files in

mkdir /etc/zabbix
chown -R zabbix.zabbix /etc/zabbix/
cp misc/conf/zabbix_proxy.conf /etc/zabbix/
cp misc/conf/zabbix_agentd.conf /etc/zabbix/

Edit the agent's configuration:

nano /etc/zabbix/zabbix_agentd.conf

Make sure that the Server parameter points to the proxy's address. use the REAL IP, not loopback for this.

Server=127.0.0.1

Save and exit. Edit /etc/zabbix/zabbix_proxy.conf:

nano /etc/zabbix/zabbix_proxy.conf

For small sites, most the parameters will work fine. Iif you are into tweaking your config for your 10+ hosts, you may want to use mysql instead of sqlite, and/or edit these parameters. Change the caps parameters:

# IP address (or hostname) of ZABBIX servers.
Server=MASTER_ZABBIX_SERVER_IP
# Database name
DBName=/home/zabbix/zabbix.db
# Unique hostname.
Hostname=MACHINE_HOST_NAME

Save and exit.

7- make init.d startup scripts

Copy the init.d scripts to the right spot: (this uses the server’s init script. we rename it, and will modify it to start the proxy service instead.

cp misc/init.d/debian/zabbix-server /etc/init.d/zabbix-proxy
cp misc/init.d/debian/zabbix-agent /etc/init.d

You need to edit these script files as the compiled versions of the zabbix files is placed under /usr/sbin (/usr/bin in older versions). configure the proxy service script

nano /etc/init.d/zabbix-proxy

Make it look like this:

NAME=zabbix_proxy
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
DAEMON=/usr/sbin/${NAME}
DESC="Zabbix proxy daemon"
PID=/var/tmp/$NAME.pid

Save and exit. now edit the agent startup script

nano /etc/init.d/zabbix-agent

Change this line:

DAEMON=/home/zabbix/bin/${NAME}

replace it with:

DAEMON=/usr/sbin/${NAME}  (old versions use /usr/bin/${NAME})

Save and exit. Now set the correct permissions and set ZABBIX to start when the machine boots:

chmod 755 /etc/init.d/zabbix-proxy
update-rc.d zabbix-proxy defaults
chmod 755 /etc/init.d/zabbix-agent
update-rc.d zabbix-agent defaults

8- Test it out.

Start the server :

/etc/init.d/zabbix-proxy start

Start the agent:

/etc/init.d/zabbix-agent start

Now check to make sure that they are running:

ps -aux | grep zabbix

You should see multiple instances of zabbix_proxy and zabbix_agentd running if everything has gone ok. If not, check /tmp/zabbix_proxy.log for errors. On your zabbix server, go to configuration-> Hosts. From the dropdown box in the upper-right corner, select “proxies”. then click the “create proxy” button. Use the same EXACLTY as you entered it in the “zabbix-proxy.conf” file.

 
howto/install/debian/zabbix_proxy_on_debian_sqlite.txt · Last modified: 2011/09/09 21:07 by surlyjake
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki