confd_cmd
[(1) options] [filename
]
confd_cmd
[(1) options] -c string
confd_cmd
-h | -h commands | -h command-name
...
(1) [ -r | -o | -e | -S ] [-f [w] | [p] [ r | s ]
] [-a address
] [-p port
] [-u user
] [-g group
] [-x context
] [-s] [-m] [-h] [-d]
The confd_cmd utility is implemented as a wrapper around many common CDB and MAAPI function calls. The purpose is to make it easier to prototype and test various ConfD issues using normal scripting tools.
Input is provided as a file (default
stdin
unless a filename is given) or as
directly on the command line using the -c
option. The
confd_cmd expects commands separated by
semicolon (;) or newlines. A pound (#) sign means that the rest of
the line is treated as a comment. For example:string
confd_cmd -c get_phase
Would print the current start-phase of ConfD, and:
confd_cmd -c "get_phase ; get_txid"
would first print the current start-phase, then the current transaction ID of CDB.
Sessions towards CDB, and transactions towards MAAPI are created as-needed. At the end of the script any open CDB sessions are closed, and any MAAPI read/write transactions are committed.
Source code to this utility is included in the distribution
as src/confd/tools/confd_cmd.c
.
-d
Debug flag. Add more to increase debug level. All debug output will be to stderr.
-m
Don't load the schemas at startup.
CONFD_IPC_ADDR
, CONFD_IPC_EXTADDR
The address used to connect to the ConfD daemon, overrides the compiled in default.
CONFD_IPC_PORT
The port number to connect to the ConfD daemon on, overrides the compiled in default.
CONFD_IPC_EXTSOPATH
The absolute path to the shared object to use for a
connection using external IPC when
CONFD_IPC_EXTADDR
is given.
Getting the address of eth0
confd_cmd -c "get /sys:sys/ifc{eth0}/ip"
Setting a leaf in CDB operational
confd_cmd -o -c "set /sys:sys/ifc{eth0}/stat/tx 88"
Making ConfD running on localhost the master, with the name node0
confd_cmd -c "master node0"
Then tell the ConfD also running on localhost, but listening on port 4566, slave to the master. Calling the slave node1
confd_cmd -p 4566 -c "slave node1 node0 127.0.0.1"