From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Cc: Adolf Belka <adolf.belka@ipfire.org>
Subject: [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running
Date: Mon, 17 Mar 2025 20:51:21 +0100 [thread overview]
Message-ID: <20250317195123.2092-1-adolf.belka@ipfire.org> (raw)
- 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
next reply other threads:[~2025-03-17 19:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 19:51 Adolf Belka [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250317195123.2092-1-adolf.belka@ipfire.org \
--to=adolf.belka@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox