Saltar al contenido principal

🪟 Windows Agent Setup

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


📋 Requisitos Previos

  • 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.