FreeBSD Howto: Install Zabbix


This FreeBSD howto was written when I was asked to find a solution for monitoring applications, networks, and servers.  I decided on Zabbix, it allows to monitor multiple servers at a time, using a Zabbix server that comes with a web interface and Zabbix agents installed on the systems to be monitored. The Zabbix agents deliver the desired data to the Zabbix server. This tutorial shows how you can install Zabbix monitoring system on OS FreeBSD. Let’s start:

  1. Update ports tree.
  2. Install zabbix (no need in LDAP support, disable it during installation)
    cd /usr/ports/net-mgmt/zabbix ; make WITHOUT_LDAP=yes install clean ; echo ‘zabbix_server_enable=”YES”‘ >> rc.conf
  3. Create database for zabbix
    mysqladmin -u root -p create zabbix
  4. Create a MySQL user and grant rights to DB
    echo “GRANT SELECT, INSERT, UPDATE, LOCK TABLES, CREATE, DROP, DELETE, INDEX ON zabbix.* TO zabbix@localhost IDENTIFIED BY ‘3<:po~mv’” | mysql -u root -p mysql
  5. Create a structure of tables
    cd /usr/local/share/zabbix/create
    cat schema/mysql.sql data/data.sql data/images_mysql.sql | mysql -u zabbix -p zabbix
  6. Configure Zabbix Server
    cd /usr/local/etc/zabbix
    cp zabbix_server.conf.sample zabbix_server.conf
    By default, the values are suitable for small networks monitoring. In my configuration I changed the following values only:
    StartHTTPPollers=10
    LogFileSize=10

    FpingLocation=/usr/local/sbin/fping
    DBName=zabbix
    DBUser=zabbix
    DBPassword=3<:po~mv
    DBSocket=/tmp/mysql.sock
  7. Run Zabbix
    /usr/local/etc/rc.d/zabbix_server start
  8. Check if Zabbix runs or not
    ps xa | grep zabbix_server
    Zabbix runs properly if the command is like this:
    89213  ??  SN     0:00.01 zabbix_server: main process (zabbix_server)
    89214  ??  SN     0:00.03 zabbix_server: poller [sleeping for 5 seconds] (zabbix_server)
    89215  ??  SN     0:00.03 zabbix_server: poller [sleeping for 5 seconds] (zabbix_server)
    ………………………………..
    89238  ??  SN     0:00.00 zabbix_server: http poller [sleeping for 5 seconds] (zabbix_server)
    89239  ??  SN     0:00.00 zabbix_server: http poller [sleeping for 5 seconds] (zabbix_server)
    89240  ??  IN     0:00.03 zabbix_server: discoverer [sleeping for 600 seconds] (zabbix_server)
    89241  ??  SN     0:00.00 zabbix_server: escalator [sleeping for 3 seconds] (zabbix_server)
    Everything works properly.
  9. Copy web interface files and change a files owner to the name with which the web server was run.
    mkdir -p /usr/local/www/vhosts/zabbix
    cp -R /usr/local/share/zabbix/php/* /usr/local/www/vhosts/zabbix/

    chown -R www:www /usr/local/www/vhosts/zabbix/
  10. Create alias in the web server configuration (I have apache installed) for zabbix interface:
    Alias /zabbix /usr/local/www/vhosts/zabbix/
    <Directory
    /usr/local/www/vhosts/zabbix>
    Order allow,deny
    Allow from all
    </Directory>
  11. Reboot apache
    apachectl graceful
  12. Type http://<site name>/zabbix in the browser and go on with installation:
    FreeBSD Howto: Install Zabbix 1FreeBSD Howto: Install Zabbix 2FreeBSD Howto: Install Zabbix 3FreeBSD Howto: Install Zabbix 4FreeBSD Howto: Install Zabbix 5FreeBSD Howto: Install Zabbix 6FreeBSD Howto: Install Zabbix 7FreeBSD Howto: Install Zabbix 8FreeBSD Howto: Install Zabbix 9
  13. To access the system, enter Login name: Admin Password: zabbix
  14. Change default password for user Admin. To do this go to menu Administration->Users, in the field Alias select Admin,  and then Change password.
  15. Zabbix installation is completed successfully, now we can add hosts for monitoring via menu Configuration->Hosts.
Bookmark and Share

Related Posts

, , , , ,

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.