Ejemplo n.º 1
0
    def _get_component_specific_checkmk_files_elements(
        self,
        component,
    ) -> List[Tuple[str, ValueSpec]]:
        elements = []
        config_files = [(f, fi) for f in self._checkmk_config_files_map
                        for fi in [get_checkmk_file_info(f, component)]
                        if component in fi.components]
        if config_files:
            elements.append((
                "config_files",
                self._get_component_specific_checkmk_files_choices(
                    _("Configuration files"), config_files),
            ))

        log_files = [(f, fi) for f in self._checkmk_log_files_map
                     for fi in [get_checkmk_file_info(f, component)]
                     if component in fi.components]
        if log_files:
            elements.append((
                "log_files",
                self._get_component_specific_checkmk_files_choices(
                    _("Log files"), log_files),
            ))
        return elements
Ejemplo n.º 2
0
    def _get_optional_information_elements(
            self) -> List[Tuple[str, ValueSpec]]:
        elements: List[Tuple[str, ValueSpec]] = [
            (OPT_LOCAL_FILES,
             FixedValue(
                 True,
                 totext="",
                 title=_("Local Files"),
                 help=_(
                     "List of installed, unpacked, optional files below OMD_ROOT/local. "
                     "This also includes information about installed MKPs."),
             )),
            (OPT_OMD_CONFIG,
             FixedValue(
                 True,
                 totext="",
                 title=_("OMD Config"),
                 help=_("Apache mode and TCP address and port, Core, "
                        "Liveproxy daemon and livestatus TCP mode, "
                        "Event daemon config, Multiste authorisation, "
                        "NSCA mode, TMP filesystem mode"),
             )),
            (OPT_CHECKMK_OVERVIEW,
             FixedValue(
                 True,
                 totext="",
                 title=_("Checkmk Overview"),
                 help=_(
                     "Checkmk Agent, Number, version and edition of sites, Cluster host; "
                     "Number of hosts, services, CMK Helper, Live Helper, "
                     "Helper usage; State of daemons: Apache, Core, Crontag, "
                     "DCD, Liveproxyd, MKEventd, MKNotifyd, RRDCached "
                     "(Agent plugin mk_inventory needs to be installed)"),
             )),
            (OPT_CHECKMK_CONFIG_FILES,
             self._get_component_specific_checkmk_files_choices(
                 "Checkmk Configuration files",
                 [(f, get_checkmk_file_info(f))
                  for f in self._checkmk_config_files_map])),
        ]

        if not cmk_version.is_raw_edition():
            elements.append((
                OPT_PERFORMANCE_GRAPHS,
                FixedValue(
                    True,
                    totext="",
                    title=_("Performance Graphs of Checkmk Server"),
                    help=
                    _("CPU load and utilization, Number of threads, Kernel Performance, "
                      "OMD, Filesystem, Apache Status, TCP Connections of the time ranges "
                      "25 hours and 35 days"),
                )))
        return elements
def test_diagnostics_get_checkmk_file_info_by_name(component, sensitivity_values):
    rel_filepaths = [
        "path/to/sites.mk",
        "path/to/global.mk",
        "path/to/hosts.mk",
        "path/to/rules.mk",
        "path/to/tags.mk",
        "path/to/.wato",
    ]
    for rel_filepath, result in zip(rel_filepaths, sensitivity_values):
        assert diagnostics.get_checkmk_file_info(rel_filepath,
                                                 component).sensitivity.value == result
Ejemplo n.º 4
0
def test_diagnostics_file_info_of_comp_notifications(rel_filepath,
                                                     sensitivity_value):
    assert (diagnostics.get_checkmk_file_info(
        rel_filepath, diagnostics.OPT_COMP_NOTIFICATIONS).sensitivity.value ==
            sensitivity_value)