We would like to stop and start an agent from another host via command line interface rather than the FMS. Is this possible?
This requires downloading the fglcmd.zip from the FMS (Management Server) [FMS_HOME]/tools directory.
KB 4311136 covers the steps to deploy fglcmd on a Linux or Windows host.
IMPORTANT: Example commands use SSL (-port 8443 -ssl
) which requires a valid SSL certificate that matches the hostname of the remote server. Using -port 8080
without -ssl
is a working alternative, but it's not recommended if this connection needs to traverse an unsecured network.
Use agent:list
command to get the IDs of the required agents.
This example would list all agents with a name that match the Regular Expression .*MYSERVER.*
./fglcmd.sh -usr foglight -pwd foglight -srv foglight.example.com -port 8443 -ssl -cmd agent:list -regex -name .*myserver.* Host: foglight.example.com ID: 49 Name: Monitor@MYSERVER Type: WindowsAgent Version: 6.1.0 (Build: 6.1.0-202203080754-RELEASE-3) Adapter ID: FglAM Status: Active/Not collecting data Health State: OK ------------------------------------ Host: foglight.example.com ID: 48 Name: MYSERVER.EXAMPLE.COM Type: DB_SQL_Server Version: 6.1.2.10 (Build: 6.1.2.10-20220728-1005) Adapter ID: FglAM Status: Active/Collecting data Health State: OK ------------------------------------
Use the agent:stop
command to stop an agent.
This example shows how to stop two agents by ID, it's normal to not get an output.
./fglcmd.sh -usr foglight -pwd foglight -srv foglight.example.com -port 8443 -ssl -cmd agent:stop -agentid 49 ./fglcmd.sh -usr foglight -pwd foglight -srv foglight.example.com -port 8443 -ssl -cmd agent:stop -agentid 48
Use the agent:start
command to start an agent.
This example shows how to start two agents by ID.
./fglcmd.sh -usr foglight -pwd foglight -srv foglight.example.com -port 8443 -ssl -cmd agent:start -agentid 49 Error : Invoke command failed due to: java.security.PrivilegedActionException: java.security.PrivilegedActionException: com.quest.nitro.service.sl.interfaces.cmdline.RemoteCommandException: Agent command was successfully applied to agent 'Monitor@MYSERVER' (id=49) but the agent did not change its state after 25.11 seconds. ./fglcmd.sh -usr foglight -pwd foglight -srv foglight.example.com -port 8443 -ssl -cmd agent:start -agentid 48
The example above shows an error message, but it can be safely ignored if the agent just took longer than expected to complete the command issued.
Please review the documentation in the Support Portal since it has more details about the available commands for fglcmd which may help complete this and other tasks more effectively.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center