I use callpoint to provide data. It successfully returns the list but not individual element. Any suggestion where to look? Thank you.
ubuntudsk1# show alarms alarm-inventory alarm-type
ALARM
ALARM TYPE TYPE WILL
ID QUALIFIER RESOURCE CLEAR SEVERITY LEVEL DESCRIPTION
-------------------------------------------------------------------------------------------------------------
test-alarm [ any ] true [ warning minor major critical ] Test alarm
ubuntudsk1# show alarms alarm-inventory alarm-type test-alarm ""
--------------------------------------------------------------^
syntax error: unknown argument
I suspect you do not implement get_elem correctly. This callback needs to response to an invocation with a path like /alarms/alarm-inventory/alarm-type{X Y}/alarm-type-id (or generally, for any list the data provider needs to be able to handle get_elem targeted at the list’s first key element). ConfD uses this to verify whether given instance exists and your DP needs to respond with the key value if it does, or not_found if it does not.
Se developerLogLevel to trace and have a look at your devel.log, ConfD logs every callback request/response there.
I double checked my code. It seems it implemented according to documentation. There is nothing suspicious in devel.log. Still it doesn’t behave like in your example.
Is it possible to get your code to compare with mine to see what’s wrong on my side. Could you upload please or send it to me?
Thank you.
I used the alarm data model but let ConfD to keep the data in its operational CDB, to verify there is nothing odd with the data model. But you can have a look at the intro/5-c_stats example; it uses the arp table as the source of operational data, but with minor tweaking you can feed it your data with "" for an empty “interface name”:
@@ -113,7 +113,7 @@
free_arp(dp);
- if ((fp = popen("arp -an", "r")) == NULL)
+ if ((fp = popen("cat /tmp/arplist", "r")) == NULL)
return CONFD_ERR;
while (fgets(&buf[0], BUFSIZ, fp) != NULL) {
char *cp = strtok(&buf[0], sep);
@@ -169,7 +169,11 @@
/* cp should now point to the interface name
- this is required since it is a key */
if (cp) {
- ae->iface = strdup(cp);
+ if (strcmp(cp, "\"\"") == 0) {
+ ae->iface = strdup("");
+ } else {
+ ae->iface = strdup(cp);
+ }
/* Some OSes have perm/pub after interface name */
while ((cp = strtok(NULL, sep)) != NULL) {
You can verify it works fine with these changes and you can do stuff like
box# show arpentries arpe 10.0.0.23 "" permanent
permanent false
box#
I am not sure about the purpose of this option and also have no idea how it ended up in my confd.conf
but it screwing things big time.
Thanks for the support.