Versions Compared

Key

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

...

  1. Increase the log to debug
    1. How to collect troubleshooting data for various issue types#Core → Smart ping
  2. Checkin the cmc.log (as site user)

    Code Block
    languagebash
    themeRDark
    grep -e <IP> -e <HOSTNAME> ~/var/log/cmc.log | grep -e "smartping timeout" -e "received p"


...

Please replace host_name = Myhost with the affected Checkmk Hosts

Code Block
languagebash
themeRDark
OMD[mysite]:~$ lq "GET hosts\nColumns: host_name check_interval retry_interval smartping_timeout max_check_attempts state state_type\nFilter: host_name = <Myhost>"

...

Debugging the smart ping via cli

For using To use this command, you have to must create (as a site user) a file dump.py in ~/local/bin. The file should look like this: Debugging of smart ping

Code Block
languagebash
themeRDark
OMD[workshopmysite]:~/local/bin$ ~/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'

or you can use the command with the dump.py

Code Block
languagebash
themeRDark
OMD[mysite]:~$ ~/lib/cmc/icmpreceiver |python3 /local/bin/dump.py |grep --line-buffered  "127.0.0.1" |ts -i

...

the content of ./dump.py

Code Block
languagepy
themeRDark
#!/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()           

...

You can use this online instead of the ./dump.py:

Code Block
languagebash
themeRDark
 ~/lib/cmc/icmpreceiver | perl -ne 'map { CORE::say join "." => unpack "CCCC", pack "L", $_ } unpack "L*";'

...