munin-monitoring / munin

Main repository for munin master / node / plugins
http://munin-monitoring.org
Other
1.99k stars 474 forks source link

psu plugin is not compatible with BusyBox pgrep #1437

Open cl-parsons opened 2 years ago

cl-parsons commented 2 years ago

OS: Alpine Linux 3.14 Munin version : 2.0.67

The "-u" option does not exist in BusyBox version of pgrep.

$ munin-run psu_mailman
pgrep: unrecognized option: U
sumpfralle commented 2 years ago

Busybox is a tricky reference :)

Here on my Debian system, there is no pgrep applet enabled in busybox. On an OpenWrt system, busybox contains pgrep, but supports neither -u nor -U (both are used by the plugin).

This specific plugin boils down to a single line:

(pgrep -u "$name"; pgrep -U "$name") | sort -u | wc -l

I see the following options:

I would tend to rule out (C), since a major feature of this specific plugin seems to be its simplicity. (A) feels undesirable to me, since it can be surprising. Thus we are left with (B), I guess.

Or any other ideas?

sertonix commented 3 months ago

Alpine now patches busybox pgrep to add the -u and -U options.

steveschnepp commented 3 months ago

I would tend to favor some sane default, plus a config time change for others via the usual env variables mechanism.