wanadev / zabbix-agent-extension-couchdb3

Zabbix extension to monitor CouchDB 3
Other
3 stars 1 forks source link

Not working with PSK connection #1

Open marceloavf opened 4 years ago

marceloavf commented 4 years ago

I setup my zabbix agent using PSK connection, as you can see in the link below, but zabbix host doesn't show anything after setting up this extension.

When I ran it directly inside:

user@machine:~$ sudo zabbix-agent-extension-couchdb3 --user zabbixAgent --password XXXXX
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzabbix/sender.py", line 408, in _chunk_send
    connection.connect(host_addr)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/zabbix-agent-extension-couchdb3", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/zabbix_agent_extension_couchdb3/__main__.py", line 52, in main
    resp = send_stats_to_zabbix(stats_json, hostname)
  File "/usr/local/lib/python3.6/dist-packages/zabbix_agent_extension_couchdb3/__main__.py", line 30, in send_stats_to_zabbix
    return zabbix.send_stats(stats, hostname)
  File "/usr/local/lib/python3.6/dist-packages/zabbix_agent_extension_couchdb3/zabbix.py", line 27, in send_stats
    return ZabbixSender(use_config=True).send(packet)
  File "/usr/local/lib/python3.6/dist-packages/pyzabbix/sender.py", line 443, in send
    result.parse(self._chunk_send(metrics[m:m + self.chunk_size]))
  File "/usr/local/lib/python3.6/dist-packages/pyzabbix/sender.py", line 414, in _chunk_send
    raise socket.timeout
socket.timeout

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-zabbix-to-securely-monitor-remote-servers-on-ubuntu-20-04

marceloavf commented 4 years ago

Tried without PSK using Zabbix 5 in server/agent but no success, is it something related to zabbix version?

blondviper commented 3 years ago

Tried with and without PSK. When I run user@couchdb:~$ zabbix-agent-extension-couchdb3 --password=xxxxx --show-stats The output is: `Traceback (most recent call last): File "/usr/lib/python3.5/urllib/request.py", line 1261, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "/usr/lib/python3.5/http/client.py", line 1151, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.5/http/client.py", line 1196, in _send_request self.endheaders(body) File "/usr/lib/python3.5/http/client.py", line 1147, in endheaders self._send_output(message_body) File "/usr/lib/python3.5/http/client.py", line 950, in _send_output self.send(msg) File "/usr/lib/python3.5/http/client.py", line 893, in send self.connect() File "/usr/lib/python3.5/http/client.py", line 865, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.5/socket.py", line 711, in create_connection raise err File "/usr/lib/python3.5/socket.py", line 702, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/zabbix-agent-extension-couchdb3", line 8, in sys.exit(main()) File "/usr/local/lib/python3.5/dist-packages/zabbix_agent_extension_couchdb3/main.py", line 42, in main proto=options.proto) File "/usr/local/lib/python3.5/dist-packages/zabbix_agent_extension_couchdb3/couchdb.py", line 30, in get_stats with urllib.request.urlopen(url) as response: File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.5/urllib/request.py", line 466, in open response = self._open(req, data) File "/usr/lib/python3.5/urllib/request.py", line 484, in _open '_open', req) File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(*args) File "/usr/lib/python3.5/urllib/request.py", line 1289, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.5/urllib/request.py", line 1263, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused> `

Other templates work fine. Maros have been set up. What is the workaround for this issue?