Watchlog Agent Installation Guide
This guide will walk you through the steps to install and run the Watchlog Agent on your server.
The Watchlog Agent is a Node.js application designed to collect and send server metrics to Watchlog.
Please follow the steps below to get started.
Ubuntu
Windows Server
Source (Other Servers)
How to install Watchlog on Windows Server?
Installation
Install the Watchlog Agent with the following command: Replace
your-api-key
and your-server
with your actual Watchlog API key and server from your Dashboard. Important: Open
PowerShell
as Administrator before running the following command. PowerShell - Run as Administrator:
$wl_apiKey="your-api-key"; $wl_server="your-server"; $wl_memory="300M"; iwr https://watchlog.io/windows/install-watchlog.ps1 -OutFile "$env:TEMP\install-watchlog.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\install-watchlog.ps1" -apiKey $wl_apiKey -server $wl_server -memory $wl_memory
$wl_apiKey="your-api-key"; $wl_server="your-server"; $wl_memory="300M"; iwr https://watchlog.io/windows/install-watchlog.ps1 -OutFile "$env:TEMP\install-watchlog.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\install-watchlog.ps1" -apiKey $wl_apiKey -server $wl_server -memory $wl_memory
Copy
Managing the Agent
The Watchlog Agent on Windows is managed as a Windows Service. Use the following PowerShell commands (run as Administrator) to control it:
- Start the agent: Start-Service -Name "WatchlogAgent"Copy
- Restart the agent: Restart-Service -Name "WatchlogAgent"Copy
- Stop the agent: Stop-Service -Name "WatchlogAgent"Copy
- Uninstall the agent: Stop-Service -Name "WatchlogAgent"sc.exe delete "WatchlogAgent"Remove the agent folder:Remove-Item -Recurse -Force "C:\Program Files\watchlog-agent"
Note: The WatchlogAgent service will only run while it is started. Adjust the service’s recovery options in Windows Services Management Console if you need automatic restart on failure.
After installing the agent on the server. You must connect to it in code. You can do this through the following packages :
Nodejs
Python
Php
C#
Java
INSTALLATION
$ npm install watchlog-metric
Usage