Badly formatted or nonexistent path - Not a cdb path: /netconf-state

Hi,

I need to subscribe to /netconf-state/streams/stream{mystream}/subscribers but I am not able to.

I followed this topic here: How to get the subscriber status of notification stream as well as cdb-oper example from tailf examples folder…

I created a CDB SUBSCRIPTION SOCKET, then I tried to subscribe to operational data by:

cdb_oper_subscribe(sub_socket_, tncm__ns, &sub_points_[0], "/ncm:netconf-state/tncm:streams");

And I got this:

TRACE Connected (maapi) to ConfD
TRACE MAAPI_LOAD_ALL_NS
TRACE MAAPI_LOAD_MNS_MAPS
TRACE MAAPI_LOAD_HASH_DB
TRACE Connected (cdb) to ConfD
TRACE CDB_OPER_SUBSCRIBE /ncm:netconf-state/tncm:streamsDEBUG badly formatted or nonexistent path - Not a cdb path: /netconf-state
→ CONFD_ERR
Failed to subscribe to operational data: badly formatted or nonexistent path

I got the same error if I try to read from the CDB API…

Then looking at this: read-netconf-state-statistics-from-cdb it seems like those netconf-state data are actually not stored in cdb and I cannot subscribe to…

is there any way to subscribe to /netconf-state/streams/stream{mystream}/subscribers ?

Can anybody help with this, please?

Thanks!

Hi,

No, you can’t as the topics you link to state.
Another alternative to the options already suggested in those topics is to subscribe to the ConfD NETCONF log notifications.
Running, for example, the examples.confd/misc/notifications example:

$ confd_notifications -N

You will receive, among other NETCONF notifications, notifications like these when the NETCONF stream subscriber registers:

syslog: sym=86/NETCONF prio=6 msg=id=27 create-subscription stream='NETCONF' attrs: message-id="1"

Then you can just read the list of subscribers in the way you prefer. I am using the confd_load tool/maapi_save_config():

$ confd_load -dd -Fp -o -p /ncm:netconf-state/tncm:streams/tncm:stream{NETCONF}/tncm:subscriber
TRACE Connected (maapi) to ConfD
starting user session ctxt=system user=system groups=[system]
TRACE MAAPI_START_USER_SESSION  --> CONFD_OK
TRACE MAAPI_START_TRANS  --> CONFD_OK
TRACE MAAPI_SAVE_CONFIG  --> CONFD_OK
TRACE Connected (stream) to ConfD
<config xmlns="http://tail-f.com/ns/config/1.0">
    <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
    <streams xmlns="http://tail-f.com/yang/netconf-monitoring">
    <stream>
    <name>NETCONF</name>
      <subscriber>
        <session-id>7</session-id>
        <start-time>2021-04-27T07:52:22.593865+00:00</start-time>
      </subscriber>
  </stream>
  </streams>
  </netconf-state>
TRACE MAAPI_SAVE_CONFIG_RESULT  --> CONFD_OK
</config>
TRACE MAAPI_END_USER_SESSION  --> CONFD_OK
1 Like

Hi @cohult, thanks for your quick feedback!
That’s a possible option, even if it could lead to a considerable amount of unnecessary notification.

Again, many thanks for your support!

Hi @vfin

Perhaps a better solution can be found if you can describe why there is a need to subscribe to the /netconf-state/streams/stream{mystream}/subscribers value?

Thanks