a1fc06d0e6
Add corresponding documentation and rework some parts of README.OpenBSD. Add FLAVORS description to DESCR-server. input from and ok sthen@ |
||
---|---|---|
.. | ||
README.OpenBSD | ||
zabbix.conf | ||
zabbix.ini |
$OpenBSD: README.OpenBSD,v 1.7 2010/05/04 05:51:22 ajacoutot Exp $ Using ZABBIX on OpenBSD ======================= The original documentation is available as a PDF file at ${HOMEPAGE} (or via the -doc subpackage of the zabbix port) but may not be redistributed. A manual is available at: http://www.zabbix.com/documentation/${MAJV}/complete On OpenBSD, ZABBIX is packaged in four parts: - the agent (in the zabbix-agent package) for installing onto a monitored machine. To simplify installation from ports on client machines, only this part is built by default. - the server and proxy (in the database-dependent zabbix-server package); this has heavier dependencies and is built by selecting the FLAVOR for the database you use (currently mysql or pgsql). - the web interface to run with the server (in the zabbix-web package). This is also in a database-dependent package to ensure the correct PHP modules are installed. - the PDF document, a package which must be 'built' locally because it can not be redistributed. Next, you have to adapt the configuration files under ${SYSCONFDIR}/zabbix/ (make sure your webserver can resolve hostnames; otherwise use IP addresses in the configuration files). To have the ZABBIX server start at boot time, insert the following into /etc/rc.local: if [ -x ${TRUEPREFIX}/sbin/zabbix_server ]; then install -d -o _zabbix /var/run/zabbix echo -n ' zabbix_server'; ${TRUEPREFIX}/sbin/zabbix_server fi For the proxy and the client, follow the same procedure, replacing zabbix_server with zabbix_proxy or zabbix_clientd. The Zabbix Server or Proxy might fail due to lack of shared memory ("Can't allocate shared memory..." errors), in which case you should set kern.shminfo.shmall to 32768 -- see sysctl(8) and sysctl.conf(5). The web frontend works reasonably well with OpenBSD's chroot'ed httpd (the "Status of ZABBIX" page uses /bin/ps and /dev/kmem to check the process, so it erroneously reports it as not running). Some changes from the default configuration are required - you can do this by creating symbolic links as follows: # ln -s ${PREFIX-web}/conf/modules.sample/zabbix.conf \ ${PREFIX-web}/conf/modules # ln -fs ${PREFIX-web}/conf/php5.sample/zabbix.ini \ ${PREFIX-web}/conf/php5/zabbix.ini ZABBIX requires a timezone to be configured in PHP; zabbix.ini sets this to UTC, you may like to adjust this. After making these changes, stop and start httpd. Next you must create the database following the relevant set of instructions below. When this is done you can proceed to configure through the web interface at http://<hostname>/zabbix/setup.php. (default user is 'Admin' with password 'zabbix') == MySQL == MySQL users running with chroot'ed httpd might like to take the following steps to place the mysql socket inside the chroot: Create a directory for the mysql socket. mkdir -p /var/www/var/run/mysql Adjust ${SYSCONFDIR}/my.cnf to put the mysql socket into the chroot, [client] socket = /var/www/var/run/mysql/mysql.sock [mysqld] socket = /var/www/var/run/mysql/mysql.sock and set DBSocket in the ZABBIX configuration appropriately. Connect to MySQL, and create a user and database for ZABBIX; $ mysql -u root -p mysql> create user zabbix@localhost identified by 'password'; mysql> create database zabbix; mysql> grant all on zabbix.* to zabbix@localhost; mysql> quit Then initialize the database from the files installed in ${TRUEPREFIX}/share/examples/zabbix: $ cd ${TRUEPREFIX}/share/zabbix/schema $ mysql -uzabbix -p[password] zabbix < mysql.sql The following steps are not required for setting up a Zabbix Proxy. $ cd ../data $ mysql -uzabbix -p[password] zabbix < data.sql ## N.B. slow!! $ mysql -uzabbix -p[password] zabbix < images_mysql.sql == PostgreSQL == Assuming you have an administrative account named `postgres', you can create the 'zabbix' user and database like this: createuser -U postgres --pwprompt --no-superuser \ --createdb --no-createrole zabbix createdb -U zabbix zabbix And initialize the database: $ cd ${TRUEPREFIX}/share/zabbix/schema $ cat postgresql.sql | psql -U zabbix zabbix The following steps are not required for setting up a Zabbix Proxy. $ cd ../data $ cat data.sql | psql -U zabbix zabbix $ cat images_pgsql.sql | psql -U zabbix zabbix == SQLite3 == $ mkdir /var/db/zabbix $ chown _zabbix /var/db/zabbix The following steps are optional as Zabbix will automatically create and initialize the database if it does not exist. $ cd ${TRUEPREFIX}/share/zabbix/schema $ cat sqlite.sql | sudo -u _zabbix sqlite3 /var/db/zabbix/zabbix.db The following steps are not required for setting up a Zabbix Proxy. $ cd ../data $ cat data.sql | sudo -u _zabbix sqlite3 /var/db/zabbix/zabbix.db $ cat images_sqlite3.sql | sudo -u _zabbix sqlite3 /var/db/zabbix/zabbix.db