I have figured out how to update my VMWare Tools based on which version of ESXi that I am running. But I can’t write a relevance for it. Any help would be appreciated.
We have ESXi 4.0 and ESXi 4.1 in our environment, and I want to write the correct tools to the correct client.
Here is what I have so far.
To find out which version of ESXi host the VM is running on, I check
values “FileVersion” of version blocks of file (“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”)
If it returns a number starting with 4.0.0, then I know it is a ESXi 4.0, if it returns a number starting with 8 then I know it is a ESXi 4.1
Then I can find out if the tools are up to date by running these 2 analysis, on ESXi 4.0
(first 5 of it = “4.0.0” and following text of first “build-” of it as integer >= 398348) of (values “FileVersion” of version blocks of file (“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”))
On ESXi 4.1
(first 10 of it = “8.3.7.4937”) of (values “FileVersion” of version blocks of file (“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”))
I want to combine all these into one relevance, that will tell me if my VM is on a ESXi 4.0 or ESXi 4.1 host, and whether the tools are up to date.
This is going to be used in an Analysis, then once I have it up and running, I will integrate it into a Fixlet Relevance that will update the VMWare Tools based on the information provided.
it says if it = 4 then check the version for 4 else check the version for 8
if (first 1 of it of values
"FileVersion" of version blocks of file (
"C:\Program Files\VMware\VMware Tools\VMwareTray.exe")) =
"4" then ((first 1 of it =
"4" and following text of first
"build-" of it as integer >= 398348) of (values
"FileVersion" of version blocks of file (
"C:\Program Files\VMware\VMware Tools\VMwareTray.exe")))
else ((first 10 of it =
"8.3.7.4937") of (values
"FileVersion" of version blocks of file (
"C:\Program Files\VMware\VMware Tools\VMwareTray.exe")))
if
(
first 1 of it of values “FileVersion” of version blocks of file
Now here’s something to think about… we have thousands of VM Guests on many many VC’s around the world…
what we do here is every 24 hours we run a PS script to gather all of the Guest info from every VC and save it to a single CSV file locally on the BES server.
Then every day the client grabs that file through a POLICY action and then returns data to the console for its self.
We have an analysis then that picks all of that data out of the CSV file for the line that equals the host name of the guest
the problem is if the Guest name does not match the host name…but you can see what guests dont have any data and fix the guest name in the VC
The data i’m currently gathering for each VM Guest is