In this recipe, you will learn how to get the OS version that WildFly is running on by invoking a command to the CLI.
Remember I'm running WildFly remotely, bound to 192.168.59.103
as IP. WildFly is already up and running.
Open a new terminal window and run the following commands:
$ cd $WILDFLY_HOME $ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 --user=wildfly --password=cookbook.2015 --command="/core-service=platform-mbean/type=operating-system:read-resource(include-runtime=true,include-defaults=true)" { "outcome" => "success", "result" => { "name" => "Linux", "arch" => "amd64", "version" => "3.18.5-tinycore64", "available-processors" => 8, "system-load-average" => 0.0, "object-name" => "java.lang:type=OperatingSystem" } }
Obviously, you can extract just the information you need using the
awk
command in the output (you can use whichever tool you are...