mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Plugin virtualbox_*: fix shellcheck issues
This commit is contained in:
parent
1ed78789c1
commit
0987cf33a2
@ -37,8 +37,8 @@ if [ "$1" = "config" ]; then
|
||||
echo 'graph_info This graph shows the percentage of processor time spent in kernel mode by the every single VM process.'
|
||||
echo 'graph_category Virtualization'
|
||||
echo 'graph_period second'
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
||||
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
||||
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
||||
echo "${VM_NAME_PRINT}_kernel.label ${VM_NAME}"
|
||||
done
|
||||
exit 0
|
||||
@ -47,8 +47,7 @@ fi
|
||||
vboxmanage metrics setup --period 5 --samples 3
|
||||
sleep 5
|
||||
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
||||
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||
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/'
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
||||
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
||||
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/'
|
||||
done
|
||||
|
||||
|
@ -37,8 +37,8 @@ if [ "$1" = "config" ]; then
|
||||
echo 'graph_info This graph shows the percentage of processor time spent in user mode by the every single VM process.'
|
||||
echo 'graph_category Virtualization'
|
||||
echo 'graph_period second'
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
||||
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
||||
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
||||
echo "${VM_NAME_PRINT}_user.label ${VM_NAME}"
|
||||
done
|
||||
exit 0
|
||||
@ -47,8 +47,7 @@ fi
|
||||
vboxmanage metrics setup --period 5 --samples 3
|
||||
sleep 5
|
||||
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
||||
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||
vboxmanage metrics query "${VM_NAME}" CPU/Load/User | grep -E "^${VM_NAME}" | sed -r 's/^.*([0-9]+\.[0-9]+)%/'''${VM_NAME_PRINT}'''_user.value \1/'
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
||||
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
||||
vboxmanage metrics query "${VM_NAME}" CPU/Load/User | grep -E "^${VM_NAME}" | sed -r 's/^.*([0-9]+\.[0-9]+)%/'"${VM_NAME_PRINT}"'_user.value \1/'
|
||||
done
|
||||
|
||||
|
@ -34,7 +34,7 @@ if [ "$1" = "autoconf" ]; then
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
RAMTOT=`free -b | grep Mem | awk '{print $2}'`
|
||||
RAMTOT=$(free -b | grep Mem | awk '{print $2}')
|
||||
echo 'graph_title Memory usage of virtual machines'
|
||||
echo "graph_args --base 1024 -r --lower-limit 0 --upper-limit $RAMTOT --units-exponent 9"
|
||||
echo 'graph_vlabel GB'
|
||||
@ -42,11 +42,11 @@ RAMTOT=`free -b | grep Mem | awk '{print $2}'`
|
||||
echo 'graph_category Virtualization'
|
||||
echo 'graph_period second'
|
||||
I=0
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
||||
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
||||
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g')
|
||||
echo "${VM_NAME_PRINT}.label ${VM_NAME}"
|
||||
echo "${VM_NAME_PRINT}.cdef ${VM_NAME_PRINT},1024,*"
|
||||
if [ ${I} -eq 0 ]; then
|
||||
echo "${VM_NAME_PRINT}.cdef ${VM_NAME_PRINT},1024,*"
|
||||
if [ "$I" -eq 0 ]; then
|
||||
echo "${VM_NAME_PRINT}.draw AREA"
|
||||
else
|
||||
echo "${VM_NAME_PRINT}.draw STACK"
|
||||
@ -59,8 +59,8 @@ fi
|
||||
vboxmanage metrics setup --period 5 --samples 3
|
||||
sleep 5
|
||||
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read VM_NAME; do
|
||||
VM_NAME_PRINT=`echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g'` # s/[.]/_/g;s/[ ]/_/g;s/[-]/_/g
|
||||
vboxmanage metrics query "${VM_NAME}" RAM/Usage/Used | grep -E "^${VM_NAME}" | sed -r 's/^.* ([0-9]+) kB$/'''${VM_NAME_PRINT}'''.value \1/'
|
||||
vboxmanage list vms | sed -r 's/^\"(.*)\" \{.*\}$/\1/' | while read -r VM_NAME; do
|
||||
VM_NAME_PRINT=$(echo -e "${VM_NAME}" | sed 's/[^A-Za-z0-9_]/_/g') # s/[.]/_/g;s/[ ]/_/g;s/[-]/_/g
|
||||
vboxmanage metrics query "${VM_NAME}" RAM/Usage/Used | grep -E "^${VM_NAME}" | sed -r 's/^.* ([0-9]+) kB$/'"${VM_NAME_PRINT}"'.value \1/'
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user