dav3860 / vmbix

Fork of vmbix, a TCP proxy for querying a VMWare infrastucture with Zabbix
53 stars 19 forks source link

vmbix-discovery : urlopen error no host given #30

Closed robinfdx closed 8 years ago

robinfdx commented 8 years ago

Hello :-).

I'm new with vmbix and i try to use it with zabbix 3.0, i've two zabbix proxy (but i want use vmbix just with one) and one zabbix server, I will summarize what I have done :

Traceback (most recent call last): File "./vmbix-discovery.py", line 46, in zapi.login(ZBXUSER, ZBXPASSWORD) File "/usr/local/lib/python2.7/dist-packages/zabbix_api.py", line 195, in login result = self.do_request(obj) File "/usr/local/lib/python2.7/dist-packages/zabbix_api.py", line 246, in do_request raise e urllib2.URLError:

Do you have idea ?

Thanks for your time

dav3860 commented 8 years ago

Hi,

The python script isn't necessary if you plan to use low-level discovery to create the hosts. Do you want the hosts to be editable ? This error indicates an auth issue. Can you try to login to the API with curl ? curl -i -X POST -H 'Content-Type: application/json' -d '{"params": {"password": "mypassword", "user": "myuser"}, "jsonrpc": "2.0", "method": "user.authenticate"}' http://myzabbixserver/zabbix/api_jsonrpc.php

Does it work ?

robinfdx commented 8 years ago

Thanks for your reply Dav,

But if we want use low-level discovery, it's nescessary add new rules in the discovery rules configuration no ?

Yes it's work, bellow the result with the same credentials : HTTP/1.1 200 OK Date: Tue, 28 Jun 2016 13:24:32 GMT Server: Apache/2.4.10 (Debian) Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Methods: POST Access-Control-Max-Age: 1000 Content-Length: 2 Content-Type: application/json

dav3860 commented 8 years ago

No, the newly provided templates work in Zabbix 3.0 and automatically create the hosts in Zabbix using LLD. You may need to set the parameter useuuid to true in vmbix.conf if needed. I'll soon upload a python script to create regular hosts in Zabbix in batch mode, with conditional rules. This will allow you to edit the hosts in Zabbix, add them different templates or monitor them using an agent in addition to VmBix. I need to update the documentation, which may not be clear.

robinfdx commented 8 years ago

Hi Dav,

Thanks for your reply, it's the same thing with the useuuid parameter set to true (urlopen error no host given).

Now i have a lot of VM/Veeam replica invotoried in my Zabbix but not all, i have all my veeam replicas but only 6VM/40VM in total.

When i write this i have all vm and replica: zabbix_get -s 127.0.0.1 -p 12050 -k vm.discovery[*]

Do you have any idea ?

dav3860 commented 8 years ago

I've uploaded a script of mine to import VMWare objects as regular Zabbix hosts. Please try it.

dav3860 commented 8 years ago

I've released the 2.3 version, which includes all these improvements.