Skip to content

Hsnmsri/monitor-lin

Repository files navigation

MonitorLin

MonitorLin is a lightweight monitoring tool for Linux systems, designed to track system performance and resource usage efficiently.

Docker Hub Container

You can find the official Docker image for Monitor-Lin on Docker Hub:

🔗 hosseinmansouri/monitor-lin

Pull the Image

To pull the latest version of the image, run:

docker pull hosseinmansouri/monitor-lin:latest

Installation (Docker)

  1. Create directory for app
mkdir /opt/monitor-lin
cd /opt/monitor-lin
  1. Create env file
nano env
  • Paste the above settings with your own data
# Node
NODE_NAME=
CPU_LIMIT=
MEMORY_LIMIT=
DISK_DF_PATH=df_output.txt

# Telegram bot
BOT_NAME=
BOT_TOKEN=
ADMINS=

# Proxy
PROXY_HOST=
PROXY_PORT=
  • If you want to use the proxy from your system, you should set the PROXY_HOST parameter to host.docker.internal.
  • PROXY_PORT is your system local proxy port.
  • Ensure that you proxy is configured to bind to 0.0.0.0 instead of 127.0.0.1
  1. Config df_output.txt file and cron job
wget https://raw.githubusercontent.com/Hsnmsri/monitor-lin/refs/heads/main/df_output.sh
sudo chmod +x df_output.sh
  1. Set cron job for run df_output.sh
sudo crontab -e
  • set "*/30 * * * * /opt/monitor-lin/df_output.sh"
  1. Create docker network
docker network create \
 --subnet=172.30.0.0/16 \
 monitor-lin-net
  1. Create docker-compose and run app
nano docker-compose.yml

and set above config

version: '3.8'

services:
 monitor-lin:
   image: hosseinmansouri/monitor-lin:v1.1.0
   container_name: monitor-lin
   restart: unless-stopped
   volumes:
     - ./env.json:/app/dist/environment/env.json
     - ./df_output:/app/df_output
   extra_hosts:
     - "host.docker.internal:host-gateway"
   networks:
     - monitor-lin-net

networks:
 monitor-lin-net:
   external: true
  1. Run app
docker-compose up -d

Development

Getting Started with Development

  1. Clone the Repository
git clone git@github.com:Hsnmsri/monitor-lin.git
cd monitor-lin
  1. Install Dependencies
    Ensure you have Node.js and npm installed. Then, install the required dependencies:
npm install
  1. Set Up the Environment
    Configure the environment variables:
cp src/environment/environment.example.ts src/environment/environment.ts
nano src/environment/environment.ts
  1. Run the Application
    Start the development server:
npm run start:dev
  1. Run Tests
    Verify the codebase by running tests:
npm run test
  1. Start Contributing
  • Create a new branch for your feature or bug fix:
    git checkout -b feature-name
  • Make your changes and commit them:
    git add .
    git commit -m "Description of changes"
  • Push your branch and create a pull request:
    git push origin feature-name
  1. Follow Coding Standards
    Ensure your code adheres to the project's coding guidelines and is well-documented.

  2. Join Discussions
    Participate in discussions and contribute to the project's roadmap.

About

A lightweight system monitoring tool built with NestJS that tracks CPU, memory, and resource usage with real-time alerts via Telegram.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors