Versions Compared

Key

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

...

Panel
borderColorblack
bgColor#f8f8f8
titleTable of Contents

Table of Contents

Debug the Smart Ping in the cmc.log

  1. Increase the log to debug
  2. Checkin Check in 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"



Livestatus query

With this command, you can check the check interval, retry interval, Smart Ping timeout, and the max check attempts of the host:

...

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

To use this command, you must create (as a site user) a file dump.py in ~/local/bin. The file should look like this: 9473438 Debugging of Smart Ping#thecontentof./dump.py

Code Block
languagebash
themeRDark
OMD[mysite]:~/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'

...

If Perl is not possible, you will find it here: https://unix.stackexchange.com/questions/26728/prepending-a-timestamp-to-each-line-of-output-from-a-command

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()           

...

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


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

...