Bug 1393328

Summary: OPS Tools | Availability Monitoring | OS Checks | ceilometer oscheck is failing giving a traceback.
Product: Red Hat OpenStack Reporter: Leonid Natapov <lnatapov>
Component: sensuAssignee: Martin Magr <mmagr>
Status: CLOSED ERRATA QA Contact: Leonid Natapov <lnatapov>
Severity: high Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: mlopes, mrunge, oblaut
Target Milestone: ga   
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: osops-tools-monitoring-oschecks-0.1-0.8.9f8354bgit.el7ost Doc Type: Bug Fix
Doc Text:
Previously, when the gnocchi API was used instead of the ceilometer API, the `oschecks-check_ceilometer_api` check showed a traceback instead of a reasonable message. Consequently, the check would report an inaccurate state. With this update, checks now report a `WARNING` with a reasonable message, instead of a `CRITICAL` with traceback.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 16:36:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leonid Natapov 2016-11-09 10:45:37 UTC
Description of problem:

When ceilometer_api oscheck I get the following traceback.

    [root@overcloud-controller-0 checks]# ./oschecks-check_ceilometer_api
    CRITICAL: Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/oschecks/utils.py", line 110, in safe_run
        method()
      File "/usr/lib/python2.7/site-packages/oschecks/ceilometer.py", line 32, in _check_ceilometer_api
        elapsed, meters = utils.timeit(client.meters.list)
      File "/usr/lib/python2.7/site-packages/oschecks/utils.py", line 97, in wrapper
        res = func(*arg, **kw)
      File "/usr/lib/python2.7/site-packages/oschecks/utils.py", line 105, in timeit
        return func(*args, **kwargs)
      File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/meters.py", line 38, in list
        return self._list(options.build_url(path, q, params))
      File "/usr/lib/python2.7/site-packages/ceilometerclient/common/base.py", line 63, in _list
        resp = self.api.get(url)
      File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 355, in get
        return self.client_request("GET", url, **kwargs)
      File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 345, in client_request
        self, method, url, **kwargs)
      File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 261, in client_request
        method, self.concat_url(endpoint, url), **kwargs)
      File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 201, in request
        raise exceptions.from_response(resp, method, url)
    Gone: Gone (HTTP 410) (Request-ID: req-9429dee9-4ac4-4367-b2a4-c889f1ade75b)


Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1.run ceilomete_api check
2.
3.

Actual results:
check is failing giving a traceback.

Expected results:

check is passing
Additional info:

Comment 1 Martin Magr 2016-11-09 11:33:09 UTC
Found the cause. We will need to adapt the check to contact gnocchi API in case ceilometer API is not used: 

[root@overcloud-controller-1 ~]# /usr/libexec/openstack-monitoring/checks/oschecks-check_ceilometer_api --os-username=admin --os-password=unMsJqwUDpWzXW3pweuFwp4qJ --os-auth-url=http://10.35.173.14:5000/v2.0 --os-tenant-name=admin
{"versions": {"values": [{"status": "stable", "updated": "2013-02-13T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.telemetry-v2+json"}, {"base": "application/xml", "type": "application/vnd.openstack.telemetry-v2+xml"}], "id": "v2", "links": [{"href": "http://10.35.173.14:8042/v2", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}]}}
{"error_message": "410 Gone\n\nThis resource is no longer available. No forwarding address is given.\n\n This telemetry installation is configured to use Gnocchi. Please use the Gnocchi API available on the metric endpoint to retrieve data.  "}

Comment 3 Leonid Natapov 2016-11-23 14:44:09 UTC
Fixed.

Tested with osops-tools-monitoring-oschecks-0.1-0.8.9f8354bgit.el7ost

Comment 5 errata-xmlrpc 2016-12-14 16:36:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-2950.html