pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/zabbix50-agent zabbix50-agent: Import zabbix-...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0970630400c9
branches:  trunk
changeset: 441429:0970630400c9
user:      otis <otis%pkgsrc.org@localhost>
date:      Tue Nov 03 22:46:23 2020 +0000

description:
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.

diffstat:

 sysutils/zabbix50-agent/DESCR                                          |   10 +
 sysutils/zabbix50-agent/Makefile                                       |   49 ++
 sysutils/zabbix50-agent/PLIST                                          |   11 +
 sysutils/zabbix50-agent/distinfo                                       |    9 +
 sysutils/zabbix50-agent/files/smf/manifest.xml                         |   30 +
 sysutils/zabbix50-agent/files/zabbix_agentd.sh                         |   27 +
 sysutils/zabbix50-agent/options.mk                                     |   14 +
 sysutils/zabbix50-agent/patches/patch-configure                        |   15 +
 sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c |  203 ++++++++++
 sysutils/zabbix50-agent/patches/patch-src_zabbix__agent_Makefile.in    |   15 +
 10 files changed, 383 insertions(+), 0 deletions(-)

diffs (truncated from 423 to 300 lines):

diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/DESCR     Tue Nov 03 22:46:23 2020 +0000
@@ -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.
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/Makefile  Tue Nov 03 22:46:23 2020 +0000
@@ -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"
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/PLIST     Tue Nov 03 22:46:23 2020 +0000
@@ -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
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/distinfo  Tue Nov 03 22:46:23 2020 +0000
@@ -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
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/files/smf/manifest.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/files/smf/manifest.xml    Tue Nov 03 22:46:23 2020 +0000
@@ -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>
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/files/zabbix_agentd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/files/zabbix_agentd.sh    Tue Nov 03 22:46:23 2020 +0000
@@ -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
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/options.mk        Tue Nov 03 22:46:23 2020 +0000
@@ -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
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/patches/patch-configure
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/patches/patch-configure   Tue Nov 03 22:46:23 2020 +0000
@@ -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; }
diff -r ec6268353acc -r 0970630400c9 sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/zabbix50-agent/patches/patch-src_libs_zbxsysinfo_netbsd_net.c    Tue Nov 03 22:46:23 2020 +0000
@@ -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");



Home | Main Index | Thread Index | Old Index