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.
Source
Ubuntu
Centos
Windows
Macos
Prerequisites
Before you begin, ensure that you have the following prerequisites installed on your server:
Installation
- Clone the Watchlog Agent Repository: Open your terminal and navigate to the directory where you want to install the Watchlog Agent. Run the following command to clone the agent repository from GitHub:git clone https://github.com/watchlogserver/watchlog-agent.gitCopy
- Navigate to the Agent Directory: Change your working directory to the Watchlog Agent folder:cd watchlog-agentCopy
- Install Dependencies: Install the required Node.js dependencies by running the following command:npm installCopy
- Configuration: Open .env file in the agent directory and configure it with your Watchlog API key and Watchlog Server: WATCHLOG_APIKEY=your-api-keyWATCHLOG_SERVER=your-serverReplace your-api-key and your-server with your actual Watchlog API key and Server in Dashboard .
Start the Agent
Once you have completed the installation and configuration, you can start the Watchlog Agent using pm2.
It will run in the background and periodically send server metrics to Watchlog.
pm2 start watchlog-agent.js
Copy
You should now see the Watchlog Agent running as a background process.
Verify the Agent
You can check if the agent is running successfully by using the following command:
pm2 list
Copy
You should see the Watchlog Agent listed with its process information..
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
Java
INSTALLATION
$ npm install watchlog-metric
Usage