Révision 0987cf33
Plugin virtualbox_*: fix shellcheck issues
| plugins/virtualbox/virtualbox_cpu_kernel | ||
|---|---|---|
| 37 | 37 |
echo 'graph_info This graph shows the percentage of processor time spent in kernel mode by the every single VM process.' |
| 38 | 38 |
echo 'graph_category Virtualization' |
| 39 | 39 |
echo 'graph_period second' |
| 40 |
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
|
| 41 |
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
|
| 40 |
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
|
| 41 |
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
|
| 42 | 42 |
echo "${VM_NAME_PRINT}_kernel.label ${VM_NAME}"
|
| 43 | 43 |
done |
| 44 | 44 |
exit 0 |
| ... | ... | |
| 47 | 47 |
vboxmanage metrics setup --period 5 --samples 3 |
| 48 | 48 |
sleep 5 |
| 49 | 49 |
|
| 50 |
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
|
| 51 |
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
|
| 52 |
vboxmanage metrics query "${VM_NAME}" CPU/Load/Kernel | grep -E "^${VM_NAME}" | sed -r 's/^.*([0-9]+\.[0-9]+)%/'''${VM_NAME_PRINT}'''_kernel.value \1/'
|
|
| 50 |
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
|
| 51 |
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
|
| 52 |
vboxmanage metrics query "${VM_NAME}" CPU/Load/Kernel | grep -E "^${VM_NAME}" | sed -r 's/^.*([0-9]+\.[0-9]+)%/'"${VM_NAME_PRINT}"'_kernel.value \1/'
|
|
| 53 | 53 |
done |
| 54 |
|
|
Formats disponibles : Unified diff