- As requested in bug 13074, create a collectd.d directory to enable any addon definitions to be created. - Added include statement in conf file to load everything that is stored in the collectd.d directory. - Moved collectd.precache and collectd.thermal to the collectd.d directory and modified the paths for them in the collectd.conf file. - Modified the path for the collectd.thermal file in the initscript. - Removed the arm section in the initscript as only aarch64 is now used. - Modified the lfs to account for the changed directory for the precache and thermal files - Update of rootfile to take account of new path. - Removal of collectd.custom file as this was the previous way to define custom collectd profiles but would have been overwritten by any update of collectd. - Tested out in vm testbed with Core Update 187 and all existing graphs were still created and updated. From my evaluation the changes have not affected anything. - The creation of the collectd.d directory now allows users to add their own desired profiles but also if it is decided that an addon should be included in the processes graph, or if a new graph for addons is created then profiles for that addon can be placed in the collectd.d directory and will be automatically included by collectd.
Fixes: Bug13074 Tested-by: Adolf Belka adolf.belka@ipfire.org Signed-off-by: Adolf Belka adolf.belka@ipfire.org --- config/collectd/collectd.conf | 7 +++---- config/collectd/collectd.custom | 1 - config/rootfiles/common/collectd | 8 ++++---- lfs/collectd | 10 ++++++---- src/initscripts/system/collectd | 9 +++------ 5 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 config/collectd/collectd.custom
diff --git a/config/collectd/collectd.conf b/config/collectd/collectd.conf index cc49f0ba7..ec0c7a6a3 100644 --- a/config/collectd/collectd.conf +++ b/config/collectd/collectd.conf @@ -30,7 +30,7 @@ LoadPlugin syslog #LoadPlugin wireless LoadPlugin match_regex
-include "/etc/collectd.precache" +include "/etc/collectd.d/collectd.precache"
<Plugin interface> Interface "lo" @@ -86,6 +86,5 @@ include "/etc/collectd.precache" LogLevel info </Plugin>
-#include "/etc/collectd.thermal" -include "/etc/collectd.custom" -include "/etc/collectd.vpn" +#include "/etc/collectd.d/collectd.thermal" +include "/etc/collectd.d/*" diff --git a/config/collectd/collectd.custom b/config/collectd/collectd.custom deleted file mode 100644 index 7443bf3e6..000000000 --- a/config/collectd/collectd.custom +++ /dev/null @@ -1 +0,0 @@ -# Use this file to add custom configs and rules for collectd diff --git a/config/rootfiles/common/collectd b/config/rootfiles/common/collectd index 65408dc7f..8a12fa844 100644 --- a/config/rootfiles/common/collectd +++ b/config/rootfiles/common/collectd @@ -1,8 +1,8 @@ etc/collectd.conf -etc/collectd.custom -etc/collectd.precache -etc/collectd.thermal -etc/collectd.vpn +#etc/collectd.d +etc/collectd.d/collectd.vpn +etc/collectd.d/collectd.precache +etc/collectd.d/collectd.thermal etc/rc.d/rc0.d/K50collectd etc/rc.d/rc3.d/S29collectd etc/rc.d/rc6.d/K50collectd diff --git a/lfs/collectd b/lfs/collectd index 24f5bc632..3f0deca26 100644 --- a/lfs/collectd +++ b/lfs/collectd @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -125,10 +125,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) --with-librrd=/usr/share/rrdtool-1.2.30 \ --with-fp-layout=nothing cd $(DIR_APP) && make install #collectd-4 does not support parallel build - cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/ - mv /etc/collectd.vpn /var/ipfire/ovpn/collectd.vpn + mkdir /etc/collectd.d + cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/collectd.d/ + mv /etc/collectd.d/collectd.vpn /var/ipfire/ovpn/collectd.vpn + mv /etc/collectd.d/collectd.conf /etc/ chown nobody.nobody /var/ipfire/ovpn/collectd.vpn - ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.vpn + ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.d/collectd.vpn ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd ln -f -s ../init.d/collectd /etc/rc.d/rc3.d/S29collectd ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd diff --git a/src/initscripts/system/collectd b/src/initscripts/system/collectd index 56b799d56..79a81ce6a 100644 --- a/src/initscripts/system/collectd +++ b/src/initscripts/system/collectd @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2022 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -68,9 +68,6 @@ case "$1" in # ARM does not support to scan for sensors. In that case, # we create an empty configuration file. machine=$(uname -m) - if [ "${machine:0:3}" = "arm" ]; then - touch /etc/sysconfig/lm_sensors - fi if [ "${machine:0:7}" = "aarch64" ]; then touch /etc/sysconfig/lm_sensors fi @@ -127,9 +124,9 @@ case "$1" in
# Enable thermal plugin if thermal_zone found if [ ! -e /sys/class/thermal/thermal_zone0 ]; then - sed -i -e 's|^include "/etc/collectd.thermal"$|#include "/etc/collectd.thermal"|g' /etc/collectd.conf + sed -i -e 's|^include "/etc/collectd.d/collectd.thermal"$|#include "/etc/collectd.d/collectd.thermal"|g' /etc/collectd.conf else - sed -i -e 's|^#include "/etc/collectd.thermal"$|include "/etc/collectd.thermal"|g' /etc/collectd.conf + sed -i -e 's|^#include "/etc/collectd.d/collectd.thermal"$|include "/etc/collectd.d/collectd.thermal"|g' /etc/collectd.conf fi
# Enable cpufreq plugin if cpufreq found
Hello,
I think this is generally be acceptable.
However, wouldn’t the precache file be loaded twice? Should we rather not leave that one where it is right now? Or just copy and paste it into collectd.conf?
-Michael
On 6 Aug 2024, at 11:21, Adolf Belka adolf.belka@ipfire.org wrote:
- As requested in bug 13074, create a collectd.d directory to enable any addon definitions to be created.
- Added include statement in conf file to load everything that is stored in the collectd.d directory.
- Moved collectd.precache and collectd.thermal to the collectd.d directory and modified the paths for them in the collectd.conf file.
- Modified the path for the collectd.thermal file in the initscript.
- Removed the arm section in the initscript as only aarch64 is now used.
- Modified the lfs to account for the changed directory for the precache and thermal files
- Update of rootfile to take account of new path.
- Removal of collectd.custom file as this was the previous way to define custom collectd profiles but would have been overwritten by any update of collectd.
- Tested out in vm testbed with Core Update 187 and all existing graphs were still created and updated. From my evaluation the changes have not affected anything.
- The creation of the collectd.d directory now allows users to add their own desired profiles but also if it is decided that an addon should be included in the processes graph, or if a new graph for addons is created then profiles for that addon can be placed in the collectd.d directory and will be automatically included by collectd.
Fixes: Bug13074 Tested-by: Adolf Belka adolf.belka@ipfire.org Signed-off-by: Adolf Belka adolf.belka@ipfire.org
config/collectd/collectd.conf | 7 +++---- config/collectd/collectd.custom | 1 - config/rootfiles/common/collectd | 8 ++++---- lfs/collectd | 10 ++++++---- src/initscripts/system/collectd | 9 +++------ 5 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 config/collectd/collectd.custom
diff --git a/config/collectd/collectd.conf b/config/collectd/collectd.conf index cc49f0ba7..ec0c7a6a3 100644 --- a/config/collectd/collectd.conf +++ b/config/collectd/collectd.conf @@ -30,7 +30,7 @@ LoadPlugin syslog #LoadPlugin wireless LoadPlugin match_regex
-include "/etc/collectd.precache" +include "/etc/collectd.d/collectd.precache"
<Plugin interface> Interface "lo" @@ -86,6 +86,5 @@ include "/etc/collectd.precache" LogLevel info </Plugin>
-#include "/etc/collectd.thermal" -include "/etc/collectd.custom" -include "/etc/collectd.vpn" +#include "/etc/collectd.d/collectd.thermal" +include "/etc/collectd.d/*" diff --git a/config/collectd/collectd.custom b/config/collectd/collectd.custom deleted file mode 100644 index 7443bf3e6..000000000 --- a/config/collectd/collectd.custom +++ /dev/null @@ -1 +0,0 @@ -# Use this file to add custom configs and rules for collectd diff --git a/config/rootfiles/common/collectd b/config/rootfiles/common/collectd index 65408dc7f..8a12fa844 100644 --- a/config/rootfiles/common/collectd +++ b/config/rootfiles/common/collectd @@ -1,8 +1,8 @@ etc/collectd.conf -etc/collectd.custom -etc/collectd.precache -etc/collectd.thermal -etc/collectd.vpn +#etc/collectd.d +etc/collectd.d/collectd.vpn +etc/collectd.d/collectd.precache +etc/collectd.d/collectd.thermal etc/rc.d/rc0.d/K50collectd etc/rc.d/rc3.d/S29collectd etc/rc.d/rc6.d/K50collectd diff --git a/lfs/collectd b/lfs/collectd index 24f5bc632..3f0deca26 100644 --- a/lfs/collectd +++ b/lfs/collectd @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -125,10 +125,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) --with-librrd=/usr/share/rrdtool-1.2.30 \ --with-fp-layout=nothing cd $(DIR_APP) && make install #collectd-4 does not support parallel build
- cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/
- mv /etc/collectd.vpn /var/ipfire/ovpn/collectd.vpn
- mkdir /etc/collectd.d
- cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/collectd.d/
- mv /etc/collectd.d/collectd.vpn /var/ipfire/ovpn/collectd.vpn
- mv /etc/collectd.d/collectd.conf /etc/
chown nobody.nobody /var/ipfire/ovpn/collectd.vpn
- ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.vpn
- ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.d/collectd.vpn
ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd ln -f -s ../init.d/collectd /etc/rc.d/rc3.d/S29collectd ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd diff --git a/src/initscripts/system/collectd b/src/initscripts/system/collectd index 56b799d56..79a81ce6a 100644 --- a/src/initscripts/system/collectd +++ b/src/initscripts/system/collectd @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2022 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -68,9 +68,6 @@ case "$1" in # ARM does not support to scan for sensors. In that case, # we create an empty configuration file. machine=$(uname -m)
- if [ "${machine:0:3}" = "arm" ]; then
- touch /etc/sysconfig/lm_sensors
- fi
if [ "${machine:0:7}" = "aarch64" ]; then touch /etc/sysconfig/lm_sensors fi @@ -127,9 +124,9 @@ case "$1" in
# Enable thermal plugin if thermal_zone found if [ ! -e /sys/class/thermal/thermal_zone0 ]; then
- sed -i -e 's|^include "/etc/collectd.thermal"$|#include "/etc/collectd.thermal"|g' /etc/collectd.conf
- sed -i -e 's|^include "/etc/collectd.d/collectd.thermal"$|#include "/etc/collectd.d/collectd.thermal"|g' /etc/collectd.conf
else
- sed -i -e 's|^#include "/etc/collectd.thermal"$|include "/etc/collectd.thermal"|g' /etc/collectd.conf
- sed -i -e 's|^#include "/etc/collectd.d/collectd.thermal"$|include "/etc/collectd.d/collectd.thermal"|g' /etc/collectd.conf
fi
# Enable cpufreq plugin if cpufreq found
2.45.2
Hi Michael,
On 06/08/2024 17:57, Michael Tremer wrote:
Hello,
I think this is generally be acceptable.
However, wouldn’t the precache file be loaded twice? Should we rather not leave that one where it is right now? Or just copy and paste it into collectd.conf?
You are correct, it would be loaded twice. Also the thermal file would end up being loaded, even if the include for that file had not been edited by the initscript so it would end up loaded when it shouldn't be and maybe twice when it should be included.
I will do a v2 patch submission with the precache and thermal and probably the openvpn files left where they were previously so that the include/collectd.d is then only for new addon profiles for the future.
Regards, Adolf.
-Michael
On 6 Aug 2024, at 11:21, Adolf Belka adolf.belka@ipfire.org wrote:
- As requested in bug 13074, create a collectd.d directory to enable any addon definitions to be created.
- Added include statement in conf file to load everything that is stored in the collectd.d directory.
- Moved collectd.precache and collectd.thermal to the collectd.d directory and modified the paths for them in the collectd.conf file.
- Modified the path for the collectd.thermal file in the initscript.
- Removed the arm section in the initscript as only aarch64 is now used.
- Modified the lfs to account for the changed directory for the precache and thermal files
- Update of rootfile to take account of new path.
- Removal of collectd.custom file as this was the previous way to define custom collectd profiles but would have been overwritten by any update of collectd.
- Tested out in vm testbed with Core Update 187 and all existing graphs were still created and updated. From my evaluation the changes have not affected anything.
- The creation of the collectd.d directory now allows users to add their own desired profiles but also if it is decided that an addon should be included in the processes graph, or if a new graph for addons is created then profiles for that addon can be placed in the collectd.d directory and will be automatically included by collectd.
Fixes: Bug13074 Tested-by: Adolf Belka adolf.belka@ipfire.org Signed-off-by: Adolf Belka adolf.belka@ipfire.org
config/collectd/collectd.conf | 7 +++---- config/collectd/collectd.custom | 1 - config/rootfiles/common/collectd | 8 ++++---- lfs/collectd | 10 ++++++---- src/initscripts/system/collectd | 9 +++------ 5 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 config/collectd/collectd.custom
diff --git a/config/collectd/collectd.conf b/config/collectd/collectd.conf index cc49f0ba7..ec0c7a6a3 100644 --- a/config/collectd/collectd.conf +++ b/config/collectd/collectd.conf @@ -30,7 +30,7 @@ LoadPlugin syslog #LoadPlugin wireless LoadPlugin match_regex
-include "/etc/collectd.precache" +include "/etc/collectd.d/collectd.precache"
<Plugin interface> Interface "lo" @@ -86,6 +86,5 @@ include "/etc/collectd.precache" LogLevel info </Plugin>
-#include "/etc/collectd.thermal" -include "/etc/collectd.custom" -include "/etc/collectd.vpn" +#include "/etc/collectd.d/collectd.thermal" +include "/etc/collectd.d/*" diff --git a/config/collectd/collectd.custom b/config/collectd/collectd.custom deleted file mode 100644 index 7443bf3e6..000000000 --- a/config/collectd/collectd.custom +++ /dev/null @@ -1 +0,0 @@ -# Use this file to add custom configs and rules for collectd diff --git a/config/rootfiles/common/collectd b/config/rootfiles/common/collectd index 65408dc7f..8a12fa844 100644 --- a/config/rootfiles/common/collectd +++ b/config/rootfiles/common/collectd @@ -1,8 +1,8 @@ etc/collectd.conf -etc/collectd.custom -etc/collectd.precache -etc/collectd.thermal -etc/collectd.vpn +#etc/collectd.d +etc/collectd.d/collectd.vpn +etc/collectd.d/collectd.precache +etc/collectd.d/collectd.thermal etc/rc.d/rc0.d/K50collectd etc/rc.d/rc3.d/S29collectd etc/rc.d/rc6.d/K50collectd diff --git a/lfs/collectd b/lfs/collectd index 24f5bc632..3f0deca26 100644 --- a/lfs/collectd +++ b/lfs/collectd @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -125,10 +125,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) --with-librrd=/usr/share/rrdtool-1.2.30 \ --with-fp-layout=nothing cd $(DIR_APP) && make install #collectd-4 does not support parallel build
- cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/
- mv /etc/collectd.vpn /var/ipfire/ovpn/collectd.vpn
- mkdir /etc/collectd.d
- cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/collectd.d/
- mv /etc/collectd.d/collectd.vpn /var/ipfire/ovpn/collectd.vpn
- mv /etc/collectd.d/collectd.conf /etc/
chown nobody.nobody /var/ipfire/ovpn/collectd.vpn
- ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.vpn
- ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.d/collectd.vpn
ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd ln -f -s ../init.d/collectd /etc/rc.d/rc3.d/S29collectd ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd diff --git a/src/initscripts/system/collectd b/src/initscripts/system/collectd index 56b799d56..79a81ce6a 100644 --- a/src/initscripts/system/collectd +++ b/src/initscripts/system/collectd @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2022 IPFire Team info@ipfire.org # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -68,9 +68,6 @@ case "$1" in # ARM does not support to scan for sensors. In that case, # we create an empty configuration file. machine=$(uname -m)
- if [ "${machine:0:3}" = "arm" ]; then
- touch /etc/sysconfig/lm_sensors
- fi
if [ "${machine:0:7}" = "aarch64" ]; then touch /etc/sysconfig/lm_sensors fi @@ -127,9 +124,9 @@ case "$1" in
# Enable thermal plugin if thermal_zone found if [ ! -e /sys/class/thermal/thermal_zone0 ]; then
- sed -i -e 's|^include "/etc/collectd.thermal"$|#include "/etc/collectd.thermal"|g' /etc/collectd.conf
- sed -i -e 's|^include "/etc/collectd.d/collectd.thermal"$|#include "/etc/collectd.d/collectd.thermal"|g' /etc/collectd.conf
else
- sed -i -e 's|^#include "/etc/collectd.thermal"$|include "/etc/collectd.thermal"|g' /etc/collectd.conf
- sed -i -e 's|^#include "/etc/collectd.d/collectd.thermal"$|include "/etc/collectd.d/collectd.thermal"|g' /etc/collectd.conf
fi
# Enable cpufreq plugin if cpufreq found
2.45.2