Пример #1
0
def _output_check_result(servicedesc: ServiceName, state: ServiceState, infotext: ServiceDetails,
                         perftexts: List[str]) -> None:
    if _show_perfdata:
        infotext_fmt = "%-56s"
        p = ' (%s)' % (" ".join(perftexts))
    else:
        p = ''
        infotext_fmt = "%s"

    console.verbose("%-20s %s%s" + infotext_fmt + "%s%s\n", ensure_str(servicedesc),
                    tty.bold, tty.states[state], ensure_str(infotext.split('\n')[0]), tty.normal,
                    ensure_str(p))
Пример #2
0
def _output_check_result(
    servicedesc: ServiceName,
    state: ServiceState,
    infotext: ServiceDetails,
    perftexts: List[str],
    *,
    show_perfdata: bool,
) -> None:
    if show_perfdata:
        infotext_fmt = "%-56s"
        p = ' (%s)' % (" ".join(perftexts))
    else:
        p = ''
        infotext_fmt = "%s"

    console.verbose(
        "%-20s %s%s" + infotext_fmt + "%s%s\n",
        servicedesc,
        tty.bold,
        tty.states[state],
        infotext.split('\n', 1)[0],
        tty.normal,
        p,
    )
Пример #3
0
def _output_check_result(
    servicedesc: ServiceName,
    state: ServiceState,
    infotext: ServiceDetails,
    perftext: str,
    *,
    show_perfdata: bool,
) -> None:
    if show_perfdata:
        infotext_fmt = "%-56s"
        p = f" ({perftext})"
    else:
        p = ""
        infotext_fmt = "%s"

    console.verbose(
        "%-20s %s%s" + infotext_fmt + "%s%s\n",
        servicedesc,
        tty.bold,
        tty.states[state],
        infotext.split("\n", 1)[0],
        tty.normal,
        p,
    )