Zum Hauptinhalt springen

๐ŸชŸ Windows Agent Setup

Step-by-step guide to install the Monitron Server Agent on a Windows server.


๐Ÿ“‹ Voraussetzungenโ€‹

  • 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โ€‹

$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โ€‹

  1. Open Task Scheduler (search in Start Menu)
  2. Click Create Basic Task
  3. Name: Monitron Agent
  4. Trigger: Daily โ†’ Start time: Now โ†’ Repeat every 1 minute
  5. Action: Start a program
    • Program: powershell.exe
    • Arguments: -NoProfile -ExecutionPolicy Bypass -File C:\Monitron\monitron-agent.ps1

โœ… 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.