MonitorLin is a lightweight monitoring tool for Linux systems, designed to track system performance and resource usage efficiently.
You can find the official Docker image for Monitor-Lin on Docker Hub:
To pull the latest version of the image, run:
docker pull hosseinmansouri/monitor-lin:latest- Create directory for app
mkdir /opt/monitor-lin
cd /opt/monitor-lin- 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
- 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- Set cron job for run df_output.sh
sudo crontab -e- set "*/30 * * * * /opt/monitor-lin/df_output.sh"
- Create docker network
docker network create \
--subnet=172.30.0.0/16 \
monitor-lin-net- Create docker-compose and run app
nano docker-compose.ymland 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- Run app
docker-compose up -d- Clone the Repository
git clone git@github.com:Hsnmsri/monitor-lin.git
cd monitor-lin- Install Dependencies
Ensure you have Node.js and npm installed. Then, install the required dependencies:
npm install- Set Up the Environment
Configure the environment variables:
cp src/environment/environment.example.ts src/environment/environment.ts
nano src/environment/environment.ts- Run the Application
Start the development server:
npm run start:dev- Run Tests
Verify the codebase by running tests:
npm run test- 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
-
Follow Coding Standards
Ensure your code adheres to the project's coding guidelines and is well-documented. -
Join Discussions
Participate in discussions and contribute to the project's roadmap.