mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Added a check when VM is down, the values are not numerical
This commit is contained in:
parent
64c6ef66d7
commit
49a49e8c9d
@ -73,6 +73,9 @@ function VMoverallCpuUsage () {
|
||||
while read c ; do
|
||||
temp="${c/*overallCpuUsage = /}"
|
||||
vmcpu[$n]="${temp/,*/}"
|
||||
if [ "${vmcpu[$n]}" == "<unset>" ]; then
|
||||
vmcpu[$n]="0"
|
||||
fi
|
||||
(( n++ ))
|
||||
done <<EOF
|
||||
$cpulist
|
||||
@ -85,6 +88,9 @@ function VMoverallGuestMemUsage () {
|
||||
while read m ; do
|
||||
temp="${m/*guestMemoryUsage = /}"
|
||||
vmmem[$n]="${temp/,*/}"
|
||||
if [ "${vmmem[$n]}" == "<unset>" ]; then
|
||||
vmmem[$n]="0"
|
||||
fi
|
||||
(( n++ ))
|
||||
done <<EOF
|
||||
$memlist
|
||||
@ -97,6 +103,9 @@ function VMoverallHostMemUsage () {
|
||||
while read m ; do
|
||||
temp="${m/*hostMemoryUsage = /}"
|
||||
vmmem[$n]="${temp/,*/}"
|
||||
if [ "${vmmem[$n]}" == "<unset>" ]; then
|
||||
vmmem[$n]="0"
|
||||
fi
|
||||
(( n++ ))
|
||||
done <<EOF
|
||||
$memlist
|
||||
|
Loading…
Reference in New Issue
Block a user