Sensu Novaclient connection issues

asked 2016-05-09 11:04:20 -0500

vandexel gravatar image

I'm having issues with the Openstack featured plugins. I cannot connect to novaclient with my openstack credentials. I'm using the check from here: https://github.com/sensu-plugins/sensu-plugins-openstack/blob/master/bin/nova/nova-hypervisor-metrics.py (https://github.com/sensu-plugins/sens...)

But I'm having issues with this line: client = Client(NOVA_API_VERSION, args.user, args.password, args.tenant, args.auth_url, service_type=args.service_type)

I've run the check with the proper username, password, and tenant. I am using localhost:5000 as the authentication url and compute as the service type.

I confirmed that the username and password were correct by logging in to my horizon dashboard. I am also able to see the list of hypervisors from the dashboard, meaning that I have admin privileges. However, I'm still having trouble authenticating. When I run the check, nothing happens, and when I Ctrl+C, it interrupts with this message:

File "/etc/sensu/plugins/nova-hypervisor-metrics.py", line 70, in <module> main() File "/etc/sensu/plugins/nova-hypervisor-metrics.py", line 47, in main if client.authenticate(): File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 118, in wrapper return f(self, args, *kwargs) File "/usr/lib/python2.7/site-packages/novaclient/v2/client.py", line 259, in authenticate self.client.authenticate() File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 553, in authenticate auth_url = self._v2_auth(auth_url) File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 644, in _v2_auth return self._authenticate(url, body) File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 657, in _authenticate *kwargs) File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 393, in _time_request resp, body = self.request(url, method, *kwargs) File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 364, in request *kwargs) File "/usr/lib/python2.7/site-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, *kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 465, in request resp = self.send(prep, *send_kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 573, in send r = adapter.send(request, *kwargs) File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 370, in send timeout=timeout File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen body=body, headers=headers) File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 372, in _make_request httplib_response = conn.getresponse(buffering=True)
File "/usr/lib64/python2.7/httplib.py", line 1051, in getresponse response.begin() File "/usr/lib64/python2.7/httplib.py", line 415, in begin version, status, reason = self._read_status() File "/usr/lib64/python2.7/httplib.py", line 371, in _read_status line = self.fp.readline(_MAXLINE + 1) File "/usr/lib64/python2.7/socket.py", line 476, in readline data = self._sock.recv(self._rbufsize)

I have added a line in my code just to make sure that it's the authentication that is not working:

if client.authenticate(): print("worked")

and this does not work, leading me to believe ... (more)

edit retag flag offensive close merge delete