dnaeon / py-vpoller

Distributed vSphere API Proxy
Other
83 stars 31 forks source link

Datastore discover for zabbix issue #250

Closed Huron closed 6 years ago

Huron commented 6 years ago

Discover request gets a list of storage:

root@zabbix:~# zabbix_get -s 10.9.2.52 -k 'vpoller["datastore.discover", "10.9.2.48", "null", "name"]'
{"data": [{"{#VSPHERE.DATASTORE.NAME}": "storage-33-2"}, {"{#VSPHERE.DATASTORE.NAME}": "datastore1"}, {"{#VSPHERE.DATASTORE.NAME}": "31-local-1"}, {"{#VSPHERE.DATASTORE.NAME}": "storage-33-1"}, {"{#VSPHERE.DATASTORE.NAME}": "31-local-2"}, {"{#VSPHERE.DATASTORE.NAME}": "datastore2"}, {"{#VSPHERE.DATASTORE.NAME}": "Datastore"}, {"{#VSPHERE.DATASTORE.NAME}": "vsanDatastore"}]}

But when I try to get a status of the storage I got an error:

root@zabbix:~# zabbix_get -s 10.9.2.52 -k 'vpoller["datastore.get", "10.9.2.48", "storage-33-2", "overallStatus", "null"]'
Cannot find object storage-33-2
dnaeon commented 6 years ago

Can you run the vpoller-cli tool against that datastore and let me know if you are able to query it?

Also, if you import the datastores using the zabbix-vsphere-import script do you see any errors like the one you describe?

dnaeon commented 6 years ago

Actually, I see what is the issue here - you need to use the info.url property as well during discovery, which is what is being used for the datastores.

Please run your discovery command and make sure to include name and info.url properties.

Then for the get command you need to pass in the info.url of the datastore you are interested in.

Huron commented 6 years ago

It's working! So thenks!