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

Monitor several esxi hosts #1

Open JerBiz44 opened 1 year ago

JerBiz44 commented 1 year ago

Hi Jannos,

Good morning and thanks you again for this great sensor !

All is working fine on my side if i monitor the Vcenter. But i have a global vcenter who manage every sites of my company in different towns. The network consumed between the prtg probe and the Vcenter is too big.

We must provide the view on these Vmware alerts, on a local side. It is possible for you to gave us the ability to have the same output in a "local view" scanning each esxi host ?

The idea is to have a setting like this :

-ViServer 'esxihost1|esxihost2|...' -User "%windowsuser" -Password "%windowspassword"

Can you activate this feature for all your VMware sensors ? It would be super :)

Thanks very much.

Jannos-443 commented 1 year ago

Hi JerBiz, your problem is that your global vcenter got so many vm´s that the script runs slow right?

could you test https://github.com/Jannos-443/PRTG-VMware-Snapshot/blob/main/PRTG-VMware-Snapshot_test.ps1 with -IncludeVMHost '^(ESXIHosts-USWEST.*)$'

This way it would be possible just get the vm´s from a single esxi host (or only esxi hosts from us west) even if we use the global vcenter. Would this solve your problem? As far as I know there is no option to use the API against a esxi direct.

JerBiz44 commented 1 year ago

Hi Jannos,

Thanks for your quick answer. My first problem was due to the network bandwidth consumed between the prtg probe and the vcenter (90 gb for 1 month). We have only one vcenter to drive all local vmware clusters. I must limit the communication between the probe and the vmware hosts in the same network, to improve the impact on the network.

In this idea, i can not continue to extract the data from the vcenter.

Indeed we have a lot of vms but change the timeout to 120 instead of 60 sec is fine to have the output.

Acutally the script is working fine for only one esxi host. I'm able to have the output but only for this Esxi Host.

With this setting : -ViServer 'esxihost1.domain.local' -User "%windowsuser" -Password "%windowspassword"

But if i want to know all alerts on a local side, i must duplicate all vmware sensors (vmware status/vmware check/vmware snapshot) per esxi hosts.

The idea was to have one sensor to take all data from all members of a local cluster , (esxihost1.domain.local+esxihost2.domain.local+esxihost3.domain.local+esxihost4.domain.local) => then merge the result in prtg

Thanks again for your time !

Jannos-443 commented 1 year ago

Hi JerBiz44,

okay I understand.

Could you try the latest "https://github.com/Jannos-443/PRTG-VMware-Snapshot/blob/main/PRTG-VMware-Snapshot_test.ps1" and use the parameter: -ViServer 'esxihost1.domain.local,esxihost2.domain.local,esxihost3.domain.local' -User "%windowsuser" -Password "%windowspassword"

The ViServer parameter is now an array and should take multiple vcenter/esxi hosts.

JerBiz44 commented 1 year ago

Hi Jannos,

Thanks very much for the support !

I have this error : Could not connect to vCenter server esxihost1.domain.local,esxihost2.domain.local,esxihost3.domain.local. Error: Failed to connect: Invalid URI: The hostname could not be parsed.

I also try to use | instead of the , but i have the same result

Jannos-443 commented 1 year ago

My fault, please try like this:

-ViServer ("esxihost1.domain.local","esxihost2.domain.local","esxihost3.domain.local") -User "%windowsuser" -Password "%windowspassword"

JerBiz44 commented 1 year ago

Hi Jannos,

I have the same output : Could not connect to vCenter server ("esxihost1.domain.local","esxihost2.domain.local","esxihost3.domain.local"). Error: Failed to connect: Invalid URI: The hostname could not be parsed.

Jannos-443 commented 1 year ago

Hi JerBizz,

I hope it´s right this time, vscode was behaving different then PRTG would. Please try again the latest Snapshot_test

JerBiz44 commented 1 year ago

Hi Jannos,

I have always the issue but it seems different : I have the same output : Could not connect to vCenter server (esxihost1.domain.local). Error: Failed to connect: Invalid URI: The hostname could not be parsed.

Now the output mentioned only the first esxi host (instead of the 3 hosts where i'm concerned).

I tried to use the | instead of , But the the same error.

Thanks very much for your support !

JerBiz44 commented 1 year ago

Hi Jannos,

Do you have any news for me ? thanks you

Jannos-443 commented 1 year ago

Hi JerBiz,

could you try again with the latest version?

JerBiz44 commented 1 year ago

Hi Jannos,

Bad news, i have the same output/issue.

I tried to configure only one host in the parameter like this :

-ViServer ("esxihost1.domain.local") -User "%windowsuser" -Password "%windowspassword"

And the output show the same error :

Error: Failed to connect: Invalid URI: The hostname could not be parsed.

If i try like this :

-ViServer ("esxihost1.domain.local"|"esxihost2.domain.local") -User "%windowsuser" -Password "%windowspassword"

Something is different, the chanel creation is working, the output mention all esx host concerned in the parameter. But no output due to the same error : The hostname could not be parsed.