Hello Zabbix users,
I like to use the stable releases for my servers. I also like to use software packages for easy administration and maintenance. As you probably know, finding packages for the latest and greatest(?) on the old stable releases can be a bit problematic at times.
Here's how I backported the Zabbix 1.4.4 packages from Debian Lenny to Ubuntu 6.06 LTS (Dapper Drake).
I use these packages myself and they are working just fine (so far).
This was created on my Ubuntu 7.10 (Gutsy Gibbon) workstation. Other versions of Ubuntu might work with some modifications.
If you want to follow along step by step, boot up a Gutsy box, workstation or server.
-- Install prevu --
Set up a Dapper build environment for prevu.
-- Download the Zabbix source --
I downloaded the Zabbix source package from Debian Lenny.
-- Unpack the source --
-- Edit the control file --
Edit the file 'control' and change the build-dep libcurl4-gnutls-dev to libcurl3-gnutls-dev
-- Fix the init.d scripts --
Ubuntu uses a tmpfs for /var/run so we need to edit the start scripts a bit.
Edit this file:
zabbix-agent.init
Insert this piece of code just before the 'case "$1" in' row.
Then just after the row 'echo "Starting $DESC: $NAME"' add 'create_dir_in_var_run' like this:
Now change BOTH the following files in the same way.
zabbix-server-mysql.zabbix-server.init
zabbix-server-pgsql.zabbix-server.init
Here's a ready block for the lazy ones.
Then again... just after the row 'echo "Starting $DESC: $NAME"' add 'create_dir_in_var_run' like this:
I'm sure you didn't forget to edit both files, so let's move on.
-- Build a new source package --
-- Backport to Dapper --
Now run prevu on the new source package.
-- Backport the dbconfig-common package --
Let's satisfy the dbconfig-common (>= 1.8.19) package dependency. The one in Gutsy will do just fine.
-- Almost done! --
Copy *.deb to your Dapper box.
-- Installing the packages on your Dapper box --
UNcomment the universe sources in your /etc/apt/sources.list and run sudo apt-get update
Now install the packages you want on this machine. The server packages depend on the dbconfig-common package so you want to start with that one.
Do the same for the any other package you wish to install... like the mysq-server or the pgsql-server or maybe just the agent.
If you get any dependency problems here just apt-get (-f) install the missing packages.
Follow the on screen instructions and you're done!
I'm sure there are ways to cut corners here and there, especially in the script editing. Feel free to share!
// jml
I like to use the stable releases for my servers. I also like to use software packages for easy administration and maintenance. As you probably know, finding packages for the latest and greatest(?) on the old stable releases can be a bit problematic at times.
Here's how I backported the Zabbix 1.4.4 packages from Debian Lenny to Ubuntu 6.06 LTS (Dapper Drake).
I use these packages myself and they are working just fine (so far).
This was created on my Ubuntu 7.10 (Gutsy Gibbon) workstation. Other versions of Ubuntu might work with some modifications.
If you want to follow along step by step, boot up a Gutsy box, workstation or server.
-- Install prevu --
Code:
sudo apt-get install prevu
Code:
DIST=dapper sudo prevu-init
-- Download the Zabbix source --
I downloaded the Zabbix source package from Debian Lenny.
Code:
mkdir ~/tmpdir cd ~/tmpdir wget http://ftp.de.debian.org/debian/pool/main/z/zabbix/zabbix_1.4.4-2.dsc wget http://ftp.de.debian.org/debian/pool/main/z/zabbix/zabbix_1.4.4.orig.tar.gz wget http://ftp.de.debian.org/debian/pool/main/z/zabbix/zabbix_1.4.4-2.diff.gz
-- Unpack the source --
Code:
dpkg-source -x zabbix_1.4.4-2.dsc
-- Edit the control file --
Code:
cd ~/tmpdir/zabbix-1.4.4/debian
-- Fix the init.d scripts --
Ubuntu uses a tmpfs for /var/run so we need to edit the start scripts a bit.
Code:
cd ~/tmpdir/zabbix-1.4.4/misc/init.d/debian
zabbix-agent.init
Insert this piece of code just before the 'case "$1" in' row.
Code:
create_dir_in_var_run() {
# Create the /var/run/zabbix-agent dir
if [ ! -d /var/run/zabbix-agent ]; then
mkdir /var/run/zabbix-agent
chown zabbix:zabbix /var/run/zabbix-agent
fi
}
Code:
case "$1" in
start)
rm -f $PID
echo "Starting $DESC: $NAME"
create_dir_in_var_run
start-stop-daemon --oknodo --start --pidfile $PID \
zabbix-server-mysql.zabbix-server.init
zabbix-server-pgsql.zabbix-server.init
Here's a ready block for the lazy ones.
Code:
create_dir_in_var_run() {
# Create the /var/run/zabbix-server dir
if [ ! -d /var/run/zabbix-server ]; then
mkdir /var/run/zabbix-server
chown zabbix:zabbix /var/run/zabbix-server
fi
}
Code:
case "$1" in
start)
rm -f $PID
echo "Starting $DESC: $NAME"
create_dir_in_var_run
start-stop-daemon --oknodo --start --pidfile $PID \
-- Build a new source package --
Code:
cd ~/tmpdir/zabbix-1.4.4 debuild-pbuilder -us -uc -S
-- Backport to Dapper --
Now run prevu on the new source package.
Code:
cd ~/tmpdir DIST=dapper sudo prevu zabbix_1.4.4-2.dsc
-- Backport the dbconfig-common package --
Let's satisfy the dbconfig-common (>= 1.8.19) package dependency. The one in Gutsy will do just fine.
Code:
DIST=dapper sudo prevu dbconfig-common
-- Almost done! --
Code:
cd /var/cache/prevu/dapper-debs/
-- Installing the packages on your Dapper box --
UNcomment the universe sources in your /etc/apt/sources.list and run sudo apt-get update
Now install the packages you want on this machine. The server packages depend on the dbconfig-common package so you want to start with that one.
Code:
sudo dpkg -i dbconfig-common_1.8.35~6.06prevu1_all.deb
If you get any dependency problems here just apt-get (-f) install the missing packages.
Follow the on screen instructions and you're done!

I'm sure there are ways to cut corners here and there, especially in the script editing. Feel free to share!
// jml
Comment