def _do_submit_to_core( host: HostName, service: ServiceName, state: ServiceState, output: ServiceDetails, cache_info: Optional[Tuple[int, int]], ) -> None: if keepalive and keepalive.enabled(): cached_at, cache_interval = cache_info or (None, None) # Regular case for the CMC - check helpers are running in keepalive mode keepalive.add_check_result(host, service, state, output, cached_at, cache_interval) elif config.check_submission == "pipe" or config.monitoring_core == "cmc": # In case of CMC this is used when running "cmk" manually _submit_via_command_pipe(host, service, state, output) elif config.check_submission == "file": _submit_via_check_result_file(host, service, state, output) else: raise MKGeneralException("Invalid setting %r for check_submission. " "Must be 'pipe' or 'file'" % config.check_submission)
def _in_keepalive_mode() -> bool: if keepalive: return keepalive.enabled() return False
def _in_keepalive_mode(): # type: () -> bool if keepalive: return keepalive.enabled() return False
def _in_keepalive_mode(): # type: () -> bool return bool(keepalive and keepalive.enabled())
def _in_keepalive_mode() -> bool: if cmk_version.is_raw_edition(): return False import cmk.base.cee.keepalive as keepalive # pylint: disable=no-name-in-module return keepalive.enabled()
def _in_keepalive_mode() -> bool: if not cmk_version.is_raw_edition(): import cmk.base.cee.keepalive as keepalive # pylint: disable=no-name-in-module else: keepalive = None # type: ignore[assignment] return bool(keepalive and keepalive.enabled())
def _in_keepalive_mode(): return keepalive and keepalive.enabled()
def _in_keepalive_mode() -> bool: return bool(keepalive and keepalive.enabled())