contributers
quick links
Zabbix on FreeBSD
Posted 9:26:00 PM on Wed, 15th July 2009 by Dj-ZoRt! Image #29

Its pretty straight forward to get Zabbix running on FreeBSD. Its worth noting that after install i wasnt all that impressed with zabbix so I continued my question for a monitoring platform. In any case there isnt any documentation on how to do a FreeBSD Zabbix install via ports.

Start off with going to ports and installing it

cd /usr/ports/net-mgmt/zabbix
make && make install


Then create the zabbix mysql database and users (note the user here is zabbix, password is z4bb1x.

echo "create database zabbix" | mysql
echo "grant all privileges on zabbix.* to zabbix@localhost identified by z4bb1x' | mysql
mysql < etc


Edit the zabbix_server.conf file as needed...

[root@batou /usr/local/etc/zabbix]# vi zabbix_server.conf

Enable the zabbix service in rc.conf

vi /etc/rc.conf

# zabbix
zabbix_server_enable="YES"

Start up zabbix

/usr/local/etc/rc.d/zabbix_server start

Configure apache for zabbix

[root@batou /usr/local/etc/apache22/Includes]# vi zabbix.conf

Alias /zabbix "/usr/local/share/zabbix/php"


    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all


Edit the zabbix web interface config...


[root@batou /usr/local/share/zabbix/php/conf]# cat zabbix.conf.php
/*
** ZABBIX
** Copyright (C) 2000-2005 SIA Zabbix
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/

global $DB;

$DB["TYPE"]             = "MYSQL";
$DB["SERVER"]           = "localhost";
$DB["PORT"]             = "0";
$DB["DATABASE"]         = "zabbix";
$DB["USER"]             = "zabbix";
$DB["PASSWORD"]         = "z4bb1x";
$ZBX_SERVER             = "localhost";
$ZBX_SERVER_PORT        = "10051";


$IMAGE_FORMAT_DEFAULT   = IMAGE_FORMAT_PNG;

?>


Make some changes to the php.ini file, you will need to tailor some of these to your region.

vi /usr/local/etc/php.ini


[Date]
; Defines the default timezone used by the date functions
date.timezone = Australia/Sydney

Restart apache

/usr/local/etc/rc.d/apache22 restart

Log in to the zabbix www server with user 'Admin' and password 'zabbix'

http://yourserver/zabbix/


Thats it.

comments

Alias /zabbix "/usr/local/share/zabbix/php" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all isn't quite right as it causes apache to error out claiming that stuff isn't allowed here. Also, there's some issues with Zabbix' website running due to permission issues. I'm working on your post as a starting point and making some changes to get it to work in the real world.

Posted by HiltonT

yes that code snippet is incorrect if interpreted as something that should be cut and paste. this post was largely just a 2 minute job based on my installation notes. The Options pragma obviously belongs in a Directory subsection, one which would be for /usr/local/share/zabbix/php/. Also for a production system you would want to not "allow all" Anyway i wasnt very unimpressed by zabbix and have since settled on torrus. Although not all that well known of popular, it has excellent features and its very well written perl. Perfect for a company whos primary language is perl :)

Posted by djzort
post a new comment

Alias/Name
Email/Website
Validate
Comment
Rating 0 0.5 1 1.5 2 2.5 3 3.5 4