monasca-agent/monasca_setup/detection/plugins/ironic.py
Peter Piela 8ee87b2ab7 Fixed search pattern in Ironic detection plugin
The original pattern .*200 OK.* does not match the output from the specified
ironic-api url, and exanple of which is shown below. The .*v1.* seems like
a better choice, and is consistent with other plugins.

{"default_version": {"id": "v1", "links": [{"href":
"http://localhost:6385/v1/","rel": "self"}]}, "versions": [{"id": "v1",
"links": [{"href": "http://localhost:6385/v1/", "rel": "self"}]}],
"name": "OpenStack Ironic API", "description":
"Ironic is an OpenStack project which aims to provision baremetal machines."}

Change-Id: I2b44253705d7f8240b2962070893588152ef3257
2016-07-06 11:58:54 -04:00

24 lines
674 B
Python

import logging
import monasca_setup.detection
log = logging.getLogger(__name__)
class Ironic(monasca_setup.detection.ServicePlugin):
"""Detect Ironic daemons and setup configuration to monitor them."""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': template_dir,
'overwrite': overwrite,
'service_name': 'baremetal',
'process_names': ['ironic-api', 'ironic-conductor'],
'service_api_url': "http://localhost:6385",
'search_pattern': '.*v1.*',
}
super(Ironic, self).__init__(service_params)