コード例 #1
0
ファイル: htx.py プロジェクト: Obeltel/ServiceReport
    def check_htx_service_check(self):
        """HTX service status"""

        status = True
        if get_service_status(self.service_name) != 0:
            status = False
            self.log.debug("HTX service %s is not active", self.service_name)

        return SysfsCheck(self.check_htx_service_check.__doc__,
                          self.service_name, status)
コード例 #2
0
ファイル: kdump.py プロジェクト: Obeltel/ServiceReport
    def check_capture_kernel_memory_allocation(self):
        """Memory allocated for capture kernel"""

        status = None
        allocated_mem_size = None
        kexec_crash_size = "/sys/kernel/kexec_crash_size"

        mem_alloc_capture_kernel = get_file_content(kexec_crash_size)
        self.log.debug("kexec crash size %s: %s", kexec_crash_size,
                       mem_alloc_capture_kernel)

        if mem_alloc_capture_kernel is None:
            self.log.error("Memory allocation to capture kernel failed")
            status = False
        else:
            try:
                allocated_mem_size = int(
                    mem_alloc_capture_kernel) / 1024 / 1024
                status = self.is_capture_kernel_memory_sufficient(
                    allocated_mem_size)
            except ValueError as value_error:
                self.log.error("Invalid crash size found %s, error: %s",
                               kexec_crash_size, value_error)
                status = False

        kdump_mem = SysfsCheck(
            self.check_capture_kernel_memory_allocation.__doc__,
            kexec_crash_size, status)
        kdump_mem.set_sysfs_value_found(allocated_mem_size)
        kdump_mem.set_sysfs_expected_value(
            self.get_required_mem_for_capture_kernel())

        return kdump_mem
コード例 #3
0
ファイル: fadump.py プロジェクト: Obeltel/ServiceReport
    def check_mem_reservation(self):
        """Memory reservation"""

        status = True

        mem_needed = self.get_crash_mem_needed()
        mem_reserved = self.get_mem_reserved()

        if mem_needed is None or mem_reserved is None:
            status = None
        elif mem_needed > mem_reserved:
            self.log.error("Memory reserved for FADump is insufficient")
            self.log.recommendation("Increase the memory reservation to %d MB",
                                    mem_needed)
            status = False

        if status:
            self.log.info("Sufficient memory reserved for dump collection")

        mem_reserve_check = SysfsCheck(self.check_mem_reservation.__doc__, "",
                                       status)
        mem_reserve_check.set_sysfs_value_found(mem_reserved)
        mem_reserve_check.set_sysfs_expected_value(mem_needed)

        return mem_reserve_check
コード例 #4
0
ファイル: fadump.py プロジェクト: Obeltel/ServiceReport
    def check_fadump_registered(self):
        """FADump registration check"""

        status = True
        sys_kernel_fadump_registered = "/sys/kernel/fadump_registered"
        fadump_registered = get_file_content(sys_kernel_fadump_registered)

        try:
            if fadump_registered is None or int(fadump_registered) != 1:
                self.log.error("FADump is not registered")
                status = False
            else:
                self.log.info("FADump is registered")

        except ValueError as value_error:
            self.log.debug("Invalid data found in file %s, error: %s",
                           sys_kernel_fadump_registered, value_error)
            status = False

        return SysfsCheck(self.check_fadump_registered.__doc__,
                          sys_kernel_fadump_registered, status)
コード例 #5
0
ファイル: kdump.py プロジェクト: Obeltel/ServiceReport
    def check_is_kexec_crash_loaded(self):
        """Capture kernel load status"""

        status = True
        kexec_crash_loaded = "/sys/kernel/kexec_crash_loaded"

        try:
            kexec_crash_status = int(get_file_content(kexec_crash_loaded))
            if kexec_crash_status is None or kexec_crash_status != 1:
                self.log.error("Capture kernel is unavailable")
                status = False
        except ValueError as value_error:
            self.log.error("Invalid data found in file %s, error: %s",
                           kexec_crash_loaded, value_error)
            status = False

        kexec_crash_loaded = SysfsCheck(
            self.check_is_kexec_crash_loaded.__doc__, kexec_crash_loaded,
            status)
        kexec_crash_loaded.set_sysfs_value_found(int(kexec_crash_status))
        kexec_crash_loaded.set_sysfs_expected_value(1)

        return kexec_crash_loaded