ConfD User Community

Confd subagent example


#1

I refered below link to understand how the subagents work.

But I could not get it working on confd-6.2.1. I have kept both dhcpd.fxs and hst.fxs in etc/confd/ folder and ran master confd.conf first.

I used two diffrent confd.conf files for the master and subagent. But when I tried to run master - which had the subagent section in confd.conf file, I got the error:
“Bad configuration: …/etc/confd/confd.conf:0: /confdConfig/datastores/candidate/implementation must not be ‘confd’ when subagents are used\n”

So I changed the candidate to “external”, but then I got the error:
17-May-2018::12:41:12.305 ucc1 confd[3734]: - Bad configuration: …/etc/confd/confd.conf:0: bad mount node: hosts in http://tail-f.com/ns/example/hst
“Bad configuration: …/etc/confd/confd.conf:0: bad mount node: hosts in http://tail-f.com/ns/example/hst\n


#2

With or without your own modification from the original example? The original example has the candidate feature disabled.

If you have enabled the candidate feature on the master, then the same candidate feature will need to one enabled on the subagent. Refer to the subagent requirements section of the Subagents and Proxies chapter of the ConfD User Guide for more information on this.

Again check to make sure that you have candidate enabled in both the master and all the subagents.

Additional help may be provided if you can let us know what you have modified from the original example.


#3

The Master/Subagent feature of NETCONF
To begin with I made changes in confd.conf of 1-2-3-start-query-model (master) - added subagents section outside the “confdConfig” end tag and started. Then I made the changes in 6-c_config and did ‘make all start’ - I got the below error:
Bad configuration: confd.conf:0: Internal error: {file_load_error,“Is implemented by a subagent, but subagent support is not enabled”}
Daemon died status=21
make: *** [start] Error 21

Then the master also closes the connection:
DEBUG EOF on socket to ConfD
terminate sub_read: -2
make: *** [start_subscriber] Error 1


#4

The subagents block should be inside of the confdConfig block and not outside.

If you need further help with debugging, can you show the changes you have made to each confd.conf?


#5

Hi,

I am using example from ‘confd-basic-6.3/examples.confd/intro/1-2-3-start-query-model’ folder. I copied subagent information given in the previous link under confdConfig - just after loadPath. If I compile and run ‘make all start’, I get an error:

/root/confd-6.3/bin/confd -c confd.conf --addloadpath /root/confd-6.3/etc/confd
Bad configuration: confd.conf:0: bad mount node: hosts in http://tail-f.com/ns/example/hst
Daemon died status=21
make: *** [start_confd] Error 21

So I moved it out.

[Additional change]: Now I kept the hst.fxs in 1-2-3-start-query-model folder and started master by keeping subagent within the confdConfig. It worked.

Similarly I have added confdIpcAddress, cli sections in confd.conf of 6-c_config. Same values as mentioned in previous link. Changed the ports in transport section. Changed the port in hosts.c , removed the callpoints in hst.yang and compiled it for subagent.
/root/confd-6.3/bin/confdc -c --subagent / -o hst.fxs hst.yang
make all start

/root/confd-6.3/bin/confdc --emit-h hst.h hst.fxs
Build complete
Killing any confd daemon and HOSTS confd agents
/root/confd-6.3/bin/confd --stop || true
connection refused (stop)
killall hosts || true
hosts: no process found
/root/confd-6.3/bin/confd -c confd.conf --addloadpath /root/confd-6.3/etc/confd
Bad configuration: confd.conf:0: Internal error: {file_load_error,“Is implemented by a subagent, but subagent support is not enabled”}
Daemon died status=21
make: *** [start] Error 21

Now, deleted the hst.fxs from 6-c_config and things started working.

Thanks.