Magic Suite Agent

What is the Magic Suite Agent?

The Magic Suite Agent is a lightweight service that runs on your servers to enable Magic Suite to interact with your infrastructure. It provides capabilities including:

  • SNMP monitoring - discover and poll network devices
  • SQL queries - execute queries against local databases via Agent.Sql macros
  • Web queries - make HTTP requests from within your network via Agent.WebQuery macros
  • Syslog collection - receive and forward syslog messages
  • NetFlow collection - receive and forward NetFlow data
  • PowerShell execution - run PowerShell scripts on the host

The agent connects outbound to your Magic Suite instance - no inbound firewall rules are required.

Downloading the Agent

Agent installers are available for Windows, Linux, and macOS. Download the installer for your platform from the links below:

PlatformDownloadFormat
WindowsDownload Windows InstallerSelf-installing executable (MagicSuite.Agent.exe)
LinuxDownload Linux BinarySelf-contained executable
macOSDownload macOS BinarySelf-contained executable

Note: Each Magic Suite environment serves its own agent version. If you are using a non-production environment (e.g. beta, test), download the agent from the corresponding environment URL, for example https://www.beta.magicsuite.net/agent/windows.

Installing on Windows

The Windows agent is a single program, MagicSuite.Agent.exe, that installs itself as a Windows service. Run it from a Command Prompt or PowerShell opened as Administrator.

New Installation

  1. Download MagicSuite.Agent.exe from the link above.
  2. Open a Command Prompt or PowerShell as Administrator, go to the folder you downloaded it to, and run:
    .\MagicSuite.Agent.exe install
  3. The installer will:
    • Copy the agent to C:\Program Files\Magic Suite Agent\
    • Register the MagicSuiteAgent Windows service, set to start automatically
    • Set the service to restart automatically if it fails
    • Start the service
  4. Create or edit C:\Program Files\Magic Suite Agent\appsettings.json to configure the agent (see Configuration below). Open your editor as Administrator to save into that folder.
  5. Restart the service so it reads the configuration: sc stop MagicSuiteAgent, then sc start MagicSuiteAgent

To install somewhere else, add --path "D:\Magic Suite Agent". To install without starting the service, add --no-start.

Upgrading on Windows

  1. Download the latest MagicSuite.Agent.exe from the link above.
  2. As Administrator, run:
    .\MagicSuite.Agent.exe upgrade

The installer stops the service, replaces the agent, and starts it again. Your existing appsettings.json and appsettings.Local.json are not overwritten. If the new version is the same as the one installed, nothing is changed unless you run .\MagicSuite.Agent.exe install --force.

Migrating from a Legacy Agent

If an older agent is installed in C:\Program Files\Magic Suite Agent 3, Magic Suite Agent 2 or MagicSuite Agent, run the same install command. When there is no appsettings.json in the new location, the installer copies appsettings.json and appsettings.Local.json across from the old folder, then removes the old agent. To skip this, add --no-migrate.

Checking the Installation

.\MagicSuite.Agent.exe status
sc query MagicSuiteAgent

Automated Installation

The installer does not ask any questions, so the same command works in a script or deployment tool, as long as it runs with Administrator rights. Place your appsettings.json in the install folder afterwards, then restart the service.

Uninstalling on Windows

As Administrator, run:

.\MagicSuite.Agent.exe uninstall

The service is stopped and removed, and the agent's files are deleted. Your appsettings files are kept. Add --remove-all to delete the folder completely.

Installing on Linux

New Installation

  1. Download the Linux binary:
    curl -o MagicSuite.Agent https://www.magicsuite.net/agent/linux
    chmod +x MagicSuite.Agent
  2. Move it to the install location:
    sudo mkdir -p /opt/magicsuite-agent
    sudo mv MagicSuite.Agent /opt/magicsuite-agent/
  3. Create the configuration file (see Configuration below):
    sudo nano /opt/magicsuite-agent/appsettings.json
  4. Create a systemd service file:
    sudo tee /etc/systemd/system/magicsuite-agent.service > /dev/null <<EOF
    [Unit]
    Description=Magic Suite Agent
    After=network.target
    
    [Service]
    Type=notify
    ExecStart=/opt/magicsuite-agent/MagicSuite.Agent
    WorkingDirectory=/opt/magicsuite-agent
    Restart=always
    RestartSec=10
    User=root
    
    [Install]
    WantedBy=multi-user.target
    EOF
  5. Enable and start the service:
    sudo systemctl daemon-reload
    sudo systemctl enable magicsuite-agent
    sudo systemctl start magicsuite-agent

Upgrading on Linux

  1. Stop the service: sudo systemctl stop magicsuite-agent
  2. Download the new binary:
    sudo curl -o /opt/magicsuite-agent/MagicSuite.Agent https://www.magicsuite.net/agent/linux
    sudo chmod +x /opt/magicsuite-agent/MagicSuite.Agent
  3. Start the service: sudo systemctl start magicsuite-agent

Your configuration files are not overwritten.

Checking Status on Linux

sudo systemctl status magicsuite-agent
sudo journalctl -u magicsuite-agent -f

Installing on macOS

New Installation

  1. Download the macOS binary:
    curl -o MagicSuite.Agent https://www.magicsuite.net/agent/macos
    chmod +x MagicSuite.Agent
  2. Move it to the install location:
    sudo mkdir -p /opt/magicsuite-agent
    sudo mv MagicSuite.Agent /opt/magicsuite-agent/
  3. Create the configuration file (see Configuration below):
    sudo nano /opt/magicsuite-agent/appsettings.json
  4. Create a launchd plist:
    sudo tee /Library/LaunchDaemons/com.panoramicdata.magicsuite-agent.plist > /dev/null <<EOF
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Label</key>
    	<string>com.panoramicdata.magicsuite-agent</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/opt/magicsuite-agent/MagicSuite.Agent</string>
    	</array>
    	<key>WorkingDirectory</key>
    	<string>/opt/magicsuite-agent</string>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>KeepAlive</key>
    	<true/>
    </dict>
    </plist>
    EOF
  5. Load and start the service:
    sudo launchctl load /Library/LaunchDaemons/com.panoramicdata.magicsuite-agent.plist

Upgrading on macOS

  1. Unload the service: sudo launchctl unload /Library/LaunchDaemons/com.panoramicdata.magicsuite-agent.plist
  2. Download the new binary:
    sudo curl -o /opt/magicsuite-agent/MagicSuite.Agent https://www.magicsuite.net/agent/macos
    sudo chmod +x /opt/magicsuite-agent/MagicSuite.Agent
  3. Reload the service: sudo launchctl load /Library/LaunchDaemons/com.panoramicdata.magicsuite-agent.plist

Configuration

The agent is configured via appsettings.json. You can also use appsettings.Local.json for environment-specific overrides (this file takes precedence and is preserved across upgrades).

Minimum Required Configuration

At minimum, you need to configure the agent to connect to your Magic Suite instance:

{
  "Agents": [
	{
	  "ApiUrl": "https://api.magicsuite.net/",
	  "ApiTokenName": "your-token-name",
	  "ApiTokenKey": "your-token-key",
	  "ConnectionId": 123
	}
  ]
}

Where:

  • ApiUrl - The URL of your Magic Suite API (e.g. https://api.magicsuite.net/ for production)
  • ApiTokenName and ApiTokenKey - An API token created in the Magic Suite Admin App under API Tokens
  • ConnectionId - The ID of the Agent Connection configured in the Admin App under Connections

Full Configuration Reference

SettingTypeDefaultDescription
DiscoveryLoopDelayMsint10Delay in milliseconds between discovery polling loops
StartUpDelaySecondsint10Delay in seconds before the agent starts processing after service start
Agents[].ApiUrlstring-Magic Suite API endpoint URL
Agents[].ApiTokenNamestring-API token name
Agents[].ApiTokenKeystring-API token key
Agents[].ConnectionIdint-Agent Connection ID from Admin App
Agents[].MaxConcurrentRequestsint5Maximum concurrent requests (capped at CPU core count)

Optional Feature Configuration

The agent supports additional features that can be enabled per-agent:

MonitorMagic (SNMP Monitoring)

"MonitorMagic": {
  "Properties": {
	"subnets": {
	  "Type": "List<string>",
	  "Value": "[ \"10.0.0.0/24\" ]",
	  "Description": "Subnets to scan for devices"
	}
  }
}

Syslog Collection

"Syslog": {
  "LocalAddress": "Any",
  "UdpPort": 514
}

NetFlow Collection

"NetFlow": {
  "LocalAddress": "Any",
  "UdpPort": 2055
}

Logging Configuration

Logging is configured via Serilog in the Serilog section of appsettings.json. The default configuration writes to the console and to rolling log files:

"Serilog": {
  "MinimumLevel": {
	"Default": "Information",
	"Override": {
	  "Microsoft": "Warning",
	  "System": "Warning"
	}
  },
  "WriteTo": [
	{
	  "Name": "Console"
	},
	{
	  "Name": "File",
	  "Args": {
		"path": "Logs/MagicSuiteAgent.log",
		"rollingInterval": "Day"
	  }
	}
  ]
}

Setting Up an Agent Connection

Before the agent can communicate with Magic Suite, you need to create an Agent Connection in the Admin App:

  1. In the Admin App, go to Connections.
  2. Click Create.
  3. Set the Type to Agent.
  4. Give it a descriptive Name (e.g. “London Office Agent”).
  5. Leave the URL and credentials fields blank (the agent connects outbound).
  6. Click Save and note the Connection ID shown.
  7. Use this Connection ID in your agent’s appsettings.json.

Verifying the Agent

Once configured and running, you can verify the agent is connected:

  • In the Admin App, go to Connections and check the status of your Agent Connection.
  • A connected agent will show a green status indicator.
  • Check the agent logs for any connection errors.

Troubleshooting

IssueSolution
Agent service won’t startCheck that appsettings.json exists and is valid JSON. Check the Windows Event Log or systemd journal for errors.
Agent can’t connect to APIVerify the ApiUrl is reachable from the agent host. Check firewall rules allow outbound HTTPS (port 443).
Authentication errorsVerify your ApiTokenName and ApiTokenKey are correct and the token has not expired.
Connection ID not foundEnsure the ConnectionId matches an existing Agent Connection in the Admin App.
SNMP discovery not workingCheck that the subnet configuration is correct and SNMP (UDP 161) is reachable from the agent host.

Reconnection

Reconnection

Reconnection

timed out

timed out

Attempt of

Reload
An unhandled error has occurred. Reload 🗙