File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,14 @@ GRACE_PERIOD=3600
5
5
6
6
for VMID in ` vim-cmd vmsvc/getallvms | awk ' { if (NR > 1) print $1 }' `
7
7
do
8
- vim-cmd vmsvc/power.getstate $VMID
9
-
10
8
ON=` vim-cmd vmsvc/power.getstate $VMID | grep " Powered on" || EXIT=$? `
11
9
if [[ -n " $ON " ]]; then
12
10
HB=` vim-cmd vmsvc/get.guestheartbeatStatus $VMID `
13
11
if [ " $HB " != " green" ]; then
14
- UPTIME=` vim-cmd vmsvc/get.summary 259 | sed -rn ' s/\ +uptimeSeconds\ =\ ([0-9]+),\ +/\1/p' `
12
+ UPTIME=` vim-cmd vmsvc/get.summary $VMID | sed -rn ' s/\ +uptimeSeconds\ =\ ([0-9]+),\ +/\1/p' `
15
13
if [ " $UPTIME " -gt " $GRACE_PERIOD " ]; then
16
14
echo " Powering off VM: $VMID "
17
- vim-cmd vmsvc/power.off $VMID
15
+ vim-cmd vmsvc/power.off $VMID > /dev/null
18
16
fi
19
17
fi
20
18
fi
You can’t perform that action at this time.
0 commit comments