GithubHelp home page GithubHelp logo

diegogslomp / django-monitor Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 8.0 24.96 MB

:ping_pong: Ping routers and monitor ports through telnet. Useful for ring topology networks

Home Page: https://hub.docker.com/r/diegogslomp/django-monitor

License: MIT License

Python 88.59% Dockerfile 6.76% Shell 4.65%
web ping telnet telegram docker django monitor telegram-bot

django-monitor's Introduction

Django Monitor

gh-actions license gitHub release (latest by date)

Ping devices and check port status from routers/switches through telnet connection. Telnet tested on Enterasys S8, G3 and A4 switch series.

  1. Run docker image:
docker run -d --restart=unless-stopped \
  -e SECRET_KEY='change_this!o)=4*s#n' \
  -e TIME_ZONE='America/Sao_Paulo' \
  -e DJANGO_ALLOW_ASYNC_UNSAFE=True \
  -v monitor:/usr/src/app \
  -p 8000:8000 \
  --name monitor diegogslomp/django-monitor
  1. Create superuser to access admin dashboard:
docker exec -it monitor python manage.py createsuperuser
  1. Populate DB (optional):
docker exec monitor python manage.py loaddata initial_data
  1. Visit http://localhost:8000

  2. Visit http://localhost:8000/admin to create hosts

  3. To send telegram bot messages, add TELEGRAM_CHAT_ID and TELEGRAM_TOKEN to the docker run command

  4. Clean up:

 docker stop monitor; docker rm monitor; docker volume rm monitor
  1. For PostgreSQL as DB, clone, build and run:
git clone --single-branch --recurse-submodules https://github.com/diegogslomp/django-monitor.git
cd django-monitor
docker compose build --pull
docker compose up -d && docker compose logs -f
docker compose exec -it monitor python manage.py createsuperuser
  1. For local deployment:
git clone --single-branch --recurse-submodules https://github.com/diegogslomp/django-monitor.git
cd django-monitor

# Copy/Edit environment variables file
cp .env.example .env

# Create and activate a virtual environment (optional)
python -m pipenv install
python -m pipenv shell

# Install dependencies
pip install -r requirements
python manage.py createsuperuser
python manage.py makemigrations
python manage.py migrate --no-input
python manage.py collectstatic --no-input

# Populate DB (optional)
python manage.py loaddata initial_data

# Start web app
python manage.py runserver 0.0.0.0:8000

# Start monitord in another terminal
python manage.py monitord

django-monitor's People

Contributors

diegogslomp avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-monitor's Issues

InvalidCacheBackendError at /

When I browse to the http://localhost:8000 is shows the following error
InvalidCacheBackendError at /

Could not find backend 'django_redis.cache.RedisCache': cannot import name 'six' from 'django.utils' (/usr/local/lib/python3.8/site-packages/django/utils/init.py)

Request Method: GET
Request URL: http://10.11.104.19:8000/
Django Version: 3.0
Exception Type: InvalidCacheBackendError
Exception Value:

Could not find backend 'django_redis.cache.RedisCache': cannot import name 'six' from 'django.utils' (/usr/local/lib/python3.8/site-packages/django/utils/init.py)

Exception Location: /usr/local/lib/python3.8/site-packages/django/core/cache/init.py in _create_cache, line 52
Python Executable: /usr/local/bin/python
Python Version: 3.8.0
Python Path:

['/usr/src/app',
'/usr/local/bin',
'/usr/local/lib/python38.zip',
'/usr/local/lib/python3.8',
'/usr/local/lib/python3.8/lib-dynload',
'/usr/local/lib/python3.8/site-packages']

Server time: Tue, 10 Dec 2019 07:57:24 -0300

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.