pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/zabbix50-agent
Module Name: pkgsrc
Committed By: otis
Date: Tue Nov 3 22:46:24 UTC 2020
Added Files:
pkgsrc/sysutils/zabbix50-agent: DESCR Makefile PLIST distinfo
options.mk
pkgsrc/sysutils/zabbix50-agent/files: zabbix_agentd.sh
pkgsrc/sysutils/zabbix50-agent/files/smf: manifest.xml
pkgsrc/sysutils/zabbix50-agent/patches: patch-configure
patch-src_libs_zbxsysinfo_netbsd_net.c
patch-src_zabbix__agent_Makefile.in
Log Message:
zabbix50-agent: Import zabbix-agent 5.0.5
Zabbix is the ultimate enterprise-level software designed for monitoring
availability and performance of IT infrastructure components. Zabbix is open
source and comes at no cost.
With Zabbix it is possible to gather virtually limitless types of data from
the network. High performance real-time monitoring means that tens of thousands
of servers, virtual machines and network devices can be monitored
simultaneously. Along with storing the data, visualization features are
available (overviews, maps, graphs, screens, etc), as well as very flexible
ways of analyzing the data for the purpose of alerting.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/zabbix50-agent/DESCR \
pkgsrc/sysutils/zabbix50-agent/Makefile \
pkgsrc/sysutils/zabbix50-agent/PLIST \
pkgsrc/sysutils/zabbix50-agent/distinfo \
pkgsrc/sysutils/zabbix50-agent/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/zabbix50-agent/files/zabbix_agentd.sh
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/zabbix50-agent/files/smf/manifest.xml
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/zabbix50-agent/patches/patch-configure \
pkgsrc/sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c \
pkgsrc/sysutils/zabbix50-agent/patches/patch-src_zabbix__agent_Makefile.in
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/sysutils/zabbix50-agent/DESCR
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/DESCR:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/DESCR Tue Nov 3 22:46:23 2020
@@ -0,0 +1,10 @@
+Zabbix is the ultimate enterprise-level software designed for monitoring
+availability and performance of IT infrastructure components. Zabbix is open
+source and comes at no cost.
+
+With Zabbix it is possible to gather virtually limitless types of data from
+the network. High performance real-time monitoring means that tens of thousands
+of servers, virtual machines and network devices can be monitored
+simultaneously. Along with storing the data, visualization features are
+available (overviews, maps, graphs, screens, etc), as well as very flexible
+ways of analyzing the data for the purpose of alerting.
Index: pkgsrc/sysutils/zabbix50-agent/Makefile
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/Makefile:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/Makefile Tue Nov 3 22:46:23 2020
@@ -0,0 +1,49 @@
+# $NetBSD: Makefile,v 1.1 2020/11/03 22:46:23 otis Exp $
+
+.include "../../sysutils/zabbix50-server/Makefile.common"
+
+PKGNAME= ${DISTNAME:S/-/-agent-/}
+COMMENT= Enterprise-class Monitoring Solution for Everyone
+
+CONFLICTS+= zabbix-[0-9]*
+CONFLICTS+= zabbix-agent-[0-9]*
+
+USE_TOOLS+= pkg-config
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --enable-agent
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+= --datarootdir=${PREFIX}/share/${PKGBASE}
+CONFIGURE_ARGS+= --with-libcurl
+CONFIGURE_ARGS+= --with-libpcre=${BUILDLINK_PREFIX.pcre}
+CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
+
+EGDIR= share/examples/${PKGBASE}
+CONF_FILES+= ${EGDIR}/zabbix_agentd.conf ${PKG_SYSCONFDIR}/zabbix_agentd.conf
+
+RCD_SCRIPTS= zabbix_agentd
+
+INSTALLATION_DIRS+= ${EGDIR} share/${PKGBASE}
+
+SUBST_CLASSES+= fix-paths
+SUBST_STAGE.fix-paths= pre-configure
+SUBST_MESSAGE.fix-paths= Fixing absolute paths.
+SUBST_FILES.fix-paths= conf/*.conf
+SUBST_FILES.fix-paths+= man/*.man
+SUBST_SED.fix-paths= -e 's,/usr/local/etc,${PKG_SYSCONFDIR},g'
+
+SUBST_CLASSES+= fix-pkgbase
+SUBST_STAGE.fix-pkgbase= pre-configure
+SUBST_MESSAGE.fix-pkgbase= Fixing PKGBASE.
+SUBST_FILES.fix-pkgbase= src/zabbix_agent/Makefile.in
+SUBST_SED.fix-pkgbase= -e 's,%%PKGBASE%%,${PKGBASE},g'
+
+PLIST_SUBST+= PKGBASE=${PKGBASE}
+
+.include "../../mk/bsd.prefs.mk"
+
+.include "options.mk"
+
+.include "../../security/openssl/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../devel/pcre/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/sysutils/zabbix50-agent/PLIST
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/PLIST:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/PLIST Tue Nov 3 22:46:23 2020
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST,v 1.1 2020/11/03 22:46:23 otis Exp $
+bin/zabbix_get
+bin/zabbix_sender
+man/man1/zabbix_get.1
+man/man1/zabbix_sender.1
+man/man8/zabbix_agentd.8
+sbin/zabbix_agentd
+share/examples/${PKGBASE}/zabbix_agentd.conf
+@pkgdir share/${PKGBASE}
+@pkgdir lib/modules
+@pkgdir etc/zabbix_agentd.conf.d
Index: pkgsrc/sysutils/zabbix50-agent/distinfo
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/distinfo:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/distinfo Tue Nov 3 22:46:23 2020
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2020/11/03 22:46:23 otis Exp $
+
+SHA1 (zabbix-5.0.5.tar.gz) = 65683f4ada7ae91f26215a53683d12ec726a960d
+RMD160 (zabbix-5.0.5.tar.gz) = 0d65e30d3d91ba8819572468425cf18c4e2c33bc
+SHA512 (zabbix-5.0.5.tar.gz) = 5397672fa170e12120526793b48d01764013467cc259eca61991bc52251c25888dd318ccffa6ed30ac3643104e715ceb70baaeec6eeaddb115ed294c22f5e619
+Size (zabbix-5.0.5.tar.gz) = 19153153 bytes
+SHA1 (patch-configure) = cf647b9ee52a96882d31f8783ac19b66e3e65105
+SHA1 (patch-src_libs_zbxsysinfo_netbsd_net.c) = 468f2112a3d65b0a73f371194ae15ce0df0ad71c
+SHA1 (patch-src_zabbix__agent_Makefile.in) = efbd804ecee4b99db36db5f4fd61583b2ef96a86
Index: pkgsrc/sysutils/zabbix50-agent/options.mk
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/options.mk:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/options.mk Tue Nov 3 22:46:23 2020
@@ -0,0 +1,14 @@
+# $NetBSD: options.mk,v 1.1 2020/11/03 22:46:23 otis Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.zabbix50-agent
+PKG_SUPPORTED_OPTIONS+= inet6
+
+.if empty(MISSING_FEATURES:Minet6)
+PKG_SUGGESTED_OPTIONS+= inet6
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Minet6)
+CONFIGURE_ARGS+= --enable-ipv6
+.endif
Index: pkgsrc/sysutils/zabbix50-agent/files/zabbix_agentd.sh
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/files/zabbix_agentd.sh:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/files/zabbix_agentd.sh Tue Nov 3 22:46:23 2020
@@ -0,0 +1,27 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: zabbix_agentd.sh,v 1.1 2020/11/03 22:46:23 otis Exp $
+#
+# Zabbix agent daemon
+#
+# REQUIRE: DAEMON
+# PROVIDE: zabbix_agentd
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="zabbix_agentd"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+start_precmd="ulimit -s 10240"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config ${name}
+ run_rc_command "$1"
+else
+ @ECHO@ -n " ${name}"
+ [ "x$1" = "xstart" ] && ulimit -s 10240
+ ${command} ${command_args}
+fi
Index: pkgsrc/sysutils/zabbix50-agent/files/smf/manifest.xml
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/files/smf/manifest.xml:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/files/smf/manifest.xml Tue Nov 3 22:46:23 2020
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="export">
+ <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
+ <dependency name="fs-local" grouping="require_all" restart_on="none" type="service">
+ <service_fmri value="svc:/system/filesystem/local"/>
+ </dependency>
+ <dependency name="network-service" grouping="require_all" restart_on="none" type="service">
+ <service_fmri value="svc:/network/service"/>
+ </dependency>
+ <dependency name="system-log" grouping="optional_all" restart_on="none" type="service">
+ <service_fmri value="svc:/system/system-log"/>
+ </dependency>
+ <method_context>
+ <method_credential user="@ZABBIX_USER@" group="@ZABBIX_GROUP@"/>
+ </method_context>
+ <instance name="@SMF_INSTANCES@" enabled="false">
+ <dependency name="config-file" grouping="require_all" restart_on="refresh" type="path">
+ <service_fmri value="file://localhost@PKG_SYSCONFDIR@/zabbix_agentd.conf"/>
+ </dependency>
+ <exec_method name="start" type="method" exec="@PREFIX@/sbin/zabbix_agentd -c @PKG_SYSCONFDIR@/zabbix_agentd.conf" timeout_seconds="0"/>
+ <exec_method name="stop" type="method" exec=":kill" timeout_seconds="0"/>
+ <template>
+ <common_name>
+ <loctext xml:lang="C">Zabbix agent</loctext>
+ </common_name>
+ </template>
+ </instance>
+ </service>
+</service_bundle>
Index: pkgsrc/sysutils/zabbix50-agent/patches/patch-configure
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/patches/patch-configure:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/patches/patch-configure Tue Nov 3 22:46:23 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-configure,v 1.1 2020/11/03 22:46:23 otis Exp $
+
+Fix bash-ism.
+
+--- configure.orig 2020-07-13 07:56:36.000000000 +0000
++++ configure
+@@ -8494,7 +8494,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+- if test "$found_mysql_tls" == "yes"; then
++ if test "$found_mysql_tls" = "yes"; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS ciphersuites in MySQL library" >&5
+ $as_echo_n "checking for TLS ciphersuites in MySQL library... " >&6; }
Index: pkgsrc/sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c Tue Nov 3 22:46:23 2020
@@ -0,0 +1,203 @@
+$NetBSD: patch-src_libs_zbxsysinfo_netbsd_net.c,v 1.1 2020/11/03 22:46:23 otis Exp $
+
+Rework interface statistics code from using kvm to using sysctl interface.
+
+--- src/libs/zbxsysinfo/netbsd/net.c.orig 2020-08-24 09:42:55.000000000 +0000
++++ src/libs/zbxsysinfo/netbsd/net.c
+@@ -22,6 +22,9 @@
+ #include "zbxjson.h"
+ #include "log.h"
+
++#include <net/route.h>
++#include <net/if_dl.h>
++
+ static struct nlist kernel_symbols[] =
+ {
+ {"_ifnet", N_UNDF, 0, 0, 0},
+@@ -31,43 +34,91 @@ static struct nlist kernel_symbols[] =
+
+ #define IFNET_ID 0
+
++static void
++get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info)
++{
++ int i;
++
++ for (i = 0; i < RTAX_MAX; i++) {
++ if (addrs & (1 << i)) {
++ rti_info[i] = sa;
++ sa = (struct sockaddr *)((char *)(sa) +
++ RT_ROUNDUP(sa->sa_len));
++ } else
++ rti_info[i] = NULL;
++ }
++}
++
++
+ static int get_ifdata(const char *if_name,
+ zbx_uint64_t *ibytes, zbx_uint64_t *ipackets, zbx_uint64_t *ierrors, zbx_uint64_t *idropped,
+ zbx_uint64_t *obytes, zbx_uint64_t *opackets, zbx_uint64_t *oerrors,
+ zbx_uint64_t *tbytes, zbx_uint64_t *tpackets, zbx_uint64_t *terrors,
+ zbx_uint64_t *icollisions, char **error)
+ {
+- struct ifnet_head head;
+- struct ifnet *ifp;
+- struct ifnet v;
+-
+- kvm_t *kp;
+- int len = 0;
+- int ret = SYSINFO_RET_FAIL;
++ struct if_msghdr *ifm;
++ int mib[6] = { CTL_NET, AF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
++ char *buf = NULL;
++ char *lim, *next;
++ struct rt_msghdr *rtm;
++ struct if_data *ifd = NULL;
++ struct sockaddr *sa, *rti_info[RTAX_MAX];
++ struct sockaddr_dl *sdl;
++
++ size_t len = 0;
++ size_t olen = 0;
++ int ret = SYSINFO_RET_FAIL;
++
++ static char name[IFNAMSIZ];
+
+ if (NULL == if_name || '\0' == *if_name)
+ {
+ *error = zbx_strdup(NULL, "Network interface name cannot be empty.");
+- return FAIL;
++ ret = FAIL;
++ goto out;
+ }
+
+- if (NULL == (kp = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL))) /* requires root privileges */
+- {
+- *error = zbx_strdup(NULL, "Cannot obtain a descriptor to access kernel virtual memory.");
+- return FAIL;
+- }
+-
+- if (N_UNDF == kernel_symbols[IFNET_ID].n_type)
+- if (0 != kvm_nlist(kp, &kernel_symbols[0]))
+- kernel_symbols[IFNET_ID].n_type = N_UNDF;
+-
+- if (N_UNDF != kernel_symbols[IFNET_ID].n_type)
+- {
+- len = sizeof(struct ifnet_head);
+-
+- if (kvm_read(kp, kernel_symbols[IFNET_ID].n_value, &head, len) >= len)
+- {
+- len = sizeof(struct ifnet);
++ if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1) {
++ *error = zbx_strdup(NULL, "Failed to read network interfaces data");
++ ret = FAIL;
++ goto out;
++ }
++
++ if (len > olen) {
++ free(buf);
++ if ((buf = zbx_malloc(NULL, len)) == NULL) {
++ *error = zbx_strdup(NULL, "Failed to allocate buffer for network interfaces data");
++ ret = FAIL;
++ goto out;
++ }
++ olen = len;
++ }
++ if (sysctl(mib, 6, buf, &len, NULL, 0) == -1) {
++ *error = zbx_strdup(NULL, "Failed to allocate buffer for network interfaces data");
++ ret = FAIL;
++ goto out;
++ }
++
++ lim = buf + len;
++ for (next = buf; next < lim; next += rtm->rtm_msglen) {
++ rtm = (struct rt_msghdr *)next;
++ if ((rtm->rtm_version == RTM_VERSION) &&
++ (rtm->rtm_type == RTM_IFINFO)) {
++ ifm = (struct if_msghdr *)next;
++ ifd = &ifm->ifm_data;
++
++ sa = (struct sockaddr *)(ifm + 1);
++ get_rtaddrs(ifm->ifm_addrs, sa, rti_info);
++
++ sdl = (struct sockaddr_dl *)rti_info[RTAX_IFP];
++ if (sdl == NULL || sdl->sdl_family != AF_LINK) {
++ continue;
++ }
++ bzero(name, sizeof(name));
++ if (sdl->sdl_nlen >= IFNAMSIZ)
++ memcpy(name, sdl->sdl_data, IFNAMSIZ - 1);
++ else if (sdl->sdl_nlen > 0)
++ memcpy(name, sdl->sdl_data, sdl->sdl_nlen);
+
+ /* if_ibytes; total number of octets received */
+ /* if_ipackets; packets received on interface */
+@@ -101,42 +152,38 @@ static int get_ifdata(const char *if_nam
+ if (icollisions)
+ *icollisions = 0;
+
+- for (ifp = head.tqh_first; ifp; ifp = v.if_list.tqe_next)
++ if (0 == strcmp(if_name, name))
+ {
+- if (kvm_read(kp, (u_long)ifp, &v, len) < len)
+- break;
+-
+- if (0 == strcmp(if_name, v.if_xname))
+- {
+- if (ibytes)
+- *ibytes += v.if_ibytes;
+- if (ipackets)
+- *ipackets += v.if_ipackets;
+- if (ierrors)
+- *ierrors += v.if_ierrors;
+- if (idropped)
+- *idropped += v.if_iqdrops;
+- if (obytes)
+- *obytes += v.if_obytes;
+- if (opackets)
+- *opackets += v.if_opackets;
+- if (oerrors)
+- *oerrors += v.if_oerrors;
+- if (tbytes)
+- *tbytes += v.if_ibytes + v.if_obytes;
+- if (tpackets)
+- *tpackets += v.if_ipackets + v.if_opackets;
+- if (terrors)
+- *terrors += v.if_ierrors + v.if_oerrors;
+- if (icollisions)
+- *icollisions += v.if_collisions;
+- ret = SYSINFO_RET_OK;
+- }
++ if (ibytes)
++ *ibytes += ifd->ifi_ibytes;
++ if (ipackets)
++ *ipackets += ifd->ifi_ipackets;
++ if (ierrors)
++ *ierrors += ifd->ifi_ierrors;
++ if (idropped)
++ *idropped += ifd->ifi_iqdrops;
++ if (obytes)
++ *obytes += ifd->ifi_obytes;
++ if (opackets)
++ *opackets += ifd->ifi_opackets;
++ if (oerrors)
++ *oerrors += ifd->ifi_oerrors;
++ if (tbytes)
++ *tbytes += ifd->ifi_ibytes + ifd->ifi_obytes;
++ if (tpackets)
++ *tpackets += ifd->ifi_ipackets + ifd->ifi_opackets;
++ if (terrors)
++ *terrors += ifd->ifi_ierrors + ifd->ifi_oerrors;
++ if (icollisions)
++ *icollisions += ifd->ifi_collisions;
++ ret = SYSINFO_RET_OK;
++ goto out;
+ }
+ }
+ }
+
+- kvm_close(kp);
++out:
++ free(buf);
+
+ if (SYSINFO_RET_FAIL == ret)
+ {
Index: pkgsrc/sysutils/zabbix50-agent/patches/patch-src_zabbix__agent_Makefile.in
diff -u /dev/null pkgsrc/sysutils/zabbix50-agent/patches/patch-src_zabbix__agent_Makefile.in:1.1
--- /dev/null Tue Nov 3 22:46:24 2020
+++ pkgsrc/sysutils/zabbix50-agent/patches/patch-src_zabbix__agent_Makefile.in Tue Nov 3 22:46:23 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_zabbix__agent_Makefile.in,v 1.1 2020/11/03 22:46:23 otis Exp $
+
+Install config file to component's example directory.
+
+--- src/zabbix_agent/Makefile.in.orig 2020-08-24 09:43:03.000000000 +0000
++++ src/zabbix_agent/Makefile.in
+@@ -1113,7 +1113,7 @@ uninstall-am: uninstall-sbinPROGRAMS
+ install-data-hook:
+ $(MKDIR_P) "$(DESTDIR)$(AGENT_CONFIG_FILE).d"
+ $(MKDIR_P) "$(DESTDIR)$(LOAD_MODULE_PATH)"
+- test -f "$(DESTDIR)$(AGENT_CONFIG_FILE)" || cp "../../conf/zabbix_agentd.conf" "$(DESTDIR)$(AGENT_CONFIG_FILE)"
++ $(INSTALL_DATA) "../../conf/zabbix_agentd.conf" "$(DESTDIR)/${PREFIX}/share/examples/%%PKGBASE%%"
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
Home |
Main Index |
Thread Index |
Old Index