Skip to content

Commit e9f64f5

Browse files
committed
fix(podman-info,podman-stats): add sudoers entries and run via sudo
1 parent 72a9587 commit e9f64f5

File tree

8 files changed

+14
-5
lines changed

8 files changed

+14
-5
lines changed

assets/sudoers/Debian.sudoers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Cmnd_Alias LF_NAGIOS = /usr/lib64/nagios/plugins/about-me,\
2525
/usr/lib64/nagios/plugins/openvpn-client-list,\
2626
/usr/lib64/nagios/plugins/path-rw-test,\
2727
/usr/lib64/nagios/plugins/php-status,\
28+
/usr/lib64/nagios/plugins/podman-info,\
29+
/usr/lib64/nagios/plugins/podman-stats,\
2830
/usr/lib64/nagios/plugins/restic-check,\
2931
/usr/lib64/nagios/plugins/restic-snapshots,\
3032
/usr/lib64/nagios/plugins/restic-stats,\

assets/sudoers/RedHat.sudoers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Cmnd_Alias LF_NAGIOS = /usr/lib64/nagios/plugins/about-me,\
2525
/usr/lib64/nagios/plugins/openvpn-client-list,\
2626
/usr/lib64/nagios/plugins/path-rw-test,\
2727
/usr/lib64/nagios/plugins/php-status,\
28+
/usr/lib64/nagios/plugins/podman-info,\
29+
/usr/lib64/nagios/plugins/podman-stats,\
2830
/usr/lib64/nagios/plugins/restic-check,\
2931
/usr/lib64/nagios/plugins/restic-snapshots,\
3032
/usr/lib64/nagios/plugins/restic-stats,\

check-plugins/podman-info/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
Displays system-wide Podman information. For Docker, use the [docker-info](https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/docker-info) check instead.
66

7+
Hints:
8+
9+
* Podman runs rootless by default. Without `sudo`, the check only sees containers of the executing user. To monitor containers across all users, run the check via `sudo` (the Icinga Director basket and sudoers file are pre-configured for this).
10+
711

812
## Fact Sheet
913

check-plugins/podman-info/icingaweb2-module-director/podman-info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"set_if": "$podman_info_always_ok$"
77
}
88
},
9-
"command": "/usr/lib64/nagios/plugins/podman-info",
9+
"command": "/usr/bin/sudo /usr/lib64/nagios/plugins/podman-info",
1010
"disabled": false,
1111
"fields": [
1212
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
overwrites:
3-
'["Command"]["cmd-check-podman-info"]["command"]': '/usr/lib64/nagios/plugins/podman-info'
3+
'["Command"]["cmd-check-podman-info"]["command"]': '/usr/bin/sudo /usr/lib64/nagios/plugins/podman-info'
44
'["ServiceTemplate"]["tpl-service-podman-info"]["check_interval"]': 86400
55
'["ServiceTemplate"]["tpl-service-podman-info"]["enable_perfdata"]': true
66
'["ServiceTemplate"]["tpl-service-podman-info"]["retry_interval"]': 60

check-plugins/podman-stats/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ This check prints cpu and memory statistics for all running Podman containers, u
66

77
Hints:
88

9+
* Podman runs rootless by default. Without `sudo`, the check only sees containers of the executing user. To monitor containers across all users, run the check via `sudo` (the Icinga Director basket and sudoers file are pre-configured for this).
910
* Plugin execution may take up to 10 seconds.
10-
* Since `podman stats` only returns byte-level data in a human-readable format (e.g. *4.82GB*), calculating network I/O (`RX bps`, `TX bps`) and block I/O (`BlockIn/s`, `BlockOut/s`) is imprecise. Therefore, these values are not used at all.
11+
* Since `podman stats` only returns byte-level data in a human-readable format (e.g. *221.2kB*), calculating network I/O and block I/O is imprecise. Therefore, these values are not used.
1112

1213

1314
## Fact Sheet

check-plugins/podman-stats/icingaweb2-module-director/podman-stats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"value": "$podman_stats_warning_mem$"
2525
}
2626
},
27-
"command": "/usr/lib64/nagios/plugins/podman-stats",
27+
"command": "/usr/bin/sudo /usr/lib64/nagios/plugins/podman-stats",
2828
"disabled": false,
2929
"fields": [
3030
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
overwrites:
3-
'["Command"]["cmd-check-podman-stats"]["command"]': '/usr/lib64/nagios/plugins/podman-stats'
3+
'["Command"]["cmd-check-podman-stats"]["command"]': '/usr/bin/sudo /usr/lib64/nagios/plugins/podman-stats'
44
'["Command"]["cmd-check-podman-stats"]["timeout"]': 20
55
'["ServiceTemplate"]["tpl-service-podman-stats"]["enable_perfdata"]': true

0 commit comments

Comments
 (0)