Agent Controls
You can execute the following operations on the Insight Agent to perform several functions. The commands listed here are categorized according to the operating system of the asset.
Windows
Open a command prompt to execute the following commands:
Start the agent
1sc start ir_agent
Stop the agent
1sc stop ir_agent
TIP
You can also start, stop, and check the status of the Insight Agent service from the Windows Service Manager. To access the Service Manager, run services.msc
in the command line.
Check the version number
- Navigate to the version directory using the command line:
1cd C:\Program Files\Rapid7\Insight Agent\components\insight_agent\<version directory>
- Run the following command to check the version:
1ir_agent.exe --version
Alternatively, browse to the "Rapid7 Insight Agent" from your Start menu and check its properties.
Reinstall the agent
If you need to reinstall the agent for any reason and want to avoid the step of uninstalling first, you can do so by running the .msi
from the command line:
1msiexec /i agentInstaller-x86_64.msi /l*v insight_agent_install_log.log /quiet CUSTOMTOKEN=<region>:<token> REINSTALL=ALL REINSTALLMODE=vamus
TIP - Maintaining the existing UUID of the agent
Maintaining the existing UUID ensures there are no agent duplicates in your environment.
As long as the agent is already on version 2.0 or later, reinstalling in this way ensures that its previously existing UUID will remain in use as long as the C:\Program Files\Rapid7\Insight Agent\components\bootstrap\common\bootstrap.cfg
file is present at the time of reinstallation.
If you want a reinstalled agent to get a new UUID, uninstall the existing agent and completely remove the agent directory first before running the installer again.
Note that reinstalls of any agent running a version prior to 2.0 will not retain their original UUID.
Uninstall the agent
Browse to the "Rapid7 Insight Agent" from your Start menu, right click the agent icon, and select "Uninstall". You can also run the installer and select the Remove option.
Mac
Open a terminal to execute the following commands:
Start the agent
1launchctl start com.rapid7.ir_agent
Stop the agent
1launchctl stop com.rapid7.ir_agent
Verify the agent is running
1ps aux | grep ir_agent
Check the version number
1sudo grep "Agent Info" /opt/rapid7/ir_agent/components/insight_agent/common/agent.log | tail -n1
The output should appear in the following form:
12018-03-20 18:03:02,434 [INFO] agent.agent_beacon: Agent Info -- ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Version: 1.4.84 (1519676870)
Reinstall the agent
1<installer_extraction_dir>/agent_installer.sh reinstall2<installer_extraction_dir>/agent_installer.sh reinstall_start
TIP - Maintaining the existing UUID of the agent
Maintaining the existing UUID ensures there are no agent duplicates in your environment.
As long as the agent is already on version 2.0 or later, reinstalling using one of these commands ensures that its previously existing UUID will remain in use.
If you want a reinstalled agent to get a new UUID, uninstall the existing agent and completely remove the agent directory first before running the install_start
command again.
Note that reinstalls of any agent running a version prior to 2.0 will not retain their original UUID.
Uninstall the agent
1<installer_extraction_dir>/agent_installer.sh uninstall
Linux
Open a terminal to execute the following commands:
Additional commands for the Linux installer script
Run ./agent_installer --help
to see an output of all installation, service, and miscellaneous options included with the agent installer script.
Start the agent
1service ir_agent start2systemctl start ir_agent
Stop the agent
1service ir_agent stop2systemctl stop ir_agent
Verify the agent is running
1service ir_agent status2systemctl status ir_agent
Check the version number
1sudo cat /opt/rapid7/ir_agent/components/insight_agent/common/agent.log | grep "Agent Info" | tail -1l
Reinstall the agent
1.<installer_extraction_dir>/agent_installer.sh reinstall2.<installer_extraction_dir>/agent_installer.sh reinstall_start
TIP - Maintaining the existing UUID of the agent
Maintaining the existing UUID ensures there are no agent duplicates in your environment.
As long as the agent is already on version 2.0 or later, reinstalling using one of these commands ensures that its previously existing UUID will remain in use.
If you want a reinstalled agent to get a new UUID, uninstall the existing agent and completely remove the agent directory first before running the install_start
command again.
Note that reinstalls of any agent running a version prior to 2.0 will not retain their original UUID.
Uninstall the agent
1.<installer_extraction_dir>/agent_installer.sh uninstall