ConfD User Community

Programmable way to check if ConfD is up

Hello,

What is the best approach to check, from the “device” SB side, if the ConfD process is up?
Just trying to connect? or is there a different way to “ping” it via C-API ?

thanks,
Kobi

Hi,

You can for example use the DP API health check notification to get a reading. If you just want to do a “one-shot” test, subscribe, wait for a second for the notification with the result, and then unsubscribe.

You can use the examples.confd/misc/notifications example as a reference. Quick demo:

$ pwd
/Users/tailf/confd-7.8/examples.confd/misc/notifications

$ make all start
...
./confd_notifications -i
Waiting for event notifications...
^Cmake: *** [start] Interrupt: 2

$ ./confd_notifications
./confd_notifications usage:
    -d   (daemon log messages)
    -D   (developer log messages)
    -a   (audit log messages)
    -N   (NETCONF log messages)
    -J   (JSONRPC log messages)
    -W   (WEBUI log messages)
    -S   (SNMP log messages)
    -t   (takeover mode for syslog)
    -u   (user session messages)
    -i   (commit diff messages - iterate over commit diff)
    -f   (commit failed messages)
    -C   (confirmed-commit messages)
    -P   (commit progress messages)
    -v 'verbosity' (verbosity for progress messages - enum(normal|verbose|very-verbose|debug))
    -h   (ha information messages)
    -s   (subagent messages)
    -F   (forward information messages)
    -U   (upgrade event messages)
    -A   (all of the above)
    -H   (heartbeat messages)
    -e   (health check messages)
    -c   (commit simple messages)
    -n 'name' (notification stream event messages for stream 'name')
    -y   (make audit log synchronous)
    -Y   (make ha info synchronous)
    -r   (request confirmation before sync reply)
    -T 'interval' (interval for heartbeat / health check in seconds)
    -B 'time' (start time for notification stream - yang:date-and-time form)
    -E 'time' (stop time for notification stream - yang:date-and-time form)
    -x 'filter' (XPath filter for notification stream)
    -z 'usid' (User session id for AAA restriction on notification stream)
    -p 'port' (connect to ConfD at 'port')

$ ./confd_notifications -T 1 -e
Waiting for event notifications...
tick health check
tick health check
tick health check
^C
1 Like