freezer_dr.monitors.drivers.monasca package¶
Submodules¶
freezer_dr.monitors.drivers.monasca.driver module¶
-
class
freezer_dr.monitors.drivers.monasca.driver.
MonascaDriver
(backend_name, notifier)[source]¶ Bases:
freezer_dr.monitors.common.driver.MonitorBaseDriver
Monasca monitoring driver to monitor compute nodes. It makes use of Monasca to monitor the compute nodes. Metric information needed. ‘hostname’ must be used in dimensions to filter the values in alarms. You need to define alarms for all hosts with the required metrics.
-
analyze_nodes
(nodes)[source]¶ It will check if the nodes are in ‘OK’ state or not. If not they will considered down. We have three states as follow: 1. OK 2. ALARM 3. UNDEFINED
-
get_data
()[source]¶ This function returns monitoring data from Monasca. It calls _get_raw_data to get raw data and then process these data returns a normalized dict :return: dict contains:
{ hostname1: { metric_name1: ['Ok', 'ALARM', 'UNDETERMINED'] metric_name2: ['OK', 'OK', 'OK'] }, hostname2: { metric_name1: ['Ok', 'ALARM', 'OK'] metric_name2: ['ALARM', 'UNDETERMINED', 'OK'] } }
-
is_alive
()[source]¶ Plugin should provide a way to make sure that the monitoring system is a live or not. It’s optional not all drivers need to implement it. :return: True or False
-
process_failed
(nodes=None, wait=1)[source]¶ Double check the failed nodes again to make sure that nodes are down. return a list of down nodes to be passed to the evacuation tool to process failed hosts. :param nodes: a list contains pre-checked nodes to re-check them again :param wait: a configurable a mount of time to wait before doing this check to give a chance for the host to recover if there was a minor issue. :return: a list of nodes to be evacuated, the list will be passed directly to the evacuation tool to process them
-