diff --git a/openstack_dashboard/api/ceilometer.py b/openstack_dashboard/api/ceilometer.py index 87ea2570ee..3594deeaed 100644 --- a/openstack_dashboard/api/ceilometer.py +++ b/openstack_dashboard/api/ceilometer.py @@ -752,6 +752,7 @@ class Meters(object): self._cinder_meters_info = self._get_cinder_meters_info() self._swift_meters_info = self._get_swift_meters_info() self._kwapi_meters_info = self._get_kwapi_meters_info() + self._ipmi_meters_info = self._get_ipmi_meters_info() # Storing the meters info of all services together. all_services_meters = (self._nova_meters_info, @@ -759,7 +760,8 @@ class Meters(object): self._glance_meters_info, self._cinder_meters_info, self._swift_meters_info, - self._kwapi_meters_info) + self._kwapi_meters_info, + self._ipmi_meters_info) self._all_meters_info = {} for service_meters in all_services_meters: self._all_meters_info.update(dict([(meter_name, meter_info) @@ -841,6 +843,16 @@ class Meters(object): return self._list(only_meters=self._kwapi_meters_info.keys(), except_meters=except_meters) + def list_ipmi(self, except_meters=None): + """Returns a list of meters tied to ipmi + + :Parameters: + - `except_meters`: The list of meter names we don't want to show + """ + + return self._list(only_meters=self._ipmi_meters_info.keys(), + except_meters=except_meters) + def _list(self, only_meters=None, except_meters=None): """Returns a list of meters based on the meters names @@ -1234,3 +1246,40 @@ class Meters(object): 'description': _("Power consumption"), }), ]) + + def _get_ipmi_meters_info(self): + """Returns additional info for each meter + + That will be used for augmenting the Ceilometer meter + """ + + # TODO(lsmola) Unless the Ceilometer will provide the information + # below, I need to define it as a static here. I will be joining this + # to info that I am able to obtain from Ceilometer meters, hopefully + # some day it will be supported all. + return datastructures.SortedDict([ + ('hardware.ipmi.node.power', { + 'label': '', + 'description': _("System Current Power"), + }), + ('hardware.ipmi.node.temperature', { + 'label': '', + 'description': _("System Current Temperature"), + }), + ('hardware.ipmi.fan', { + 'label': '', + 'description': _("Fan RPM"), + }), + ('hardware.ipmi.temperature', { + 'label': '', + 'description': _("Sensor Temperature Reading"), + }), + ('hardware.ipmi.current', { + 'label': '', + 'description': _("Sensor Current Reading"), + }), + ('hardware.ipmi.voltage', { + 'label': '', + 'description': _("Sensor Voltage Reading"), + }), + ]) diff --git a/openstack_dashboard/dashboards/admin/metering/tabs.py b/openstack_dashboard/dashboards/admin/metering/tabs.py index 35e0b7056c..eafe9d1251 100644 --- a/openstack_dashboard/dashboards/admin/metering/tabs.py +++ b/openstack_dashboard/dashboards/admin/metering/tabs.py @@ -45,6 +45,7 @@ class GlobalStatsTab(tabs.TableTab): 'cinder_meters': meters.list_cinder(), 'swift_meters': meters.list_swift(), 'kwapi_meters': meters.list_kwapi(), + 'ipmi_meters': meters.list_ipmi(), } return context @@ -65,6 +66,7 @@ class UsageReportTab(tabs.TableTab): _('Cinder'): meters.list_cinder(), _('Swift_meters'): meters.list_swift(), _('Kwapi'): meters.list_kwapi(), + _('IPMI'): meters.list_ipmi(), } report_rows = [] diff --git a/openstack_dashboard/dashboards/admin/metering/templates/metering/stats.html b/openstack_dashboard/dashboards/admin/metering/templates/metering/stats.html index 58ac5a22f0..cf17a33ff3 100644 --- a/openstack_dashboard/dashboards/admin/metering/templates/metering/stats.html +++ b/openstack_dashboard/dashboards/admin/metering/templates/metering/stats.html @@ -71,6 +71,16 @@ {% endfor %} {% endif %} + + {% if ipmi_meters %} + + {% for meter in ipmi_meters %} + + {% endfor %} + + {% endif %} diff --git a/openstack_dashboard/dashboards/admin/metering/views.py b/openstack_dashboard/dashboards/admin/metering/views.py index 6a853b3368..4cfbf14ba2 100644 --- a/openstack_dashboard/dashboards/admin/metering/views.py +++ b/openstack_dashboard/dashboards/admin/metering/views.py @@ -219,6 +219,7 @@ def load_report_data(request): _('Cinder'): meters.list_cinder(), _('Swift_meters'): meters.list_swift(), _('Kwapi'): meters.list_kwapi(), + _('IPMI'): meters.list_ipmi(), } project_rows = {} date_options = request.GET.get('date_options', 7)