Skip to content

Commit

Permalink
net-mgmt/zabbix62: Add ports
Browse files Browse the repository at this point in the history
Add net-mgmt/zabbix62 ports, for zabbix 6.2 suite.

Zabbix is a well known monitoring system. These ports are for
the standard version. For more information about standard/LTS seei
https://www.zabbix.com/life_cycle_and_release_policy

Release notes for zabbix 6.2.0:
https://www.zabbix.com/rn/rn6.2.0
  • Loading branch information
jurajlutter committed Jul 10, 2022
1 parent d0bfc84 commit 4263a08
Show file tree
Hide file tree
Showing 18 changed files with 2,197 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net-mgmt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,10 @@
SUBDIR += zabbix6-java
SUBDIR += zabbix6-proxy
SUBDIR += zabbix6-server
SUBDIR += zabbix62-agent
SUBDIR += zabbix62-frontend
SUBDIR += zabbix62-java
SUBDIR += zabbix62-proxy
SUBDIR += zabbix62-server

.include <bsd.port.subdir.mk>
11 changes: 11 additions & 0 deletions net-mgmt/zabbix62-agent/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PORTNAME= zabbix62
CATEGORIES= net-mgmt
PKGNAMESUFFIX= -agent

MASTERDIR= ${.CURDIR}/../${PORTNAME}-server
PLIST= ${PKGDIR}/pkg-plist.agent

OPTIONS_DEFINE= CURL IPV6 MODBUS
OPTIONS_DEFAULT= CURL OPENSSL

.include "${MASTERDIR}/Makefile"
31 changes: 31 additions & 0 deletions net-mgmt/zabbix62-frontend/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PORTNAME= zabbix62
CATEGORIES= net-mgmt
PKGNAMESUFFIX= -frontend${PHP_PKGNAMESUFFIX}

USES+= php:web,flavors
USE_PHP= bcmath ctype dom fileinfo filter gd gettext hash json ldap \
mbstring openssl pcre session simplexml snmp sockets xml \
xmlreader xmlwriter
IGNORE_WITH_PHP= 82

MASTERDIR= ${.CURDIR}/../${PORTNAME}-server
PATCHDIR=
NO_ARCH= yes
NO_BUILD= yes

PLIST= ${PKGDIR}/pkg-plist.frontend

OPTIONS_DEFINE= MYSQLI ORACLE PGSQL
OPTIONS_DEFAULT= MYSQLI
MYSQLI_DESC= MySQLI backend

MYSQLI_USE= PHP=mysqli
ORACLE_CONFIGURE_WITH= oracle
PGSQL_USE= PHP=pgsql

do-install:
@${MKDIR} ${STAGEDIR}${WWWDIR}
(cd ${WRKSRC}/ui && \
${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR})

.include "${MASTERDIR}/Makefile"
13 changes: 13 additions & 0 deletions net-mgmt/zabbix62-java/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PORTNAME= zabbix62
PORTREVISION= 0
CATEGORIES= net-mgmt
PKGNAMESUFFIX= -java

MASTERDIR= ${.CURDIR}/../${PORTNAME}-server
PLIST= ${PKGDIR}/pkg-plist.java

OPTIONS_DEFINE= IPV6

USE_JAVA= yes

.include "${MASTERDIR}/Makefile"
9 changes: 9 additions & 0 deletions net-mgmt/zabbix62-proxy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PORTNAME= zabbix62
CATEGORIES= net-mgmt
PKGNAMESUFFIX= -proxy

MASTERDIR= ${.CURDIR}/../${PORTNAME}-server

OPTIONS_SINGLE_DB= MYSQL PGSQL SQLITE ORACLE

.include "${MASTERDIR}/Makefile"
231 changes: 231 additions & 0 deletions net-mgmt/zabbix62-server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
PORTNAME= zabbix62
DISTVERSION= 6.2.0
CATEGORIES= net-mgmt
MASTER_SITES= https://cdn.zabbix.com/zabbix/sources/stable/${DISTVERSION:R}/
PKGNAMESUFFIX?= -server
DISTNAME= zabbix-${DISTVERSION}

MAINTAINER= otis@FreeBSD.org
COMMENT= Enterprise-class open source distributed monitoring (${PKGNAMESUFFIX:S/^-//})

LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING

LIB_DEPENDS= libpcre.so:devel/pcre

CONFLICTS_INSTALL= zabbix5[0-9]${PKGNAMESUFFIX} \
zabbix[0-9]${PKGNAMESUFFIX}

ZABBIX_BUILD= ${PKGNAMESUFFIX:S/^-//:S/-$//}

.if ${ZABBIX_BUILD} != "frontend" # frontend only needs the version/distribution settings
.if ${ZABBIX_BUILD} != "agent"
CONFIGURE_ARGS+= --with-libevent=${LOCALBASE} --cache-file=${WRKSRC}/config.cache
LIB_DEPENDS+= libevent.so:devel/libevent
USE_RC_SUBR= zabbix_${ZABBIX_BUILD}
.else
USE_RC_SUBR= zabbix_${ZABBIX_BUILD}d
.endif

USES= pkgconfig iconv

USERS= zabbix
GROUPS= zabbix

.if ${ZABBIX_BUILD} != "proxy"
PLIST_SUB= PROXY="@comment "
.else
PLIST_SUB= PROXY=""
PLIST_FILES+= bin/zabbix_proxy_js
.endif

.if ${ZABBIX_BUILD} == "server"
PLIST_SUB+= SERVER=""
PLIST_FILES+= bin/zabbix_js
.else
PLIST_SUB+= SERVER="@comment "
.endif

PLIST_SUB+= ZABBIX_BUILD=${ZABBIX_BUILD} DISTVERSION=${DISTVERSION}
SUB_LIST= ZABBIX_BUILD=${ZABBIX_BUILD}

MAKE_ARGS+= ARCH=freebsd
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \
--sysconfdir=${ETCDIR} \
--datadir=${ETCDIR} \
--with-iconv=${ICONV_PREFIX}

.if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
LIB_DEPENDS+= libnetsnmp.so:net-mgmt/net-snmp

CPPFLAGS+= -I${LOCALBASE}/include

SUB_FILES= pkg-message

CONFIGURE_ARGS+= --with-net-snmp

OPTIONS_DEFINE= IPV6 FPING CURL LDAP IPMI SSH NMAP LIBXML2 UNIXODBC

OPTIONS_DEFAULT= FPING CURL UNIXODBC MYSQL OPENSSL
OPTIONS_SUB= yes

FPING_DESC= Build/install fping for ping checks
IPMI_DESC= Support for IPMI checks
LDAP_DESC= Support for LDAP server checks
NMAP_DESC= Build/install nmap for o/s detection
SSH_DESC= Support for SSH-based checks
UNIXODBC_DESC= Support for database checks via ODBC
LIBXML2_DESC= Support for libxml2 (required by monitoring VMware)
MYSQL_DESC= MySQL 8.0 database support
MYSQLDV_DESC= MYSQL DEFAULT_VERSIONS= (poudriere)

OPTIONS_SINGLE= DB SSL
OPTIONS_SINGLE_DB?= MDB5 MDB6 MYSQL MYSQLDV PGSQL ORACLE
OPTIONS_SINGLE_SSL= OPENSSL GNUTLS

MYSQL_CONFIGURE_ON= --with-mysql
MYSQL_USES+= compiler:c11 mysql:80

MYSQLDV_CONFIGURE_ON= --with-mysql
MYSQLDV_USES+= compiler:c11 mysql

MDB5_CONFIGURE_ON= --with-mysql=${LOCALBASE}/bin/mysql_config
MDB5_USES+= compiler:c11 mysql:105m
MDB5_DESC= Mariadb 10.5 database support

MDB6_CONFIGURE_ON= --with-mysql=${LOCALBASE}/bin/mysql_config
MDB6_USES+= compiler:c11 mysql:106m
MDB6_DESC= Mariadb 10.6 database support

PGSQL_CONFIGURE_WITH= postgresql
PGSQL_USES+= pgsql

SQLITE_CONFIGURE_WITH= sqlite3
SQLITE_USES+= sqlite:3

ORACLE_CONFIGURE_WITH= oracle

LDAP_CONFIGURE_WITH= ldap
LDAP_USE= OPENLDAP=yes

IPMI_CONFIGURE_WITH= openipmi
IPMI_LIB_DEPENDS= libOpenIPMI.so:sysutils/openipmi

FPING_RUN_DEPENDS= fping:net/fping

SSH_CONFIGURE_WITH= ssh2
SSH_LIB_DEPENDS= libssh2.so:security/libssh2

UNIXODBC_CONFIGURE_WITH=unixodbc
UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
.elif ${ZABBIX_BUILD} == "agent"
OPTIONS_SINGLE= SSL
OPTIONS_SINGLE_SSL= OPENSSL GNUTLS
.endif # if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"

CURL_DESC= Support for web monitoring
CURL_CONFIGURE_WITH= libcurl
CURL_LIB_DEPENDS= libcurl.so:ftp/curl

IPV6_CONFIGURE_ENABLE= ipv6

NMAP_RUN_DEPENDS= nmap:security/nmap \
sudo:security/sudo

LIBXML2_CONFIGURE_WITH= libxml2=${LOCALBASE}
LIBXML2_LIB_DEPENDS= libxml2.so:textproc/libxml2

MODBUS_DESC= Support for Modbus checks
MODBUS_CONFIGURE_WITH= libmodbus
MODBUS_LIB_DEPENDS= libmodbus.so:comms/libmodbus

OPENSSL_CONFIGURE_WITH= openssl
OPENSSL_USES= ssl
OPENSSL_VARS= BROKEN_SSL="libressl libressl-devel" \
BROKEN_SSL_REASON="PSK is not provided by LibreSSL"

GNUTLS_CONFIGURE_WITH= gnutls
GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls

.include <bsd.port.pre.mk>

post-patch:
@${GREP} -rl "/etc/zabbix" ${WRKSRC} \
| ${XARGS} ${REINPLACE_CMD} -e 's#/usr/local/etc#${ETCDIR}#g'

@${REINPLACE_CMD} -e 's#/usr/sbin/fping#${LOCALBASE}/sbin/fping#g' \
${WRKSRC}/conf/zabbix_*.conf \
${WRKSRC}/src/zabbix_proxy/proxy.c \
${WRKSRC}/src/zabbix_server/server.c

.if ${ZABBIX_BUILD} == "server"
@${REINPLACE_CMD} -e 's#/tmp/zabbix_server.pid#/var/run/zabbix/zabbix_server.pid#g' \
${WRKSRC}/conf/zabbix_server.conf \
${WRKSRC}/src/zabbix_server/server.c
.endif

.if ${ZABBIX_BUILD} == "proxy"
@${REINPLACE_CMD} -e 's#/tmp/zabbix_proxy.pid#/var/run/zabbix/zabbix_proxy.pid#g' \
${WRKSRC}/conf/zabbix_proxy.conf \
${WRKSRC}/src/zabbix_proxy/proxy.c
.endif

.if ${ZABBIX_BUILD} == "agent"
@${REINPLACE_CMD} -e 's#/tmp/zabbix_agentd.pid#/var/run/zabbix/zabbix_agentd.pid#g' \
${WRKSRC}/conf/zabbix_agentd.conf \
${WRKSRC}/src/zabbix_agent/zabbix_agentd.c
.endif

.if ${ZABBIX_BUILD} == "java"
@${REINPLACE_CMD} -e 's#/tmp/zabbix_java.pid#/var/run/zabbix/zabbix_java.pid#g' \
${WRKSRC}/src/zabbix_java/settings.sh
.endif

.if ${ZABBIX_BUILD} != "agent"
. for d in mysql oracle postgresql sqlite3
@${REINPLACE_CMD} \
-e 's|/usr/bin/traceroute|/usr/sbin/traceroute|g' \
-e 's|sudo /usr/bin/nmap|sudo ${LOCALBASE}/bin/nmap|g' \
${WRKSRC}/database/${d}/data.sql
. endfor
.endif
@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) \
-exec ${RM} {} +

pre-configure:
@echo "ac_cv_env_PKG_CONFIG_set=${LOCALBASE}/bin/pkgconf" > ${WRKSRC}/config.cache

post-install:
.if ${ZABBIX_BUILD} == "java"
${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh \
${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample
@${MKDIR} ${STAGEDIR}/var/run/zabbix
.endif

.if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
${MKDIR} ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/database
@${RM} ${WRKSRC}/database/*/Makefile*
(cd ${WRKSRC}/database/ && \
${COPYTREE_SHARE} "mysql oracle postgresql sqlite3" \
${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/database/)

${MV} ${STAGEDIR}${ETCDIR}/zabbix_${ZABBIX_BUILD}.conf \
${STAGEDIR}${ETCDIR}/zabbix_${ZABBIX_BUILD}.conf.sample
.endif

.if ${ZABBIX_BUILD} == "agent"
${MV} ${STAGEDIR}${ETCDIR}/zabbix_${ZABBIX_BUILD}d.conf \
${STAGEDIR}${ETCDIR}/zabbix_${ZABBIX_BUILD}d.conf.sample
.endif

.if ${ZABBIX_BUILD} == "proxy"
${MV} ${STAGEDIR}${LOCALBASE}/bin/zabbix_js \
${STAGEDIR}${LOCALBASE}/bin/zabbix_proxy_js
.endif

.else # frontend
.include <bsd.port.pre.mk>
.endif

.include <bsd.port.post.mk>
3 changes: 3 additions & 0 deletions net-mgmt/zabbix62-server/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1657356950
SHA256 (zabbix-6.2.0.tar.gz) = 2de7cb68a0d0f09bfef66328ab885920afa6a3b0b57ce6e6fc6227b10a2be02a
SIZE (zabbix-6.2.0.tar.gz) = 34472773
11 changes: 11 additions & 0 deletions net-mgmt/zabbix62-server/files/patch-src_libs_zbxembed_duktape.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/libs/zbxembed/duktape.h.orig 2022-02-14 01:54:29.000000000 -0800
+++ src/libs/zbxembed/duktape.h 2022-02-15 13:48:15.058093000 -0800
@@ -160,7 +160,7 @@
#if !defined(DUKTAPE_H_INCLUDED)
#define DUKTAPE_H_INCLUDED

-#define DUK_SINGLE_FILE
+#undef DUK_SINGLE_FILE

/*
* BEGIN PUBLIC API
51 changes: 51 additions & 0 deletions net-mgmt/zabbix62-server/files/pkg-message.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[
{ type: install
message: <<EOM
This is a Zabbix Standard release!

Standard Zabbix releases are supported for Zabbix customers during six (6)
months of Full Support (general, critical and security issues) until the next
Zabbix stable release, plus one (1) additional month of Limited Support
(critical and security issues only). Zabbix Standard version release will result
in change of the second version number.

Standard release: Zabbix 6.2
Release date: Jul 05, 2022
End of Full Support: Jan 31, 2023
End of Limited Support: Feb 28, 2023

Zabbix Life Cycle & Release Policy:
https://www.zabbix.com/life_cycle_and_release_policy

Log files are now under /var/log/zabbix directory instead of /tmp as it was
previously.

For Zabbix server and proxy daemons, as well as Zabbix frontend, a database is
required. It is not needed to run Zabbix agent.

To populate the database with initial data:

% cd %%DATADIR%%/%%ZABBIX_BUILD%%/database

and follow the instructions:
https://www.zabbix.com/documentation/6.2/en/manual/appendix/install/db_scripts

Upgrade notes for 6.2.0:
https://www.zabbix.com/documentation/6.2/en/manual/installation/upgrade_notes_620

Upgrade procedure:
https://www.zabbix.com/documentation/current/en/manual/installation/upgrade/sources

Official Zabbix documentation:
https://www.zabbix.com/documentation/6.2/en/manual

Please see https://www.zabbix.com/ for detailed information about Zabbix.

The default credentials for zabbix frontend is:
Username: Admin
Password: zabbix

For use NMAP please edit sudoers.
EOM
}
]
Loading

0 comments on commit 4263a08

Please sign in to comment.