[packages/cacti-plugin-thold] Up to 1.8.2
arekm
arekm at pld-linux.org
Wed May 20 18:40:08 CEST 2026
commit 9adcfea928dd486046b26675e9b7035325876396
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed May 20 18:39:51 2026 +0200
Up to 1.8.2
cacti-plugin-thold-division_by_zero.patch | 12 ----------
...i-plugin-thold-undefined_variable_subject.patch | 20 ----------------
cacti-plugin-thold.spec | 28 ++++++++--------------
3 files changed, 10 insertions(+), 50 deletions(-)
---
diff --git a/cacti-plugin-thold.spec b/cacti-plugin-thold.spec
index f3e850a..5615145 100644
--- a/cacti-plugin-thold.spec
+++ b/cacti-plugin-thold.spec
@@ -3,18 +3,16 @@
Summary: Plugin for Cacti - Thold
Summary(pl.UTF-8): Wtyczka do Cacti - Thold
Name: cacti-plugin-%{plugin}
-Version: 0.5.0
-Release: 2
+Version: 1.8.2
+Release: 1
License: GPL v2
Group: Applications/WWW
-Source0: http://docs.cacti.net/_media/plugin:thold-v0.5.0.tgz
-# Source0-md5: c2a0f8072dd57c59f9c3608c2d6922cf
-Patch0: %{name}-undefined_variable_subject.patch
-Patch1: %{name}-division_by_zero.patch
-URL: http://docs.cacti.net/plugin:thold
+Source0: https://github.com/Cacti/plugin_thold/archive/refs/tags/v%{version}.tar.gz?/plugin_thold-%{version}.tar.gz
+# Source0-md5: 013ce9d41c9b21c0c04fb175698ecce0
+URL: https://github.com/Cacti/plugin_thold
BuildRequires: rpm-php-pearprov >= 4.4.2-11
Requires: cacti
-Requires: cacti(pia) >= 2.9
+Requires: cacti(pia) >= 3.1
Requires: cacti-plugin-settings >= 0.71
Requires: php(core) >= %{php_min_version}
Requires: php(gd)
@@ -42,24 +40,18 @@ przekroczenia zadanych wartości lub niekorzystnych zmian w przebiegu
monitorowanych parametrów.
%prep
-%setup -qc
-mv %{plugin}/{LICENSE,README} .
-
-# undos the source
-find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
-
-%patch -P0 -p1
-%patch -P1 -p1
+%setup -q -n plugin_thold-%{version}
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{plugindir}
-cp -a %{plugin}/* $RPM_BUILD_ROOT%{plugindir}
+cp -a . $RPM_BUILD_ROOT%{plugindir}
+rm $RPM_BUILD_ROOT%{plugindir}/LICENSE $RPM_BUILD_ROOT%{plugindir}/README.md
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README
+%doc README.md LICENSE
%{plugindir}
diff --git a/cacti-plugin-thold-division_by_zero.patch b/cacti-plugin-thold-division_by_zero.patch
deleted file mode 100644
index 547ffbe..0000000
--- a/cacti-plugin-thold-division_by_zero.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -dur cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php cacti-plugin-thold-0.4.9/thold/thold_functions.php
---- cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php 2012-12-11 17:47:07.000000000 +0100
-+++ cacti-plugin-thold-0.4.9/thold/thold_functions.php 2012-12-11 17:48:34.789180077 +0100
-@@ -1587,7 +1587,7 @@
- thold_debug('Threshold Baseline check breached');
-
- /* re-alert? */
-- $ra = ($item['bl_fail_count'] > $bl_fail_trigger && ($item['bl_fail_count'] % ($item['repeat_alert'] == '' ? $realert : $item['repeat_alert'])) == 0);
-+ $ra = ($item['bl_fail_count'] > $bl_fail_trigger && ($item['bl_fail_count'] % ($item['repeat_alert'] == 0 ? $realert : $item['repeat_alert'])) == 0);
-
- $notify = ($item['bl_fail_count'] == $bl_fail_trigger || $ra);
-
diff --git a/cacti-plugin-thold-undefined_variable_subject.patch b/cacti-plugin-thold-undefined_variable_subject.patch
deleted file mode 100644
index a6e5e58..0000000
--- a/cacti-plugin-thold-undefined_variable_subject.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -dur cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php cacti-plugin-thold-0.4.9/thold/thold_functions.php
---- cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php 2011-11-12 19:29:49.000000000 +0100
-+++ cacti-plugin-thold-0.4.9/thold/thold_functions.php 2012-12-10 08:37:38.000000000 +0100
-@@ -1589,10 +1589,13 @@
- /* re-alert? */
- $ra = ($item['bl_fail_count'] > $bl_fail_trigger && ($item['bl_fail_count'] % ($item['repeat_alert'] == '' ? $realert : $item['repeat_alert'])) == 0);
-
-- if ($item['bl_fail_count'] == $bl_fail_trigger || $ra) {
-+ $notify = ($item['bl_fail_count'] == $bl_fail_trigger || $ra);
-+
-+ $subject = ($notify ? "ALERT: " : "TRIGGER: ") . $item['name'] . ($thold_show_datasource ? " [$name]" : '') . ' ' . ($ra ? 'is still' : 'went') . ' ' . ($breach_up ? 'above' : 'below') . " calculated baseline threshold " . ($breach_up ? $item['thold_hi'] : $item['thold_low']) . " with $currentval";
-+
-+ if ($notify) {
- thold_debug('Alerting is necessary');
-
-- $subject = "ALERT: " . $item['name'] . ($thold_show_datasource ? " [$name]" : '') . ' ' . ($ra ? 'is still' : 'went') . ' ' . ($breach_up ? 'above' : 'below') . " calculated baseline threshold " . ($breach_up ? $item['thold_hi'] : $item['thold_low']) . " with $currentval";
-
- if ($logset == 1) {
- logger($item['name'], $breach_up, ($breach_up ? $item['thold_hi'] : $item['thold_low']), $currentval, $item['bl_fail_trigger'], $item['bl_fail_count'], $url);
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/cacti-plugin-thold.git/commitdiff/9adcfea928dd486046b26675e9b7035325876396
More information about the pld-cvs-commit
mailing list