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:
  • Node.js (version 12 or higher)
  • npm (Node Package Manager)
  • pm2 (Process Manager for Node.js)
  • Git (for cloning the agent from GitHub)
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.git
    Copy
  • Navigate to the Agent Directory: Change your working directory to the Watchlog Agent folder:
    cd watchlog-agent
    Copy
  • Install Dependencies: Install the required Node.js dependencies by running the following command:
    npm install
    Copy
  • Configuration: Open .env file in the agent directory and configure it with your Watchlog API key and Watchlog Server:
    WATCHLOG_APIKEY=your-api-key
    WATCHLOG_SERVER=your-server
    Replace 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