Skip to content

A lightweight, encrypted server monitoring agent written in node.JS using Socket.IO.

Notifications You must be signed in to change notification settings

gms298/Encrypted-server-monitoring-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Monitoring Agent

Description

A continuous server monitoring agent that is lightweight and fully encrypted written in node.JS using Socket.IO npm module. End-to-End Encryption is used to protect the data in transit using Asymmetric RSA encryption and SHA256 signatures.

The server agent outputs metrics in JSON format. The agent was built with compatibility in mind. Hence, integration with other suite of applications is pretty straightforward.

The application collects the following metrics:

  • CPU
    • Type
    • Utilization (System/User/Total)
  • Physical Memory
    • Utilization (Total/Free/Used/Active/Available plus Use % and Available %)
  • Disk
    • Usage (in %)
    • Read & Write speed per second
  • Network
    • Current Download speed
    • Current Upload speed
    • Total downloaded and uploaded bytes (from system boot)

The application can be run in two modes, from the client side:

  • FULL: Prints all server information collected in JSON format.
  • COMPACT: Prints only CPU, Memory, Disk and Network Utilizaton in JSON format.

Execution

Server-side (Monitoring agent)

Clone this repository and change directories.

  • Make a new folder named server and then run the commands below in Terminal on Ubuntu/Linux/macOS.

  • Generate the 8192 bit RSA keys using,

    openssl genrsa -out privatekey.pem 8192 to generate the private key

    openssl rsa -in privatekey.pem -pubout -out publickey.pem to generate the public key.

  • Copy the publickey.pem file to the client-side - using the same directory structure i.e., create server folder and paste inside.

  • Change directories again 1 level up where package.json is located. Run npm install to automatically install all dependencies required by this project.

  • Modify the agent.js source code to reflect the actual port number to run this monitoring agent on.

  • The server agent has a predefined whitelist of IP addresses to accept incoming connections. Add the actual client's IP address to this list.

  • Run the agent using forever forever start agent.js

Client-side (Demo - Receiving events from agent)

Clone this repository and change directories.

  • Make a new folder named client and then run the commands below in Terminal on Ubuntu/Linux/macOS.

  • Generate the 8192 bit RSA keys using,

    openssl genrsa -out privatekey.pem 8192 to generate the private key

    openssl rsa -in privatekey.pem -pubout -out publickey.pem to generate the public key.

  • Copy the publickey.pem file to the server-side - using the same directory structure i.e., create client folder and paste inside.

  • Change directories again 1 level up where package.json is located. Run npm install to automatically install all dependencies required by this project.

  • Modify the client.js source code to reflect the actual IP address & port number of the server-agent to connect to.

  • Run the client using nodejs client.js or node client.js (for legacy node.JS)

Releases

No releases published

Packages

No packages published