public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running
@ 2025-03-17 19:51 Adolf Belka
  2025-03-17 19:51 ` [PATCH 2/3] collectd.conf: Fixes bug13832 - include openvpn plugin line commented out by default Adolf Belka
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adolf Belka @ 2025-03-17 19:51 UTC (permalink / raw)
  To: development; +Cc: Adolf Belka

- Added code to check if openvpn.pid exists and only then uncomment the include openvpn
   plugin line in collectd.conf
- Tested out on my vm testbed and the include openvpn plugin line in collectd.conf is
   only uncommented if the openvpn server is run ning and has a pid.

Fixes: Bug13832
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 src/initscripts/system/collectd | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/initscripts/system/collectd b/src/initscripts/system/collectd
index 263511fc7..f86b64e9d 100644
--- a/src/initscripts/system/collectd
+++ b/src/initscripts/system/collectd
@@ -143,6 +143,13 @@ case "$1" in
 			sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
 		fi
 
+		# Enable openvpn plugin if openvpn.pid found
+		if [ ! -e /var/run/openvpn.pid ]; then
+			sed -i -e 's|^include "/etc/collectd.vpn"$|#include "/etc/collectd.vpn"|g' /etc/collectd.conf
+		else
+			sed -i -e 's|^#include "/etc/collectd.vpn"$|include "/etc/collectd.vpn"|g' /etc/collectd.conf
+		fi
+
 		if [ $(date +%Y) -gt 2011 ]; then
 			boot_mesg "Starting Collection daemon..."
 			/usr/sbin/collectd -C /etc/collectd.conf
-- 
2.49.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-21 12:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-17 19:51 [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running Adolf Belka
2025-03-17 19:51 ` [PATCH 2/3] collectd.conf: Fixes bug13832 - include openvpn plugin line commented out by default Adolf Belka
2025-03-17 19:51 ` [PATCH 3/3] ovpnmain.cgi: Fixes bug13832 - restart collectd initscript on openvpn server status change Adolf Belka
2025-03-19 15:56 ` [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running Michael Tremer
2025-03-19 17:09   ` Adolf Belka
2025-03-21 12:34     ` Michael Tremer
2025-03-21 12:41     ` Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox