pavlovdo / pystormon

Zabbix storage monitoring via CIM/WBEM
15 stars 8 forks source link

Getting error when storage_discovery.py runs #7

Closed kaishainn closed 4 years ago

kaishainn commented 4 years ago

Have this issue:

[root@localhost pystormon]# python3 storage_discovery.py During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/pywbem/_cim_http.py", line 317, in wbem_request timeout=(HTTP_CONNECT_TIMEOUT, conn.timeout)) File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 581, in post return self.request('POST', url, data=data, json=json, kwargs) File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 510, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='10.71.73.242', port=5989): Max retries exceeded with url: /cimom (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb4a246ea58>: Failed to establish a new connection: [Errno 111] Connection refused',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "storage_discovery.py", line 72, in disks_names = disks_discovery(conn, disk_types[disk_type][0], disk_types[disk_type][1]) File "storage_discovery.py", line 30, in disks_discovery disks_cim = wbem_connection.ExecQuery('DMTF:CQL', request) File "/usr/local/lib/python3.6/site-packages/pywbem/_cim_operations.py", line 4349, in ExecQuery Query=Query) File "/usr/local/lib/python3.6/site-packages/pywbem/_cim_operations.py", line 1758, in _imethodcall self, request_data, cimxml_headers) File "/usr/local/lib/python3.6/site-packages/pywbem/_cim_http.py", line 323, in wbem_request raise ConnectionError(msg, conn_id=conn.conn_id) pywbem._exceptions.ConnectionError: ('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb4a246ea58>: Failed to establish a new connection: [Errno 111] Connection refused',)); OpenSSL version used: OpenSSL 1.1.1c FIPS 28 May 2019

cat devices.conf storwize:SURB4BASSSTG.colombo.com.pt:10.71.73.242

pavlovdo commented 4 years ago

Hi! Try to telnet 10.71.73.242 443 from host where you run script storage_discovery.py. Looks like network unavailability storwize from your host. If you can telnet to storwize, try log in via GUI Management https://10.71.73.242 under your monitoring user.

kaishainn commented 4 years ago

Thanks for you quick answer, I can telnet and access to the Storage, but looks like the storage:discrovery.py is trying to connect to WBEMConnection(url='https://10.71.73.242:5989', creds=('zabbix', ...), default_namespace='root/ibm', ...) If I try to open the url https://10.71.73.242:5989 gets me an error HTTP ERROR 501.

pavlovdo commented 4 years ago

Yes of course, WBEM works on port 5989. Try to telnet 10.71.73.242 5989 from your monitoring host. That port must be available from monitoring host. If not, add entry to ACLs on your firewall/router.

kaishainn commented 4 years ago

I was able to conect to the ip and port from monitoring host. telnet 10.71.73.242 5989 Trying 10.71.73.242... Connected to 10.71.73.242. Escape character is '^]'.

kaishainn commented 4 years ago

This is my pystormon.conf cat pystormon.conf [NetworkDevice] device_file = /etc/zabbix/externalscripts/pystormon/devices.conf login = zabbix name_space = root/ibm password = 1234 zabbix_server = 10.71.73.49

cat devices.conf storwize:SURB4BASSSTG.colombo.com.pt:10.71.73.242

pavlovdo commented 4 years ago

According to https://pywbem.readthedocs.io/en/latest/client/exceptions.html#pywbem.ConnectionError, it's a network or WBEM-server (storwize) issue: "This exception indicates a problem with the connection to the WBEM server" Therefore: 1) Check your connection between monitoring host and storwize again; 2) Try to tcpdump this connection; 3) Check logs of your network devices.

kaishainn commented 4 years ago

I fixed and now is working. One question, which metrics can I get from the Storage with pystorm?

pavlovdo commented 4 years ago

How did you fix it ? With pystormon you can show status of physical disks and perfomance of volumes image image image

If you interested in more information tell me what information you need. I will consider the possibility add these metrics in next releases.

kaishainn commented 4 years ago

Yes, all the scripts are working since yesterday but I´m still not seeing any info in zabbix...One question when I create the host in zabbix where I must to set the storage IP, agent,snmp, jmx, ipmi.....??

pavlovdo commented 4 years ago

In zabbix host configuration you have to set Host name and IP address for Agent Interface only. In zabbix host config you have to set the same hostname as in the file devices.conf: SURB4BASSSTG.colombo.com.pt Otherwise zabbix server can't find object for save item values received from python script zabbix trapper.

kaishainn commented 4 years ago

Great! I´m seeing the data in grafana! Thanks so much for your help and support!

pavlovdo commented 4 years ago

I'm glad to hear that, you're welcome :) If you need more items, you can open new issue.