schubergphilis / Check_Nexenta

Nagios plugin to monitor Nexenta systems.
Apache License 2.0
5 stars 12 forks source link

Using check_nexenta.py throws Python error #3

Closed xenuser closed 10 years ago

xenuser commented 10 years ago

I just downloaded check_nexenta.py here from this GitHub repo, installed my SNMP agent and configured the Nagios check.

When I try to use check_nexenta.py Python throws me an error: ./check_nexenta.py -H topsecretstoragehost

Traceback (most recent call last): File "./check_nexenta.py", line 660, in print main(sys.argv[1:]) File "./check_nexenta.py", line 555, in main result = check_spaceusage(nexenta) File "./check_nexenta.py", line 283, in check_spaceusage volumes = api.get_data(obj='folder', meth='get_names', par=['']) File "./check_nexenta.py", line 165, in get_data if response['error'] and "Cannot introspect object com.nexenta.nms" in response['error']['message']: UnboundLocalError: local variable 'response' referenced before assignment

Any hints on this one? I am using Python 2.7.3.

brennmiddag commented 10 years ago

Hi, There was a bug in the retry code. This has been fixed in master. The problem in your case is that the script was unable to connect to the API, either because of dns issues or something like firewall/user credentials etc.

Please update the script and if the connection problem still exists it will throw a proper exception and show you what url it tries to connect to which should help you troubleshoot the issue.

regards,

Brenn

xenuser commented 10 years ago

Hi Brenn,

thank you for your efforts! When I call check_nexenta.py now, it gives me: CRITICAL: Unable to connect to API at http://secret_ip:2000/rest/nms/ http://secret_ip:2000/rest/nms/

Unfortunately the Nexenta storage is only available over https, not http.

xenuser commented 10 years ago

My bad - I didn't use "api_ssl = ON". Sorry!

brennmiddag commented 10 years ago

Thanks for the feedback! Case closed :)