# Is there a simple way to monitor ConfD notifications in run-time?

**URL:** https://dmap-community.ductus.global/t/is-there-a-simple-way-to-monitor-confd-notifications-in-run-time/120
**Category:** Core Engine and APIs
**Created:** [June 18, 2015, 10:52am UTC](https://dmap-community.ductus.global/t/is-there-a-simple-way-to-monitor-confd-notifications-in-run-time/120 "2015-06-18T10:52:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [June 18, 2015, 10:52am UTC](https://dmap-community.ductus.global/t/is-there-a-simple-way-to-monitor-confd-notifications-in-run-time/120/1 "2015-06-18T10:52:22Z")

</div>

The example program in `$CONFD_DIR/examples.confd/misc/notifications` implemented by `confd_notifications.c` can also serve as a nice tool and be used standalone in a development environment to monitor ConfD events.

Quick demo:

_In terminal 1 we subscribe to all events except heartbeat using the confd\_notifications program:_

```
$ pwd
/Users/conny/tailf/confd-basic-5.4/examples.confd/misc/notifications
$ ./confd_notifications 
./confd_notifications usage:
    -d (daemon log messages)
    -D (developer log messages)
    -a (audit log messages)
    -N (NETCONF log messages)
    -S (SNMP log messages)
    -t (takeover mode for syslog)
    -u (user session messages)
    -c (commit simple messages)
    -i (iterate over commit diff)
    -f (commit failed messages)
    -C (confirmed-commit messages)
    -P (commit progress messages)
    -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)
    -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')
$ make start START_FLAGS=-A
/Users/conny/tailf/confd-basic-5.4/bin/confd -c ./confd.conf --addloadpath /Users/conny/tailf//confd-basic-5.4/etc/confd
./confd_notifications -A
Waiting for event notifications...
syslog: sym=29/STARTED prio=6 msg=ConfD started vsn: 5.4

```

_In terminal 2 we commit a transaction over NETCONF:_

```
$ netconf-console -i
* Enter a NETCONF operation, end with an empty line
<edit-config>
  <target>
    <running/>
  </target>
  <config xmlns="http://tail-f.com/ns/config/1.0">
    <root xmlns="http://tail-f.com/ns/example/noti">
      <bar>3210</bar>
    </root>
  </config>
</edit-config>

<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>

```

_In terminal 1 we now received event notifications triggered by the NETCONF edit-config transaction:_

```
audit: sym=107/SSH_LOGIN, user=admin usid=0 msg=logged in over ssh from 127.0.0.1 with authmeth:password
syslog: sym=86/NETCONF prio=1 msg=id=11 new ssh session for user "admin" from 127.0.0.1
audit: sym=104/GROUP_ASSIGN, user=admin usid=11 msg=assigned to groups: admin
user session: type=1, user=admin usid=11 db=0
syslog: sym=86/NETCONF prio=2 msg=id=11 got rpc: {urn:ietf:params:xml:ns:netconf:base:1.0}edit-config attrs: message-id="2"
user session: type=5, user=admin usid=11 db=2
syslog: sym=86/NETCONF prio=2 msg=id=11 edit-config target=running attrs: message-id="2"
Commit progress on db 2 usid 11 thandle 6:
 entering validate phase for running...

Commit progress on db 2 usid 11 thandle 6:
   validate: grabbing transaction lock...
Commit progress on db 2 usid 11 thandle 6:
  ok

Commit progress on db 2 usid 11 thandle 6:
   validate: creating rollback file...
Commit progress on db 2 usid 11 thandle 6:
  ok

Commit progress on db 2 usid 11 thandle 6:
   validate: run transforms and transaction hooks...
Commit progress on db 2 usid 11 thandle 6:
  ok

Commit progress on db 2 usid 11 thandle 6:
   validate: pre validate...
Commit progress on db 2 usid 11 thandle 6:
  ok

Commit progress on db 2 usid 11 thandle 6:
   validate: run validation over the change set...

Commit progress on db 2 usid 11 thandle 6:
   validate: validation over the change set done

Commit progress on db 2 usid 11 thandle 6:
   validate: run dependency-triggered validation...

Commit progress on db 2 usid 11 thandle 6:
   validate: dependency-triggered validation done

user session: type=6, user=admin usid=11 db=2
syslog: sym=86/NETCONF prio=2 msg=id=11 sending rpc-reply, attrs: message-id="2"

```

_In terminal 1 we now restart the confd\_notifications program to listen only for commit events:_

```
$ pwd
/Users/conny/tailf/confd-basic-5.4/examples.confd/misc/notifications
$ make start START_FLAGS=-c
...
/Users/conny/tailf/confd-basic-5.4/bin/confd -c ./confd.conf --addloadpath /Users/conny/tailf/confd-basic-5.4/etc/confd
./confd_notifications -c
Waiting for event notifications...

```

_In terminal 2:_

```
$ netconf-console -i
Enter a NETCONF operation, end with an empty line
<edit-config>
  <target>
    <running/>
  </target>
  <config xmlns="http://tail-f.com/ns/config/1.0">
    <root xmlns="http://tail-f.com/ns/example/noti">
      <bar>0123</bar>
    </root>
  </config>
</edit-config>

<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>

```

_In terminal 1 we now see that our application received the CONFD\_NOTIF\_COMMIT\_SIMPLE notification event:_

```
Waiting for event notifications...
commit on db 2 from user admin usid 11
```

---

<div class="post-metadata">

### Author: ![priyamadhu](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@priyamadhu](https://dmap-community.ductus.global/u/priyamadhu)
#### Post date: [April 11, 2019, 10:54pm UTC](https://dmap-community.ductus.global/t/is-there-a-simple-way-to-monitor-confd-notifications-in-run-time/120/2 "2019-04-11T22:54:24Z")

</div>

Hi Cohult,

I am trying to find out what steps does confd do during  
“Commit progress on db 2 usid 11 thandle 6:  
validate: pre validate…” ?  
I am getting an get\_elem request for callpoint (Operational data) during this phase. I am trying to figure out why this is happening and if I can get some info on what happens in the “pre validate” step by confd, maybe I can figure out why/where this callpoint is invoked.

My Question is what confd does in pre validate step.

Thanks for your help in advance.

-Priya Madhu

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [May 8, 2019, 1:19pm UTC](https://dmap-community.ductus.global/t/is-there-a-simple-way-to-monitor-confd-notifications-in-run-time/120/3 "2019-05-08T13:19:38Z")

</div>

@priyamadhu Please create a new topic instead of replying to an unrelated one.
