Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Checking the WildFly version


In this recipe, you will learn to check the version of WildFly that you are running by invoking a command to the CLI.

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 execute the following commands:

$ cd $WILDFLY_HOME
$ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 --user=wildfly --password=cookbook.2015 --command=":read-attribute(name=product-version)"
{
    "outcome" => "success",
    "result" => "9.0.0.Beta2"
}

Obviously, you can extract just the information you need by using the awk command in the output (you can use whichever tool you are comfortable with), as follows:

$ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 --user=wildfly --password=cookbook.2015 --command=":read-attribute(name=product-version)" | awk 'NR==3 { print $3 }'
"9.0.0.Beta2"

In case you are running WildFly in the domain mode, the invocation...