Watchlog Agent Installation

Set up the Watchlog Agent to start monitoring your server metrics effortlessly.

Option 1: Install the Ubuntu Agent

For Ubuntu servers, install the Watchlog Agent with a single command.

  
  sudo apiKey="your-api-key" server='your-server' bash -c "$(curl -L https://watchlog.io/ubuntu/watchlog-script.sh)"
  
        

Replace your-api-key and your-server with the values provided in your dashboard.

Start the Agent

Once installed, start the agent using the following command:

  
  sudo systemctl start watchlog-agent.service
  
        

Option 2: Install from Source Code

For other Linux distributions, such as CentOS, install the Watchlog Agent from source code.

Prerequisites

  • Node.js (version 12 or higher)
  • npm (Node Package Manager)
  • pm2 (Process Manager for Node.js)
  • Git

Installation Steps

  1. Clone the Repository: Run the following command:
      
      git clone https://github.com/watchlogserver/watchlog-agent.git
      
                
  2. Navigate to the Directory:
      
      cd watchlog-agent
      
                
  3. Install Dependencies:
      
      npm install
      
                
  4. Configure the Agent: Update the .env file with your credentials:
      
      WATCHLOG_APIKEY=your-api-key
      WATCHLOG_SERVER=your-server
      
                
    Replace your-api-key and your-server with values from your dashboard.

Start the Agent

Start the Watchlog Agent using PM2 to keep it running in the background:

  
  pm2 start watchlog-agent.js
  
        

The Watchlog Agent will now periodically send metrics to the Watchlog dashboard.

Start Monitoring Today

Sign up for Watchlog to monitor and analyze your servers effortlessly.

View Pricing