onos-all: send CLI command to all cell nodes

Example:
$ onos-all set TRACE org.onosproject.net.intent.impl.compiler.ProtectedTransportIntentCompiler

Change-Id: I40dcf7b8a6e89b910eb5070eee6a1c312fb9689d
This commit is contained in:
Yuta HIGUCHI 2017-02-13 16:49:59 -08:00
parent 5691faf532
commit c1e5f802bc

28
tools/test/bin/onos-all Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
function _usage () {
cat << _EOF_
usage:
$(basename $0) (ONOS CLI commands)
summary:
Issue ONOS CLI commands to all the nodes defined in the current cell.
_EOF_
}
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
if [ "$#" -eq 0 ]; then
echo "Expecting ONOS CLI commands"
_usage
exit 1
fi
[ "$1" = "-h" ] && _usage && exit 0
[ "$1" = "--help" ] && _usage && exit 0
for node in $nodes; do
echo "Issuing command on $node.."
ssh -p 8101 -o StrictHostKeyChecking=no $node "$@"
done