Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
OMD[cme2_test]:~$ lq "GET hosts\nColumns: host_name check_interval retry_interval smartping_timeout max_check_attempts state state_type\nFilter: host_name = Ubuntu1804"
Ubuntu1804;5;1;750000;1;1;1


Debuging the smart ping via cli

Code Block
OMD[workshop]:~/local/bin$ OMD[workshop]:~$ ~/lib/cmc/icmpreceiver |python3 ~/local/bin/dump.py |grep --line-buffered  "127.0.0.1" |perl -pe 'use POSIX strftime; print strftime "[%Y-%m-%d %H:%M:%S] ", localtime'
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:25] 127.0.0.1

the content of ./dump.py

Code Block
#!/usr/bin/env python3

import ipaddress
import sys

def main() -> None:
    while True:
        addr = ipaddress.ip_address(sys.stdin.buffer.read(4))
        sys.stdout.write(f"{addr!s}\n")
        sys.stdout.flush()

if __name__ == "__main__":
    main()
~              




Info

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("smart_ping","smartping") and type = "page" and space = "KB"
labelssmart_ping smartping

...