Révision 748cf3b4
- 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
| plugins/lxc/lxc_guests | ||
|---|---|---|
| 121 | 121 |
|
| 122 | 122 |
if [ -f "$lxcpath/$guest_name/config" ]; then |
| 123 | 123 |
# lxc 3 vs < 3 |
| 124 |
(grep -EF '^lxc.net.0.veth.pair' "$lxcpath/$guest_name/config" 2>/dev/null \
|
|
| 125 |
|| grep -EF '^lxc.network.veth.pair' "$lxcpath/$guest_name/config"
|
|
| 124 |
(grep -E '^lxc.net.0.veth.pair' "$lxcpath/$guest_name/config" 2>/dev/null \ |
|
| 125 |
|| grep -E '^lxc.network.veth.pair' "$lxcpath/$guest_name/config" |
|
| 126 | 126 |
) | awk '{print $NF;}'
|
| 127 | 127 |
fi |
| 128 | 128 |
} |
| ... | ... | |
| 152 | 152 |
for SYSFS in \ |
| 153 | 153 |
"/sys/fs/cgroup/$guest_name/tasks" \ |
| 154 | 154 |
"/sys/fs/cgroup/lxc/$guest_name/tasks" \ |
| 155 |
"/sys/fs/cgroup/systemd/lxc/$guest_name/tasks" \ |
|
| 156 | 155 |
"/sys/fs/cgroup/cpuacct/lxc/$guest_name/tasks" \ |
| 156 |
"/sys/fs/cgroup/systemd/lxc/$guest_name/tasks" \ |
|
| 157 | 157 |
"/sys/fs/cgroup/cpuacct/sysdefault/lxc/$guest_name/tasks" |
| 158 | 158 |
do |
| 159 | 159 |
if [ -e "$SYSFS" ]; then |
| ... | ... | |
| 372 | 372 |
fi |
| 373 | 373 |
|
| 374 | 374 |
cat <<EOF |
| 375 |
$(clean_fieldname "net_${guest_name}_up").value $value_up
|
|
| 376 |
$(clean_fieldname "net_${guest_name}_down").value $value_down
|
|
| 375 |
$(clean_fieldname "net_${guest_name}_up").value $value_up
|
|
| 376 |
$(clean_fieldname "net_${guest_name}_down").value $value_down
|
|
| 377 | 377 |
EOF |
| 378 | 378 |
done |
| 379 | 379 |
|
| ... | ... | |
| 387 | 387 |
for guest_name in $active_guests |
| 388 | 388 |
do |
| 389 | 389 |
cat <<EOF |
| 390 |
$(clean_fieldname "mem_usage_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.usage_in_bytes")
|
|
| 391 |
$(clean_fieldname "mem_cache_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.stat" | grep total_cache | awk '{print $2;}')
|
|
| 392 |
$(clean_fieldname "mem_active_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.stat" | grep total_active_anon | awk '{print $2;}')
|
|
| 393 |
$(clean_fieldname "mem_inactive_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.stat" | grep total_inactive_anon | awk '{print $2;}')
|
|
| 390 |
$(clean_fieldname "mem_usage_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.usage_in_bytes")
|
|
| 391 |
$(clean_fieldname "mem_cache_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.stat" | grep total_cache | awk '{print $2;}')
|
|
| 392 |
$(clean_fieldname "mem_active_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.stat" | grep total_active_anon | awk '{print $2;}')
|
|
| 393 |
$(clean_fieldname "mem_inactive_${guest_name}").value $(get_lxc_cgroup_info "$guest_name" "memory.stat" | grep total_inactive_anon | awk '{print $2;}')
|
|
| 394 | 394 |
EOF |
| 395 | 395 |
done |
| 396 | 396 |
} |
Formats disponibles : Unified diff