Obtaining Last-modification-time for startup and running cdb

Hi,
Is there any API to access the timestamp of when last time startup and running configuration was updated?

Hi,

There is no timestamp stored in the status for the datastores, so you would have to use for example notifications subscribing to netconf-config-change events from the built-in NETCONF notification stream for when they are updated and store a timestamp somewhere, e.g. persisted in the CDB operational datastore. See the “Notifications” chapter in the UG, the confd_lib_events(3) man page, and the examples.confd/misc/notifications example NETCONF stream option.

If you just want to find out if the startup datastore is in sync with running you can use the maapi_is_running_modified() function. See the confd_lib_maapi(3) man page for details.

Apart from notifications, as mentioned by Conny, perhaps you can use rollbacks: if you have rollbacks turned on, there is maapi_list_rollbacks for getting rollback descriptors including a timestamp.

Thanks a lot for the ideas. So following would work as rough estimates of timestamp then

running: timestamp of `rollback0` file
startup: timestamp of `A.cdb` file

Right?

Well, I meant reading the rollback descriptors via ConfD API, but this might work too, unless there are other components that access these files. Note though that A.cdb might be subject to journal compaction - either automatically or if that is turned off, you are probably doing that “manually”.