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

1
sc start ir_agent

Stop the agent

1
sc 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

Run the following command in the command line:

1
C:\Program Files\Rapid7\Insight Agent\ir_agent.exe -v

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:

1
msiexec /i agentInstaller-x86_64.msi /qn

TIP - Maintaining the existing UUID of the agent

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

1
launchctl start com.rapid7.ir_agent

Stop the agent

1
launchctl stop com.rapid7.ir_agent

Verify the agent is running

1
ps aux | grep ir_agent

Check the version number

1
sudo grep "Agent Info" /opt/rapid7/ir_agent/components/insight_agent/common/agent.log | tail -n1

The output should appear in the following form:

1
2018-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 reinstall
2
<installer_extraction_dir>/agent_installer.sh reinstall_start

TIP - Maintaining the existing UUID of the agent

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

1
service ir_agent start
2
systemctl start ir_agent

Stop the agent

1
service ir_agent stop
2
systemctl stop ir_agent

Verify the agent is running

1
service ir_agent status
2
systemctl status ir_agent

Check the version number

1
sudo 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 reinstall
2
.<installer_extraction_dir>/agent_installer.sh reinstall_start

TIP - Maintaining the existing UUID of the agent

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