コード例 #1
0
def _snmp_scan(
    sections: Iterable[SNMPScanSection],
    on_error: str = "ignore",
    do_snmp_scan: bool = True,
    *,
    binary_host: bool,
    backend: ABCSNMPBackend,
) -> Set[SectionName]:
    snmp_cache.initialize_single_oid_cache(backend.config)
    console.vverbose("  SNMP scan:\n")
    _snmp_scan_cache_description(
        binary_host=binary_host,
        do_snmp_scan=do_snmp_scan,
        backend=backend,
    )

    found_sections = _snmp_scan_find_sections(
        sections,
        do_snmp_scan=do_snmp_scan,
        on_error=on_error,
        backend=backend,
    )
    _output_snmp_check_plugins("SNMP scan found", found_sections)
    snmp_cache.write_single_oid_cache(backend.config)
    return found_sections
コード例 #2
0
ファイル: snmp_scan.py プロジェクト: dnlldl/checkmk
def _snmp_scan(
    sections: Iterable[SNMPScanSection],
    on_error: str = "ignore",
    *,
    missing_sys_description: bool,
    backend: ABCSNMPBackend,
) -> Set[SectionName]:
    snmp_cache.initialize_single_oid_cache(backend.config)
    console.vverbose("  SNMP scan:\n")

    if missing_sys_description:
        _fake_description_object()
    else:
        _prefetch_description_object(backend=backend)

    found_sections = _find_sections(
        sections,
        on_error=on_error,
        backend=backend,
    )
    _output_snmp_check_plugins("SNMP scan found", found_sections)
    snmp_cache.write_single_oid_cache(backend.config)
    return found_sections