Jannos-443 / PRTG-VMware-Status

checks VMware VM Status for example VMware Tools, Heartbeat, CDDrive Connected and Overall State
MIT License
5 stars 1 forks source link

Exclude only vmtools check #2

Closed cipo80 closed 3 months ago

cipo80 commented 4 months ago

Hi Jannos,

I'm using your script since 2021, very thank you for the great job, you saved me many times:).

I've some virtual appliances without the vmtools, to avoid the warning I've put the VMs in the $IgnorePattern exclusion, but by this way the VMs are excluded to all checks. At the beginning of the script, in the comments notes, you write: "If exceptions have to be made on a per sensor level, the script parameter VMIgnorePattern or AlarmIgnorePattern can be used.

Can you give me some tips to implement this exclusion?

Thank you in advance

Jannos-443 commented 4 months ago

Hey cipo,

I am happy that this script helps you :) Could you check if the branch "2-exclude-only-vmtools-check" fits your needs?

Best Regards, Jannos

cipo80 commented 4 months ago

Hi Jannos,

just tried, but I received the generic: "The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)"

I swapped the .ps1 files in the PRTG keeping the same parameters.

Thank you again!

Jannos-443 commented 3 months ago

@cipo80 could you try the new version in the branch? Maybe you also have to right click "unblock" the file.

Otherwise if it is still not working, please enable "store result" and upload the complete ".txt" log (not the ".Data.txt" one)

if it is working you should be able to exclude vmware for vmwaretools check with the -ExcludeVM_VMTools '^(ServerName1|ServerName2)$' command

cipo80 commented 3 months ago

@cipo80 could you try the new version in the branch? Maybe you also have to right click "unblock" the file.

Otherwise if it is still not working, please enable "store result" and upload the complete ".txt" log (not the ".Data.txt" one)

if it is working you should be able to exclude vmware for vmwaretools check with the -ExcludeVM_VMTools '^(ServerName1|ServerName2)$' command

Hi Jannos, just tried and with unblock the script it's working! There's still a problem, the -ExcludeVM_VMTools seems to not working good, I've a VM without the tools installed, declared in the PRTG parameters, but the script mark the error. If I use the -IgnorePattern the VM is exclude correctly, like the first script release, please check the images and store result TXT attached (edited without sensible data).

Thank you again for your time and have a great day!

Result of Sensor 6459.txt 2024-07-24_09h54_37 2024-07-24_09h54_32

Jannos-443 commented 3 months ago

Next try please :) I also changed quite a bit to add some other excludes.

hopefully it works now, I don´t have a option to test it currently, thats the reason we have to test it this way.

cipo80 commented 3 months ago

Hi Jannos,

just tried and nothing change, BUT I've found the problem in the script, there is a typo repeated many times, please replace all the $exlude with the correct one $exclude and the script working like a charm!

Thank you for your (spare) time to implement my request, have a great w.end!

Jannos-443 commented 3 months ago

good catch :D fixed it and I wish you also a great weekend 👍🏻