CentOS and Zabbix

9 03 2010

[Edit] It has been pointed out to me that this post no longer is working 100%. I have pointed out the errors in the latest post found Here. It should just be a quick edit of the spec file.

I am not shy about the fact that I am a Debian guy. However, the support I have been getting from the CentOS world lately has been absolutely phenomenal. Documentation has been pretty solid and the help from the community has been very supportive. Top that with how robust all the CentOS servers I have worked with over the last few years have been and I am beginning to see why so many people prefer to run this distro. I am not quite to the point of running it on everything, but I DID setup a CentOS box at home for me to play around on. If you don’t think that is a big deal then you don’t understand that it has been years since a non-Debian based distro has graced my home (outside of the occasional testbed and/or virtual machine). Smoothwall was the last non-Debian system and as posted earlier we had a bit of a fallout. So to me it is a big deal that I now have a CentOS system running as part of the ‘Official’ systems at my house.

Still not a huge fan of RPM’s though. I know, I know, It has been almost 7 years since that SUSE disaster, 4 since the big Fedora fiasco, almost 3 since I was able to _kill_ the last Mandrake box I was forced to work on ( the death of that box still gives me happy thoughts ) and it has been a couple of years since that Smoothwall disaster (grr…still get pissed at that one) but I still have a bit of loathing against RPM’s. That and Debian has been very good to me over the years; it always treats me very well (except for Sid because he is a little b***h sometimes)….Anyway, back to the point.

Today I had to update a ton of CentOS boxes to the latest (5.4). So I created my own local mirror to save time. It was actually really easy. First I found a rsync mirror from the CentOS mirrors website.
rsync -avrt mirror /var/www/html/centos/
ln -s /var/www/html/centos/5.4 /var/www/html/centos/5
createrepo /var/www/html/centos/5/
service httpd start

Then checked that the apache server worked by going to http://server/centos.
Then I had to edit /etc/yum.repos.d/CentOS-Base.repo and I replaced “http://mirrorlist.centos.org” with the servers http accessible name. I also had to edit /etc/yum/pluginconf.d/fastestmirror.conf and change enabled=0. That fast mirror plugin would skip my local mirror in the tests and wouldn’t use it. After the edit I was getting GB speeds off the local network and I wasn’t having to hit the main mirrors for all the same updates over and over again. If my upload wasn’t such crap I would open it up for others, but sadly I don’t have those kind of u/l speeds.

Now that I am now taking care of them I wanted to add them to the Zabbix system I had already built for my Debian boxes. The only problem was that my options were either the .deb files I had built for Debian based distros or I could compile everything from source again. Armed with my new knowledge from building out kernel RPM’s I chose a third route. To create my own spec file for Zabbix and do it the rpmbuild way! That quickly turned for the worse…so I went to Google and begged and pleaded for assistance.

Thanks to Andrew Farley I now have a Zabbix.spec file to work with to compile my own rpms! It was literally as simple as downloading the files and compiling. Here are the steps I used:
cd ~/rpmbuild/SOURCES/
wget -c (find latest download link here: http://www.zabbix.com/download.php)
cd ~/rpmbuild/SPECS
wget -c http://repo.andrewfarley.com/centos/specs/zabbix.spec
rpmbuild -bp --target=`uname -m` zabbix.spec
rpmbuild -bb --target=`uname -m` zabbix.spec

Thats it!

Thanks a WHOLE lot to the CentOS team for helping this Debian guy out!
Thanks a WHOLE lot for the spec file Andrew Farley!

And of course Debian and Zabbix are still Awesome! 😀
[Edit] When you install you will need a few packages. Here are the packages and where to get them.
net-snmp-devel : CentOS Base repo
iksemel-devel : http://dag.wieers.com/rpm/FAQ.php#B
php 5.2 : http://wiki.centos.org/HowTos/PHP_5.1_To_5.2




4 responses

24 04 2010
Bilgisayar Teknik Servis

was a nice sharing thanks

17 06 2010

awsome..ur articles is cool.
thx gan

22 04 2011

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)

26 04 2011

Hrmm. Seems that there may be a few issues with the latest Zabbix. I will try to test and update the post if I can fix it. Thanks for letting me know.

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

%d bloggers like this: