Yes it is possible to run fglcmd utility remotely.
Steps to setup fglcmd remotely
- Locate
fglcmd.zip on the [FMS_HOME]/tools directory from the FMS (Foglight Management Server) - Transfer the zip file to the desired host
- Unzip the contents of the file into a known directory (e.g.
~/client/*) - Confirm that Java 8 is installed (e.g.
java -version) - Create a new
fglcmd.sh (if running on Linux) or fglcmd.bat (if running on Windows)
Example fglcmd.sh for Linux
# Set or replace ${JAVA_HOME} with the path to the JRE directory
# Set or replace ${CLIENT_DIR} with the path to the where the Foglight client files were extracted
"${JAVA_HOME}/bin/java" -server -jar "${CLIENT_DIR}/foglight-cmdline-client.jar" "$@"
# Remember to grant execution privileges to this script (chmod +x fglcmd.sh)
Example fglcmd.bat for Windows
rem Set or replace %JAVA_HOME% with the path to the JRE directory
rem Set or replace %CLIENT_DIR% with the path to the where the Foglight client files were extracted
"%JAVA_HOME%\bin\java.exe" -server -jar "%CLIENT_DIR%\foglight-cmdline-client.jar" %*
Considerations when running fglcmd remotely
- When running the fglcmd to a remote FMS, specify the -srv (which is the foglight server hostname) and the -port (which is the port number of the Foglight web console)
- Example: fglcmd.bat -usr foglight -pwd foglight -srv hostname.example.com -port 8080 -cmd schedule:list
- If the remote FMS only accepts connections over SSL, the command will need to include -ssl parameter
- Example: fglcmd.bat -usr foglight -pwd foglight -srv hostname.example.com -ssl -port 8443 -cmd schedule:list
- When using SSL, fglcmd will require to validate the hostname passed in the -srv parameter matches the SSL certificate
- When using SSL, fglcmd will need to validate the chain of trust of that SSL certificate, review KB 4284088 for the local JRE installation if it returns error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target."