1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

- grep -EF is invalid

- SYSFS: buster has an existing /sys/fs/cgroup/systemd/lxc/$guest_name/tasks,
         which does not contain anything useful, so checking
         /sys/fs/cgroup/cpuacct/lxc/$guest_name/tasks first.
- spurious blank space for lxc_net and lxc_ram in here document
This commit is contained in:
Marc SCHAEFER 2019-08-19 15:07:16 +02:00
parent 6e452ac6dc
commit 748cf3b4ee

View file

@ -121,8 +121,8 @@ lxc_netdev() {
if [ -f "$lxcpath/$guest_name/config" ]; then
# lxc 3 vs < 3
(grep -EF '^lxc.net.0.veth.pair' "$lxcpath/$guest_name/config" 2>/dev/null \
|| grep -EF '^lxc.network.veth.pair' "$lxcpath/$guest_name/config"
(grep -E '^lxc.net.0.veth.pair' "$lxcpath/$guest_name/config" 2>/dev/null \
|| grep -E '^lxc.network.veth.pair' "$lxcpath/$guest_name/config"
) | awk '{print $NF;}'
fi
}
@ -152,8 +152,8 @@ lxc_count_processes () {
for SYSFS in \
"/sys/fs/cgroup/$guest_name/tasks" \
"/sys/fs/cgroup/lxc/$guest_name/tasks" \
"/sys/fs/cgroup/systemd/lxc/$guest_name/tasks" \
"/sys/fs/cgroup/cpuacct/lxc/$guest_name/tasks" \
"/sys/fs/cgroup/systemd/lxc/$guest_name/tasks" \
"/sys/fs/cgroup/cpuacct/sysdefault/lxc/$guest_name/tasks"
do
if [ -e "$SYSFS" ]; then