Coder Social home page Coder Social logo

telegram-bot-linux-monitoring's Introduction

About

Send linux system reports & security alerts via Telegram.

System reports

This utility can generate and send system summary reports. Run with the --send-report flag.

โณ๐Ÿ–ฅ๏ธ UPTIME: up 2 hours, 42 minutes

๐Ÿ””๐Ÿ“‹ SECURITY UPDATES AVAILABLE: 0

๐Ÿ’ป LAST WEEK LOGINS
User: root
Date: Sat May 9 19:54:49 +0200 2020
--
User: cto
IP: 10.0.2.2
Date: Sat May 9 22:06:17 +0200 2020
--
User: dba
IP: 10.0.2.2
Date: Thu May 7 20:27:06 +0200 2020
--
User: db
Date: Sat May 2 22:55:33 +0200 2020

๐Ÿ’ฝ % DISK USAGE
0% /dev
73% /
1% /tmp
42% /var
30% /boot
11% /home
25% TOTAL

Security alerts

Listens to changes in /var/log/auth.log and detects failed attempts to log in the machine. Run with the --listen-auth-log flag.

โš ๏ธ๐Ÿ“ข May 10 00:16:29 debian sshd[1386]: Invalid user unknown-user from 10.0.2.2 port 10484

Requirements

Python 3 >= version specified in runtime.txt

Usage

Set the following environment variables. You can set these variables creating a .env file; check .env.example.

  • TELEGRAM_BOT_AUTHENTICATION_TOKEN: authentication token of the desired Telegram bot. You don't have one?
  • TELEGRAM_SECURITY_ALERTS_TARGET: target of the security alerts.
  • TELEGRAM_SYSTEM_REPORTS_TARGET: target of the system reports.

Install requirements.txt dependencies and run monitor.py with the desired flag.

usage: monitor.py [-h] [--send-report] [--listen-auth-log]

System monitoring via Telegram

optional arguments:
  -h, --help         show this help message and exit
  --send-report      sends week use summary to TELEGRAM_SYSTEM_MONITORING_TARGET
  --listen-auth-log  listens to authentication errors on /var/log/auth.log and sends reports to TELEGRAM_SECURITY_ALERTS_TARGET

telegram-bot-linux-monitoring's People

Contributors

guillevc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

iqbwl w1xler

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.