SL6 and Zabbix 1.8.5

9 05 2011

Someone pointed out to me that my post on compiling Zabbix on CentOS no longer works. Well to be honest, I have switched my CentOS systems to Scientific Linux 6 for a plethora of reasons (Short Story: a lot of the scientific packages we use at work are now being tested on SL6 by the various development groups where they are left up to the community on CentOS. So we jumped to SL6).

Nevertheless, I didn’t want to have bad information posted on my blog so I decided to update.

If you try to use my old post for compiling on SL6 or CentOS you end up with an error message like reader mailo got:
make[2]: Nothing to be done for `install-exec-am’.
make[2]: Nothing to be done for `install-data-am’.
make[2]: Leaving directory `/usr/src/redhat/BUILD/zabbix-1.8.5′
make[1]: Leaving directory `/usr/src/redhat/BUILD/zabbix-1.8.5′
+ install misc/conf/zabbix_agent.conf misc/conf/zabbix_agentd misc/conf/zabbix_agentd.conf misc/conf/zabbix_agentd.win.conf misc/conf/zabbix_server.conf misc/conf/zabbix_proxy.conf /var/tmp/zabbix-1.8.5-root/etc/zabbix
install: omitting directory `misc/conf/zabbix_agentd’
error: Bad exit status from /var/tmp/rpm-tmp.54232 (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.54232 (%install)

This is due to a new directory structure in misc/conf/zabbix_agentd. Lennart at Andrew Farley’s blog caught the fix.

Here are the steps to compile now.
1) Download the zabbix spec file into ~/rpmbuild/SPECS/

2) Edit the spec file
2a) Change line 6 from “Version: 1.8.3″ to “Version: 1.8.5″
2b) Change line 382 from “install misc/conf/zabbix_{a*,s*,p*} $RPM_BUILD_ROOT%{_sysconfdir}” to “install misc/conf/zabbix_{a*,s*,p*}.conf* $RPM_BUILD_ROOT%{_sysconfdir}”

3) Download Zabbix 1.8.5 from zabbix.com into ~/rpmbuild/SOURCES/

4) Download the patch file into ~/rpmbuild/SOURCES/

5) Build your RPMS!

So all together on the command line:
$ cd ~/rpmbuild/SPECS/
$ wget http://repo.andrewfarley.com/centos/specs/zabbix.spec
$ sed -e 's/1.8.3/1.8.5/' -i zabbix.spec
$ sed -e 's/p\*\}\ /p\*\}.conf\*\ /' -i zabbix.spec
$ cd ~/rpmbuild/SOURCES/
$ wget http://repo.andrewfarley.com/centos/specs/zabbix-centos-log-and-pid-paths.patch
$ wget (find download link from here)
$ cd ~/rpmbuild/SPECS/
$ rpmbuild -bb --target=`uname -m` zabbix.spec

That should be it! So far this is working for me. If I come across any other issues I will fix them here.

Once again, major props to Andrew. And props to Lennart for the fix.

[EDIT] Eric G built RPMs for 1.8.5 and 1.9.3 below in the comments. If you just want to install the RPMs instead of building from source you should be able to use his repo. Thanks Eric G!

About these ads

Actions

Information

4 responses

10 05 2011
Eric G

Using your fix for the spec file I’m building Zabbix 1.9.2 over on the OpenSUSE buildservice for CentOS and RHEL… thanks!

If this works I’ll build Zabbix 1.8.5 packages as well… looks like http://andrewfarley.com/ ‘s site is still back at Zabbix 1.8.1

If all goes well both versions will be available here:
http://download.opensuse.org/repositories/home:/ericgearhart:/zabbix/

11 05 2011
~Stack~

Nice! Thanks!

I guess this is my push into finally giving the 1.9.x series a test run.

Glad things are working out for you.

12 05 2011
Eric G

OK Zabbix 1.8.5 and 1.9.3 both built successfully. I split off the 1.9.3 version into its own project, zabbix-beta, and I installed the 1.9.3 RPMs last night into a VM. I’ve at least got my Zabbix server monitoring itself :)

http://download.opensuse.org/repositories/home:/ericgearhart:/zabbix-beta/ is where the 1.9.3 RPMs are at if you’re interested… thanks for that tip, I would have been screwing around with the spec for who knows how long trying to figure out what files were causing the build to bomb out

6 04 2012
ninjix

Thanks! Your tip helped me get an RPM built for Zabbix on Amazon’s Linux AMI.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: