๐ช Windows Agent Setup
Step-by-step guide to install the Monitron Server Agent on a Windows server.
๐ Prerequisitesโ
- Windows Server 2019+ or Windows 10/11
- PowerShell 5.1+ (pre-installed on modern Windows)
- Outbound HTTPS access to your Monitron instance
๐ฅ Step 1: Download the Agentโ
Copy monitron-agent.ps1 from your Monitron installation's agent/ folder to your Windows server.
Suggested location: C:\Monitron\monitron-agent.ps1
โ๏ธ Step 2: Configureโ
Edit the script in PowerShell ISE or Notepad:
notepad C:\Monitron\monitron-agent.ps1
Change these lines at the top:
$MONITRON_URL = "https://your-monitron-instance.com"
$MONITRON_KEY = "your-agent-key-here"
๐ Step 3: Set Execution Policyโ
PowerShell may block script execution by default:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
โฐ Step 4: Create Scheduled Taskโ
Option A: PowerShell (Recommended)โ
$action = New-ScheduledTaskAction `
-Execute "powershell.exe" `
-Argument "-NoProfile -ExecutionPolicy Bypass -File C:\Monitron\monitron-agent.ps1"
$trigger = New-ScheduledTaskTrigger `
-Once -At (Get-Date) `
-RepetitionInterval (New-TimeSpan -Minutes 1) `
-RepetitionDuration ([TimeSpan]::MaxValue)
Register-ScheduledTask `
-TaskName "Monitron Agent" `
-Action $action `
-Trigger $trigger `
-User "SYSTEM" `
-RunLevel Highest `
-Description "Monitron server monitoring agent"
Option B: Task Scheduler GUIโ
- Open Task Scheduler (search in Start Menu)
- Click Create Basic Task
- Name:
Monitron Agent - Trigger: Daily โ Start time: Now โ Repeat every 1 minute
- Action: Start a program
- Program:
powershell.exe - Arguments:
-NoProfile -ExecutionPolicy Bypass -File C:\Monitron\monitron-agent.ps1
- Program:
โ Step 5: Verifyโ
Run it manually first:
powershell -ExecutionPolicy Bypass -File C:\Monitron\monitron-agent.ps1
Check your Monitron dashboard โ the server should appear within a minute.
๐ง Troubleshootingโ
Script won't runโ
# Check execution policy
Get-ExecutionPolicy -List
# Set for current user
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
SSL/TLS errorsโ
# Force TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Add this line at the top of the agent script if needed.