From 7cb5d1b47a556130d2768b1ac1f33a13a9a45dd8 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Tue, 24 Mar 2026 19:50:41 +0100 Subject: [PATCH] Add/update sudo configuration to all collectors with 'use_sudo' --- collectors/gpfsMetric.md | 13 +++++++++++++ collectors/ipmiMetric.md | 6 +++--- collectors/lustreMetric.md | 13 +++++++++++++ collectors/smartmonMetric.md | 15 +++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/collectors/gpfsMetric.md b/collectors/gpfsMetric.md index 02fff3d..d716a0a 100644 --- a/collectors/gpfsMetric.md +++ b/collectors/gpfsMetric.md @@ -81,3 +81,16 @@ Metrics: * `gpfs_metaops_rate` (if `send_total_values == true` and `send_derived_values == true`) The collector adds a `filesystem` tag to all metrics + +`mmpmon` typically require root to run. +In order to run `cc-metric-collector` without root priviliges, you can enable `use_sudo`. +Add a file like this in `/etc/sudoers.d/` to allow `cc-metric-collector` to run the required command: + +``` +# Do not log the following sudo commands from monitoring, since this causes a lot of log spam. +# However keep log_denied enabled, to detect failures +Defaults: monitoring !log_allowed, !pam_session + +# Allow to use mmpmon +monitoring ALL = (root) NOPASSWD:/absolute/path/to/mmpmon -p -s +``` \ No newline at end of file diff --git a/collectors/ipmiMetric.md b/collectors/ipmiMetric.md index 3407a70..c1269f2 100644 --- a/collectors/ipmiMetric.md +++ b/collectors/ipmiMetric.md @@ -23,9 +23,9 @@ The `ipmistat` collector reads data from `ipmitool` (`ipmitool sensor`) or `ipmi The metrics depend on the output of the underlying tools but contain temperature, power and energy metrics. -ipmitool and ipmi-sensors typically require root to run. -In order to cc-metric-collector without root priviliges, you can enable `use_sudo`. -Add a file like this in /etc/sudoers.d/ to allow cc-metric-collector to run this command: +`ipmitool` and `ipmi-sensors` typically require root to run. +In order to run `cc-metric-collector` without root priviliges, you can enable `use_sudo`. +Add a file like this in `/etc/sudoers.d/` to allow `cc-metric-collector` to run the required commands: ``` # Do not log the following sudo commands from monitoring, since this causes a lot of log spam. diff --git a/collectors/lustreMetric.md b/collectors/lustreMetric.md index 428841b..8de09f3 100644 --- a/collectors/lustreMetric.md +++ b/collectors/lustreMetric.md @@ -55,3 +55,16 @@ Metrics: * `lustre_inode_permission_diff` (if `send_diff_values == true`) This collector adds an `device` tag. + +`lctl` typically require root to run. +In order to run `cc-metric-collector` without root priviliges, you can enable `use_sudo`. +Add a file like this in `/etc/sudoers.d/` to allow `cc-metric-collector` to run the required command: + +``` +# Do not log the following sudo commands from monitoring, since this causes a lot of log spam. +# However keep log_denied enabled, to detect failures +Defaults: monitoring !log_allowed, !pam_session + +# Allow to use lctl +monitoring ALL = (root) NOPASSWD:/absolute/path/to/lctl get_param llite.*.stats +``` \ No newline at end of file diff --git a/collectors/smartmonMetric.md b/collectors/smartmonMetric.md index 1d995e3..a91ec10 100644 --- a/collectors/smartmonMetric.md +++ b/collectors/smartmonMetric.md @@ -50,3 +50,18 @@ Metrics: * `smartmon_errlog_entries`: Error log entries * `smartmon_warn_temp_time`: Time above the warning temperature threshold * `smartmon_crit_comp_time`: Time above the critical composite temperature threshold + +`smartctl` typically require root to run. +In order to run `cc-metric-collector` without root priviliges, you can enable `use_sudo`. +Add a file like this in `/etc/sudoers.d/` to allow `cc-metric-collector` to run the required command: + +``` +# Do not log the following sudo commands from monitoring, since this causes a lot of log spam. +# However keep log_denied enabled, to detect failures +Defaults: monitoring !log_allowed, !pam_session + +# Allow to use lctl +monitoring ALL = (root) NOPASSWD:/absolute/path/to/smartctl --json=c --device=* "--all" * +# Or add individual rules for each device +# monitoring ALL = (root) NOPASSWD:/absolute/path/to/smartctl --json=c --device= "--all" +``` \ No newline at end of file