Invoking CLI commands

In this recipe, you will learn how to invoke CLI commands directly from your command line without accessing the CLI itself, let's say not in an interactive way. This technique might be helpful in case you have to script some processes, like stopping and starting servers in a sequence, deploying an application only if another one has already been deployed, and so on. Often times, you also need to monitor some state, thus you just need that number (as typically seen in Nagios).

Getting ready

Remember I'm running WildFly remotely, bound to 192.168.59.103 as IP. WildFly is already up and running.

How to do it…

On your local PC, open a new terminal window and run the following commands:

$ cd $WILDFLY_HOME $ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 ...

Get WildFly Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.