Skip to content

Commit

Permalink
chore: Add script to install Rapid7 Insight Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
talltechy committed Apr 19, 2024
1 parent 981ef60 commit 86c6bda
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/rapid7/tools/install_insight_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
import glob
import subprocess

# Get the current directory
current_directory = os.path.dirname(os.path.abspath(__file__))

# Search for the installer files in the current directory
installer_files = glob.glob(os.path.join(current_directory, "agent_installer-*.sh"))

if not installer_files:
# Prompt the user to provide the location of the installer file
installer_file = input("Please enter the location of the installer file: ")
else:
# Use the first found installer file
installer_file = installer_files[0]

# Make the installer file executable
os.chmod(installer_file, 0o755)

# Prompt the user to input the token
token = input("Please enter the token: ")

# Continue with the installation
print("Installing Rapid7 Insight Agent...")
subprocess.run(["sudo", installer_file, "install_start", "--token", token], check=True)

print("Installation completed successfully!")

0 comments on commit 86c6bda

Please sign in to comment.