@@ -0,0 +1,1044 @@
+import logging%0Aimport os%0A%0Afrom monasca_setup import agent_config%0Afrom monasca_setup.detection import Plugin%0A%0Alog = logging.getLogger(__name__)%0A%0A%0Aclass Crash(Plugin):%0A    %22%22%22%0A    Detect if kdump is installed and enabled and setup configuration to%0A    monitor for crash dumps.%0A    %22%22%22%0A%0A    def _detect(self):%0A        %22%22%22%0A        Run detection, set self.available True if a crash kernel is loaded.%0A        %22%22%22%0A        loaded = '/sys/kernel/kexec_crash_loaded'%0A        if os.path.isfile(loaded):%0A            with open(loaded, 'r') as fh:%0A                if fh.read().strip() == '1':%0A                    self.available = True%0A%0A    def build_config(self):%0A        %22%22%22%0A        Build the config as a Plugin object and return it.%0A        %22%22%22%0A        log.info('%5CtEnabling the Monasca crash dump healthcheck')%0A        config = agent_config.Plugins()%0A%0A        config%5B'crash'%5D = %7B%0A            'init_config': None,%0A            'instances': %5B%7B'name': 'crash_stats'%7D%5D%0A        %7D%0A%0A        return config%0A%0A    def dependencies_installed(self):%0A        return True%0A

Add a detection plugin for the crash check plugin