Use the IT Agent Discovery to identify and track assets that connect to your network. You can install it interactively or silently, depending on your deployment needs.
Prerequisites
Supported operating systems
Install the agent
Recommended for most users.
In your preferred site, go to Discovery > Systems > Download installers/packages.
Select IT Agent Discovery > Download IT Agent disk image.
Open the installation file.
If the software is blocked, go to System Preferences > Security & Privacy > Open Anyways.
In the setup wizard, choose an installation directory, then select Next.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
Paste the copied linking code into the installer and select Next.
Select Next again to start the installation.
In your preferred site, go to Discovery > Systems > Download installers/packages.
Select IT Agent Discovery > Download IT Agent package and Download IT Agent package silent installation configuration to download both files.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
On your computer, open the downloaded IT Agent package silent installation configuration file.
In the file, replace cloudtokenvalue with your copied linking code. If the computer requires a proxy server, remove the # for proxyserver=myproxyserver.domain.local and proxyport=8080.
#!/bin/sh
PreinstallConfig="/tmp/LansweeperITAgent-Preinstall.cfg" # Don't change this path!
[ -f $PreinstallConfig ] && chmod 744 $PreinstallConfig
cat > $PreinstallConfig << EOF
mode=unattended
accepteula=1
path=/Library/Application Support/Lansweeper IT Agent Discovery
cloudtoken=cloudtokenvalue
#proxyserver=myproxyserver.domain.local
#proxyport=8080
EOF
chmod 744 $PreinstallConfig
Enter the following command:
sudo LansweeperITAgent-PreinstallScript_stable.sh
Enter the following command, replacing X.X.X in Lansweeper-IT-agent-discovery-X.X.X with the version number of your installer.
The version numbers for your installer can be found in your Lansweeper site. Go to Discovery > Download installers/packages > IT Agent Discovery > Version and locate your installer.
sudo installer -pkg Lansweeper-IT-agent-discovery-X.X.X-osx-installer.pkg -target /
In your preferred site, go to Discovery > Systems > Download installers/packages.
Select IT Agent Discovery > Download IT Agent disk image to download the installer.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
In an elevated command prompt, enter the following command to mount the DMG file:
hdiutil attach Lansweeper-IT-agent-discovery-0.9.0-16-osx-installer.dmg
To navigate the volume, enter:
cd "/Volumes/Lansweeper IT Agent Discovery"
Enter the following command, replacing X.X.X in Lansweeper-IT-agent-discovery-X.X.X-X-osx-installer.dmg with the version number of your installer. If the computer requires a proxy server, add parameters --proxyserver proxyserveraddress and --proxyport 8080.
The version numbers for your installer can be found in your Lansweeper site. Go to Discovery > Download installers/packages > IT Agent Discovery > Version and locate your installer.
sudo Lansweeper-IT-agent-discovery-X.X.X-X-osx-installer.app/Contents/MacOS/installbuilder.sh --mode unattended --accepteula 1 --path "/Library/Application Support/Lansweeper IT Agent Discovery" --cloudtoken cloudtokenvalue
Copy the following script:
#!/bin/bash
# ==============================================
# Lansweeper IT Agent Discovery Silent Installer (macOS)
# ==============================================
# --- 1. Set Cloud Token Variable ---
CLOUDTOKEN="cloudtokenvalue" # Replace with your linking code
# --- 2. Define Download URLs ---
INSTALLER_URL="https://download.lansweeper.com/stable/MAC/it-agent-discovery-pkg/latest"
CONFIG_URL="https://download.lansweeper.com/stable/MAC/pkg-scripts/it-agent-discovery-stable/latest"
# --- 3. Define Local File Paths ---
WORKDIR="/tmp/lansweeper-install"
INSTALLER_PKG="$WORKDIR/lansweeper-it-agent-discovery.pkg"
CONFIG_SCRIPT="$WORKDIR/it-agent-config.sh"
# --- 4. Prepare Work Directory ---
rm -rf "$WORKDIR"
mkdir -p "$WORKDIR"
# --- 5. Download Installer and Config ---
echo "Downloading Lansweeper IT Agent Discovery installer..."
curl -L "$INSTALLER_URL" -o "$INSTALLER_PKG"
echo "Downloading Lansweeper config script..."
curl -L "$CONFIG_URL" -o "$CONFIG_SCRIPT"
# --- 6. Insert Cloud Token into Config ---
echo "Updating config script with cloud token..."
sed -i.bak "s/cloudtokenvalue/$CLOUDTOKEN/g" "$CONFIG_SCRIPT"
rm -f "$CONFIG_SCRIPT.bak"
# --- 7. Run Silent Install ---
echo "Running silent installation..."
sudo installer -pkg "$INSTALLER_PKG" -target /
# --- 8. Apply Config Script (if required by Lansweeper docs) ---
echo "Applying configuration..."
sudo bash "$CONFIG_SCRIPT"
# --- 9. Cleanup ---
rm -f "$INSTALLER_PKG"
echo "Installer removed."
echo " Lansweeper IT Agent Discovery installation completed."
On your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
In the first section of the script, replace cloudtokenvalue with your copied linking code.
Save your file as a Bash script, for example: install-ls-it-agent.sh.
Make the script executable by running: chmod +x install-ls-it-agent.sh.
Run the script with elevated permissions: sudo ./install-ls-it-agent.sh.
Next steps
Now that your IT Agent is installed, you can create a discovery action to specify when discovery should occur.