have a copy of the database schemas in both the server and proxy

packages because both need them to be able to initialize the zabbix
database and update the server README to reflect the change
This commit is contained in:
robert 2020-04-15 05:58:12 +00:00
parent bc7e8f7d6f
commit b813a5dc5b
4 changed files with 47 additions and 32 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.164 2020/04/14 14:47:24 robert Exp $
# $OpenBSD: Makefile,v 1.165 2020/04/15 05:58:12 robert Exp $
COMMENT-main = network and application monitoring - agent
COMMENT-server = network and application monitoring - server
@ -16,6 +16,9 @@ FULLPKGNAME-web = zabbix-web-${VERSION}
FULLPKGPATH-web = net/zabbix,-web
CATEGORIES = net
REVISION-proxy = 0
REVISION-server = 0
MAJV = ${VERSION:C/^([0-9]+\.[0-9]+).*/\1/}
HOMEPAGE = http://www.zabbix.com/
@ -145,17 +148,21 @@ post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php-${MODPHP_VERSION}
${SUBST_DATA} ${FILESDIR}/zabbix.ini \
${PREFIX}/share/examples/php-${MODPHP_VERSION}/zabbix.ini
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix/schema
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix/data
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix/data/images
.for _n in proxy server
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix-${_n}/schema
# Database schemas. The proxy needs sqlite3 as well.
cd ${WRKSRC}/database/ && tar -cf - mysql postgresql | \
tar -C ${PREFIX}/share/zabbix-${_n}/schema -xf -
. if "${_n}" == "proxy"
cd ${WRKSRC}/database/ && tar -cf - sqlite3 | \
tar -C ${PREFIX}/share/zabbix-${_n}/schema -xf -
. endif
@find ${PREFIX}/share/zabbix-${_n}/schema -name data.sql -exec \
perl -pi -e "s,/bin/ping,/sbin/ping,g;s,/usr/bin/traceroute,/usr/sbin/traceroute,g" {} \;
.endfor
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/zabbix
${INSTALL_DATA} ${WRKBUILD}/conf/*.conf \
${PREFIX}/share/examples/zabbix
# Database schemas
cd ${WRKSRC}/database/ && tar -cf - mysql postgresql sqlite3 | \
tar -C ${PREFIX}/share/zabbix/schema -xf -
@find ${PREFIX}/share/zabbix/schema -name data.sql -exec \
perl -pi -e "s,/bin/ping,/sbin/ping,g;s,/usr/bin/traceroute,/usr/sbin/traceroute,g" {} \;
.include <bsd.port.mk>

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-proxy,v 1.4 2018/08/22 19:57:59 jasper Exp $
@comment $OpenBSD: PLIST-proxy,v 1.5 2020/04/15 05:58:12 robert Exp $
@extraunexec rm -rf /var/log/zabbix/*
@man man/man8/zabbix_proxy.8
@bin sbin/zabbix_proxy
@ -9,6 +9,20 @@ share/examples/zabbix/zabbix_proxy.conf
@sample ${SYSCONFDIR}/zabbix/zabbix_proxy.conf
@mode
@group
share/zabbix-proxy/
share/zabbix-proxy/schema/
share/zabbix-proxy/schema/mysql/
share/zabbix-proxy/schema/mysql/data.sql
share/zabbix-proxy/schema/mysql/images.sql
share/zabbix-proxy/schema/mysql/schema.sql
share/zabbix-proxy/schema/postgresql/
share/zabbix-proxy/schema/postgresql/data.sql
share/zabbix-proxy/schema/postgresql/images.sql
share/zabbix-proxy/schema/postgresql/schema.sql
share/zabbix-proxy/schema/sqlite3/
share/zabbix-proxy/schema/sqlite3/data.sql
share/zabbix-proxy/schema/sqlite3/images.sql
share/zabbix-proxy/schema/sqlite3/schema.sql
@mode 750
@owner _zabbix
@group _zabbix

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-server,v 1.22 2018/10/26 06:57:21 robert Exp $
@comment $OpenBSD: PLIST-server,v 1.23 2020/04/15 05:58:12 robert Exp $
@conflict zabbix-agent-<=1.8.3p5
@extraunexec rm -rf /var/log/zabbix/*
@man man/man8/zabbix_server.8
@ -12,22 +12,16 @@ share/examples/zabbix/zabbix_server.conf
@sample ${SYSCONFDIR}/zabbix/zabbix_server.conf
@mode
@group
share/zabbix/
share/zabbix/data/
share/zabbix/data/images/
share/zabbix/schema/
share/zabbix/schema/mysql/
share/zabbix/schema/mysql/data.sql
share/zabbix/schema/mysql/images.sql
share/zabbix/schema/mysql/schema.sql
share/zabbix/schema/postgresql/
share/zabbix/schema/postgresql/data.sql
share/zabbix/schema/postgresql/images.sql
share/zabbix/schema/postgresql/schema.sql
share/zabbix/schema/sqlite3/
share/zabbix/schema/sqlite3/data.sql
share/zabbix/schema/sqlite3/images.sql
share/zabbix/schema/sqlite3/schema.sql
share/zabbix-server/
share/zabbix-server/schema/
share/zabbix-server/schema/mysql/
share/zabbix-server/schema/mysql/data.sql
share/zabbix-server/schema/mysql/images.sql
share/zabbix-server/schema/mysql/schema.sql
share/zabbix-server/schema/postgresql/
share/zabbix-server/schema/postgresql/data.sql
share/zabbix-server/schema/postgresql/images.sql
share/zabbix-server/schema/postgresql/schema.sql
@mode 0755
@owner _zabbix
@sample /var/log/zabbix/

View File

@ -1,4 +1,4 @@
$OpenBSD: README-server,v 1.14 2018/09/04 12:46:19 espie Exp $
$OpenBSD: README-server,v 1.15 2020/04/15 05:58:12 robert Exp $
+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
@ -66,7 +66,7 @@ Connect to MariaDB, and create a user and database for Zabbix;
Then initialize the database from the files installed in
${TRUEPREFIX}/share/examples/zabbix:
$ cd ${TRUEPREFIX}/share/zabbix/schema/mysql
$ cd ${TRUEPREFIX}/share/zabbix-server/schema/mysql
$ mysql -uzabbix -p[password] zabbix < schema.sql
The following steps are not required for setting up a Zabbix Proxy.
$ mysql -uzabbix -p[password] zabbix < images.sql
@ -84,7 +84,7 @@ you can create the 'zabbix' user and database like this:
And initialize the database:
$ cd ${TRUEPREFIX}/share/zabbix/schema/postgresql
$ cd ${TRUEPREFIX}/share/zabbix-server/schema/postgresql
$ cat schema.sql | psql -U zabbix zabbix
The following steps are not required for setting up a Zabbix Proxy.
$ cat images.sql | psql -U zabbix zabbix
@ -104,7 +104,7 @@ automatically created and initialized if it does not exist. Note that
for obvious performance reasons, it is NOT encouraged to use the SQLite
backend for a server.
# cd ${TRUEPREFIX}/share/zabbix/schema/sqlite3
# cd ${TRUEPREFIX}/share/zabbix-server/schema/sqlite3
# su -m _zabbix -c "sqlite3 /var/db/zabbix/zabbix.db < schema.sql"
The following steps are not required for setting up a Zabbix Proxy.
# su -m _zabbix -c "sqlite3 /var/db/zabbix/zabbix.db < images.sql"