Shack
7 months agoAdvisor
ESX Host Services?
I'm looking for a way to monitor ESX Host Services. Right now I have a script that I believed to be working but after spot checking a few hosts it seems to not be totally accurate. Or, I just don't...
Think I figured out my problem and it was here when printing the status I wasn't including the index. However, doing this breaks the evaluation of the status using 1 or 0. in the part of the script where status is defined.
println "${wildvalue}.status=${status[index]}"
I was able to get this figured out by moving a couple of things around.
Instead of using the value of 1 or 0 on line 1 I moved it to line 2
def status = service?.service?.running //? 1 : 0
def runningstate = status[index] ? 1 : 0
Then for my println
println "${wildvalue}.status:${runningstate}"
Everything works