git: cd3812a835f5 - main - net-mgmt/observium: update to 24.12

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 16 Mar 2025 10:20:32 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cd3812a835f5b7cfc755db5e40710fd3f7665d12

commit cd3812a835f5b7cfc755db5e40710fd3f7665d12
Author:     Mark Huizer <xaaports@dohd.org>
AuthorDate: 2025-03-15 14:43:53 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-03-16 10:19:28 +0000

    net-mgmt/observium: update to 24.12
    
     - submitter becomes maintainer
    
    PR:             276040
---
 net-mgmt/observium/Makefile                        | 62 ++++++--------
 net-mgmt/observium/distinfo                        |  6 +-
 net-mgmt/observium/files/observium.conf.sample.in  |  4 +-
 .../files/patch-includes_defaults.inc.php          | 95 ++++++++++------------
 net-mgmt/observium/files/patch-poller-wrapper.py   | 13 ++-
 net-mgmt/observium/files/pkg-message.in            | 59 +++++++-------
 6 files changed, 107 insertions(+), 132 deletions(-)

diff --git a/net-mgmt/observium/Makefile b/net-mgmt/observium/Makefile
index 1291d92f7bc3..6a0e5a0b9695 100644
--- a/net-mgmt/observium/Makefile
+++ b/net-mgmt/observium/Makefile
@@ -1,15 +1,11 @@
-# Observium version can be found by looking at ${WRKSRC}/includes/definitions/version.inc.php
-
 PORTNAME=	observium
-PORTVERSION=	0.19.8
-PORTREVISION=	3
+DISTVERSION=	24.12
 CATEGORIES=	net-mgmt
-MASTER_SITES=	http://www.observium.org/
-DISTNAME=	${PORTNAME}-community-latest
-DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
+MASTER_SITES=	https://www.observium.org/
 PKGNAMESUFFIX=	${PHP_PKGNAMESUFFIX}
+DISTNAME=	${PORTNAME}-community-${DISTVERSION}
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	xaaports@dohd.org
 COMMENT=	Autodiscovering PHP/MySQL/SNMP based network monitoring
 WWW=		https://observium.org
 
@@ -18,49 +14,41 @@ LICENSE_NAME=	"Observium License Version 1.0"
 LICENSE_FILE=	${WRKSRC}/LICENSE.COMMUNITY
 LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
-WRKSRC=		${WRKDIR}/${PORTNAME}
+LIB_DEPENDS=	libpng.so:graphics/png
+RUN_DEPENDS=	rrdtool:databases/rrdtool \
+		dot:graphics/graphviz \
+		mtr:net/mtr@nox11 \
+		${LOCALBASE}/share/pear/Net/IPv4.php:net/pear-Net_IPv4@${PHP_FLAVOR} \
+		${LOCALBASE}/share/pear/Net/IPv6.php:net/pear-Net_IPv6@${PHP_FLAVOR} \
+		snmpget:net-mgmt/net-snmp \
+		sudo:security/sudo
 
-USES=		cpe php:cli,flavors python shebangfix
-IGNORE_WITH_PHP=	82 83 84
+USES=		cpe php:cli,flavors,mod python shebangfix
+USE_PHP=	ctype filter gd iconv mysqli posix session snmp tokenizer xml zlib
 SHEBANG_FILES=	\
 		poller-wrapper.py \
 		poller.php \
 		scripts/
 
-USE_PHP=	ctype filter gd iconv mcrypt mysqli posix session snmp tokenizer xml zlib
-
 NO_ARCH=	yes
 NO_BUILD=	yes
+WRKSRC=		${WRKDIR}/${PORTNAME}
 
-RUN_DEPENDS+=	rrdtool:databases/rrdtool \
-		dot:graphics/graphviz \
-		mtr:net/mtr@nox11 \
-		${LOCALBASE}/share/pear/Net/IPv4.php:net/pear-Net_IPv4@${PHP_FLAVOR} \
-		${LOCALBASE}/share/pear/Net/IPv6.php:net/pear-Net_IPv6@${PHP_FLAVOR} \
-		snmpget:net-mgmt/net-snmp \
-		sudo:security/sudo
-LIB_DEPENDS+=	libpng.so:graphics/png
-
-OPTIONS_DEFINE=	APACHEMOD DOCS EXAMPLES FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS NMAP PYPOLLER SUBVERSION WMIC
-OPTIONS_DEFAULT=	APACHEMOD FPING IPMITOOL LIBVIRT NAGPLUGINS NMAP PYPOLLER SUBVERSION WMIC
+OPTIONS_DEFINE=	APACHEMOD DOCS EXAMPLES FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS PYPOLLER SUBVERSION WMIC
+OPTIONS_DEFAULT=	APACHEMOD FPING IPMITOOL LIBVIRT NAGPLUGINS PYPOLLER SUBVERSION WMIC
 APACHEMOD_DESC=	Use PHP with Apache 2.4+ module
 FPING_DESC=	Enable fping support ping monitoring
 IPMITOOL_DESC=	Enable support for monitoring hardware IPMI
 MYSQLD_DESC=	Use local MySQL server
-WMIC_DESC=	Enable support for WMI polling
 PYPOLLER_DESC=	Enable Python Poller Wrapper
+WMIC_DESC=	Enable support for WMI polling
 
 FPING_RUN_DEPENDS=	fping:net/fping
 IPMITOOL_RUN_DEPENDS=	ipmitool:sysutils/ipmitool
 LIBVIRT_RUN_DEPENDS=	virsh:devel/libvirt
 NAGPLUGINS_RUN_DEPENDS=	${LOCALBASE}/libexec/nagios/check_nagios:net-mgmt/nagios-plugins
-NMAP_RUN_DEPENDS=	nmap:security/nmap
 PYPOLLER_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mysqlclient>=1.3.13:databases/py-mysqlclient@${PY_FLAVOR}
-.if ${WITH_SUBVERSION_VER:U} == LTS
-SUBVERSION_RUN_DEPENDS=	svn:devel/subversion-lts
-.else
 SUBVERSION_RUN_DEPENDS=	svn:devel/subversion
-.endif
 WMIC_RUN_DEPENDS=	wmic:net-mgmt/wmi-client
 
 .include <bsd.port.options.mk>
@@ -69,11 +57,11 @@ SUB_FILES+=	pkg-message observium.conf.sample
 SUB_LIST+=	PHP="${PREFIX}/bin/php" PYTHON="${PYTHON_CMD}"
 
 ROOT_FILES=	add_device.php adduser.php alerter.php \
-		check-errors.php check-services.php config_to_json.php \
-		config.php.default delete_device.php discovery.php housekeeping.php \
-		irc.php poller-wrapper.py poller.php rename_device.php \
-		snmp.conf.example snmpd.conf.example \
-		snmptrap.php snmptrap.php syslog.php test_alert.php test_code.php VERSION
+		config.php.default config_to_json.php \
+		delete_device.php discovery.php housekeeping.php \
+		irc.php notifications.php observium-wrapper poller-wrapper.py poller.php \
+		rename_device.php snmp.conf.example snmpd.conf.example \
+		snmptrap.php syslog.php test_alert.php test_code.php test_db.php test_geo.php VERSION
 ROOT_DIRS=	html includes libs logs mibs rrd scripts templates tests update
 
 PORTDOCS=	INSTALL README VERSION
@@ -85,7 +73,7 @@ USES+=	apache:run
 .if !defined(PACKAGE_BUILDING)
 USES+=	php:mod
 .else
-# Package builder doesn't create php5 with module
+# Package builder doesn't create php8 with module
 USES+=	php:web
 .endif
 
@@ -95,7 +83,7 @@ USES+=	mysql:server
 USES+=	mysql:client
 .endif
 
-post-patch:
+pre-install:
 	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py ${WRKSRC}/poller.php
 	${FIND} ${WRKSRC} -type d -empty -delete
 	${MKDIR} ${WRKSRC}/logs ${WRKSRC}/rrd
diff --git a/net-mgmt/observium/distinfo b/net-mgmt/observium/distinfo
index c37487935100..33cc2457e319 100644
--- a/net-mgmt/observium/distinfo
+++ b/net-mgmt/observium/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1577933625
-SHA256 (observium-0.19.8/observium-community-latest.tar.gz) = 0603cc81c1fede6b87b187fde64843e11d6ed44f32705c68c41ddccf05d90d5b
-SIZE (observium-0.19.8/observium-community-latest.tar.gz) = 85994042
+TIMESTAMP = 1741551019
+SHA256 (observium-community-24.12.tar.gz) = 477c492f756caa8d2faba40b66a53b13754513d1f42fb777568a522db783a6fb
+SIZE (observium-community-24.12.tar.gz) = 130705254
diff --git a/net-mgmt/observium/files/observium.conf.sample.in b/net-mgmt/observium/files/observium.conf.sample.in
index dbcb702254cc..7e8de82ec22c 100644
--- a/net-mgmt/observium/files/observium.conf.sample.in
+++ b/net-mgmt/observium/files/observium.conf.sample.in
@@ -12,8 +12,8 @@
 LoadModule rewrite_module libexec/apache24/mod_rewrite.so
 </IfModule>
 
-<IfModule !php7_module>
-LoadModule php7_module        libexec/apache24/libphp7.so
+<IfModule !php_module>
+LoadModule php_module        libexec/apache24/libphp.so
 </IfModule>
 
 Listen *:8080
diff --git a/net-mgmt/observium/files/patch-includes_defaults.inc.php b/net-mgmt/observium/files/patch-includes_defaults.inc.php
index eabe68f28e85..5ddafff92bc3 100644
--- a/net-mgmt/observium/files/patch-includes_defaults.inc.php
+++ b/net-mgmt/observium/files/patch-includes_defaults.inc.php
@@ -1,63 +1,54 @@
---- includes/defaults.inc.php.orig	2019-08-23 07:09:46 UTC
+--- includes/defaults.inc.php.orig	2024-12-23 01:13:57 UTC
 +++ includes/defaults.inc.php
-@@ -57,7 +57,7 @@ $config['db']['debug']      = TRUE;        // If TRUE 
+@@ -77,7 +77,7 @@ $config['db']['debug'] = FALSE;       // If TRUE store
  
  // Default directories
  
 -#$config['install_dir']   = "/opt/observium";
-+$config['install_dir']   = "/usr/local/www/observium";
++#$config['install_dir']   = "/usr/local/www/observium";
  #$config['html_dir']      = $config['install_dir'] . "/html";
  #$config['rrd_dir']       = $config['install_dir'] . "/rrd";
  #$config['template_dir']  = $config['install_dir'] . "/templates";
-@@ -71,30 +71,30 @@ $config['db']['debug']      = TRUE;        // If TRUE 
+@@ -93,26 +93,26 @@ $config['db']['debug'] = FALSE;       // If TRUE store
  
  // Location of executables
  
--$config['rrdtool']        = "/usr/bin/rrdtool";
--$config['fping']          = "/usr/bin/fping";
--$config['fping6']         = "/usr/bin/fping6";
--$config['snmpwalk']       = "/usr/bin/snmpwalk";
--$config['snmpget']        = "/usr/bin/snmpget";
--$config['snmpgetnext']    = "/usr/bin/snmpgetnext";
--$config['snmpbulkget']    = "/usr/bin/snmpbulkget";
--$config['snmpbulkwalk']   = "/usr/bin/snmpbulkwalk";
--$config['snmptranslate']  = "/usr/bin/snmptranslate";
-+$config['rrdtool']        = "/usr/local/bin/rrdtool";
-+$config['fping']          = "/usr/local/sbin/fping";
-+$config['fping6']         = "/usr/local/sbin/fping6";
-+$config['snmpwalk']       = "/usr/local/bin/snmpwalk";
-+$config['snmpget']        = "/usr/local/bin/snmpget";
-+$config['snmpgetnext']    = "/usr/local/bin/snmpgetnext";
-+$config['snmpbulkget']    = "/usr/local/bin/snmpbulkget";
-+$config['snmpbulkwalk']   = "/usr/local/bin/snmpbulkwalk";
-+$config['snmptranslate']  = "/usr/local/bin/snmptranslate";
- $config['whois']          = "/usr/bin/whois";
--$config['mtr']            = "/usr/bin/mtr";
--$config['nmap']           = "/usr/bin/nmap";
--$config['ipmitool']       = "/usr/bin/ipmitool";
--$config['virsh']          = "/usr/bin/virsh";
--$config['dot']            = "/usr/bin/dot";
--$config['unflatten']      = "/usr/bin/unflatten";
--$config['neato']          = "/usr/bin/neato";
--$config['sfdp']           = "/usr/bin/sfdp";
--$config['svn']            = "/usr/bin/svn";
--$config['git']            = "/usr/bin/git"; // Used in show device config feature for git-enabled repos and rancid >= 3.2
--$config['wmic']           = "/bin/wmic";
-+$config['mtr']            = "/usr/local/sbin/mtr";
-+$config['nmap']           = "/usr/local/bin/nmap";
-+$config['ipmitool']       = "/usr/local/bin/ipmitool";
-+$config['virsh']          = "/usr/local/bin/virsh";
-+$config['dot']            = "/usr/local/bin/dot";
-+$config['unflatten']      = "/usr/local/bin/unflatten";
-+$config['neato']          = "/usr/local/bin/neato";
-+$config['sfdp']           = "/usr/local/bin/sfdp";
-+$config['svn']            = "/usr/local/bin/svn";
-+$config['git']            = "/usr/local/bin/git"; // Used in show device config feature for git-enabled repos and rancid >= 3.2
-+$config['wmic']           = "/usr/local/bin/wmic";
- $config['file']           = "/usr/bin/file";
- $config['wc']             = "/usr/bin/wc";
--$config['sudo']           = "/usr/bin/sudo";
-+$config['sudo']           = "/usr/local/bin/sudo";
- $config['tail']           = "/usr/bin/tail";
- $config['cut']            = "/usr/bin/cut";
- $config['tr']             = "/usr/bin/tr";
+-$config['rrdtool']       = "/usr/bin/rrdtool";
+-$config['fping']         = "/usr/bin/fping";
+-$config['fping6']        = "/usr/bin/fping6"; // Note, for version 4+ not required
+-$config['snmpwalk']      = "/usr/bin/snmpwalk";
+-$config['snmpget']       = "/usr/bin/snmpget";
+-$config['snmpgetnext']   = "/usr/bin/snmpgetnext";
+-$config['snmpbulkget']   = "/usr/bin/snmpbulkget";
+-$config['snmpbulkwalk']  = "/usr/bin/snmpbulkwalk";
+-$config['snmptranslate'] = "/usr/bin/snmptranslate";
++$config['rrdtool']       = "/usr/local/bin/rrdtool";
++$config['fping']         = "/usr/local/sbin/fping";
++$config['fping6']        = "/usr/local/sbin/fping6"; // Note, for version 4+ not required
++$config['snmpwalk']      = "/usr/local/bin/snmpwalk";
++$config['snmpget']       = "/usr/local/bin/snmpget";
++$config['snmpgetnext']   = "/usr/local/bin/snmpgetnext";
++$config['snmpbulkget']   = "/usr/local/bin/snmpbulkget";
++$config['snmpbulkwalk']  = "/usr/local/bin/snmpbulkwalk";
++$config['snmptranslate'] = "/usr/local/bin/snmptranslate";
+ $config['whois']         = "/usr/bin/whois";     // ip_whois()
+-$config['mtr']           = "/usr/bin/mtr";       // is_pingable()
+-$config['ipmitool']      = "/usr/bin/ipmitool";  // ipmi module
+-$config['virsh']         = "/usr/bin/virsh";     // libvirt module
+-$config['wmic']          = "/bin/wmic";          // wmi_cmd()
+-$config['dot']           = "/usr/bin/dot";       // Graphviz, networkmap (only)
++$config['mtr']           = "/usr/local/sbin/mtr";       // is_pingable()
++$config['ipmitool']      = "/usr/local/bin/ipmitool";  // ipmi module
++$config['virsh']         = "/usr/local/bin/virsh";     // libvirt module
++$config['wmic']          = "/usr/local/bin/wmic";          // wmi_cmd()
++$config['dot']           = "/usr/local/bin/dot";       // Graphviz, networkmap (only)
+ //$config['unflatten']     = "/usr/bin/unflatten"; // Graphviz, networkmap (only, unused)
+ //$config['neato']         = "/usr/bin/neato";     // Graphviz (unused)
+ //$config['sfdp']          = "/usr/bin/sfdp";      // Graphviz, networkmap (only, unused)
+-$config['svn']           = "/usr/bin/svn";
+-$config['git']           = "/usr/bin/git"; // Used in show device config feature for git-enabled repos and rancid >= 3.2
++$config['svn']           = "/usr/local/bin/svn";
++$config['git']           = "/usr/local/bin/git"; // Used in show device config feature for git-enabled repos and rancid >= 3.2
+ //$config['nmap']          = "/usr/bin/nmap"; // unused
+ //$config['file']          = "/usr/bin/file"; // unused
+ //$config['wc']            = "/usr/bin/wc";   // unused
diff --git a/net-mgmt/observium/files/patch-poller-wrapper.py b/net-mgmt/observium/files/patch-poller-wrapper.py
index 32438e9a36ff..8ad06711a42a 100644
--- a/net-mgmt/observium/files/patch-poller-wrapper.py
+++ b/net-mgmt/observium/files/patch-poller-wrapper.py
@@ -1,11 +1,10 @@
---- poller-wrapper.py.orig	2017-12-02 14:04:45 UTC
+--- poller-wrapper.py.orig	2025-03-15 14:27:22 UTC
 +++ poller-wrapper.py
-@@ -72,6 +72,8 @@ except:
-     print("threading, sys, subprocess, os, json")
+@@ -63,6 +63,7 @@ except ImportError:
+     print("threading, sys, subprocess, os, json, stat")
      sys.exit(2)
  
 +os.environ['PATH'] += ':%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin'
-+
- """
-     Register global exepthook for ability stop execute wrapper by Ctrl+C
-     See: https://stackoverflow.com/questions/6598053/python-global-exception-handling
+ 
+ def new_except_hook(exctype, value, traceback):
+     """
diff --git a/net-mgmt/observium/files/pkg-message.in b/net-mgmt/observium/files/pkg-message.in
index 89c190cfb964..c63cad79ee50 100644
--- a/net-mgmt/observium/files/pkg-message.in
+++ b/net-mgmt/observium/files/pkg-message.in
@@ -3,28 +3,26 @@
   message: <<EOM
 === Configuration details ===
 You can mostly follow the guide at:
-http://observium.org/wiki/Installation
+https://observium.org/wiki/Installation
 
 with the following notes:
 - Installation directory is %%WWWDIR%%
-- The following lines should be added to /etc/crontab:
-
-33	*/6	*	*	*	www	cd %%WWWDIR%% && %%PHP%% discovery.php -h all
-*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PHP%% discovery.php -h new
-*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PHP%% poller.php -h all
-*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PYTHON%% poller-wrapper.py 2
+- The following lines should be put in a file %%LOCALBASE%%/etc/cron.d/observium
+  or alternatively /etc/cron.d/observium
+
+# Run a complete discovery of all devices once every 6 hours
+33	*/6	*	*	*	www	%%WWWDIR%%/observium-wrapper discovery >/dev/null 2>&1
+# Run automated discovery of newly added devices every 5 minutes
+*/5	*	*	*	*	www	%%WWWDIR%%/observium-wrapper discovery --host new >/dev/null 2>&1
+# Run multithreaded poller wrapper every 5 minutes
+*/5	*	*	*	*	www	%%WWWDIR%%/observium-wrapper poller >/dev/null 2>&1
+# Run housekeeping script daily for syslog, eventlog and alert log
+13	5	*	*	*	www	%%WWWDIR%%/housekeeping.php -ysel >/dev/null 2>&1
+# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data
+47	4	*	*	*	www	%%WWWDIR%%/housekeeping.php -yrptb >/dev/null 2>&1
 
 Notes:
 
-- With newer MySQL databases you may need to disable strict mode for
-  Observium to function:
-
-	SET GLOBAL sql_mode = '';
-
-- Apache needs mod_rewrite enabled; uncomment the line below in httpd.conf as needed.
-
-    LoadModule rewrite_module libexec/apache24/mod_rewrite.so
-
 - A minimal install can be created with the following steps and configuration file:
 
 0: make sure apache and mysql are up and running.
@@ -33,29 +31,27 @@ Notes:
 
     CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
     GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY 'notSecure';
-    SET GLOBAL sql_mode = '';
 
-2: create a minimal config file at:
+2: create config file starting with the sample config file
 
-	 %%WWWDIR%%/config.php
+        cp %%WWWDIR%%/config.php.default %%WWWDIR%%/config.php
 
-    containing:
+   and make sure to set at least the following fields:
 
-<?php
-$config['db_host'] = 'localhost';
-$config['db_user'] = 'observium';
-$config['db_pass'] = 'notSecure';
-$config['db_name'] = 'observium';
+        $config['db_host'] = 'localhost';
+        $config['db_user'] = 'observium';
+        $config['db_pass'] = 'notSecure';
+        $config['db_name'] = 'observium';
 
 3:  populate the admin user and initialize the database (as 'www' user):
 
-sudo -u www %%WWWDIR%%/discovery.php -u
-sudo -u www %%WWWDIR%%/adduser.php admin SomeInsecureAdminPassword 10
+        sudo -u www %%WWWDIR%%/discovery.php -u
+        sudo -u www %%WWWDIR%%/adduser.php admin SomeInsecureAdminPassword 10
 
 4:   and verify that collection is working:
 
-sudo -u www %%WWWDIR%%/discovery.php -h all -d
-sudo -u www %%WWWDIR%%/poller.php -h all -d
+        sudo -u www %%WWWDIR%%/discovery.php -h all -d
+        sudo -u www %%WWWDIR%%/poller.php -h all -d
 
 5: Install the above crontabs.
 
@@ -63,11 +59,12 @@ sudo -u www %%WWWDIR%%/poller.php -h all -d
 
    %%PREFIX%%/%%APACHEETCDIR%%/Includes/observium.conf
    
-   and fill out a port number and hostname. 
+   and fill out a port number and hostname, or use the
+   default at port 8080.
 
 7: restart the webserver with 
 
-       apachectl restart
+       service apache24 restart
 
    or stop/start if in case of IP or SSL changes.