mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 10:58:12 +00:00
Added a check when VM is down, the values are not numerical
This commit is contained in:
parent
64c6ef66d7
commit
49a49e8c9d
1 changed files with 9 additions and 0 deletions
|
@ -73,6 +73,9 @@ function VMoverallCpuUsage () {
|
||||||
while read c ; do
|
while read c ; do
|
||||||
temp="${c/*overallCpuUsage = /}"
|
temp="${c/*overallCpuUsage = /}"
|
||||||
vmcpu[$n]="${temp/,*/}"
|
vmcpu[$n]="${temp/,*/}"
|
||||||
|
if [ "${vmcpu[$n]}" == "<unset>" ]; then
|
||||||
|
vmcpu[$n]="0"
|
||||||
|
fi
|
||||||
(( n++ ))
|
(( n++ ))
|
||||||
done <<EOF
|
done <<EOF
|
||||||
$cpulist
|
$cpulist
|
||||||
|
@ -85,6 +88,9 @@ function VMoverallGuestMemUsage () {
|
||||||
while read m ; do
|
while read m ; do
|
||||||
temp="${m/*guestMemoryUsage = /}"
|
temp="${m/*guestMemoryUsage = /}"
|
||||||
vmmem[$n]="${temp/,*/}"
|
vmmem[$n]="${temp/,*/}"
|
||||||
|
if [ "${vmmem[$n]}" == "<unset>" ]; then
|
||||||
|
vmmem[$n]="0"
|
||||||
|
fi
|
||||||
(( n++ ))
|
(( n++ ))
|
||||||
done <<EOF
|
done <<EOF
|
||||||
$memlist
|
$memlist
|
||||||
|
@ -97,6 +103,9 @@ function VMoverallHostMemUsage () {
|
||||||
while read m ; do
|
while read m ; do
|
||||||
temp="${m/*hostMemoryUsage = /}"
|
temp="${m/*hostMemoryUsage = /}"
|
||||||
vmmem[$n]="${temp/,*/}"
|
vmmem[$n]="${temp/,*/}"
|
||||||
|
if [ "${vmmem[$n]}" == "<unset>" ]; then
|
||||||
|
vmmem[$n]="0"
|
||||||
|
fi
|
||||||
(( n++ ))
|
(( n++ ))
|
||||||
done <<EOF
|
done <<EOF
|
||||||
$memlist
|
$memlist
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue