• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Python
  • Created almost 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python script to generate html report of device online/offline status

device-monitor-dashboard

Docker Automated build

Python script to generate html report of devices' online/offline status. A cheap/fun reporting solution. This can be used for for servers, networking equipment, IOT devices, anything that's "pingable". Supports:

  • Linux
  • Windows
  • Raspberry Pi

Live Demo:

100% Devices Up / Failing Devices

Changelog


  • (5/16/2020) Update to python 3
  • (9/9/2018) Replace txt file format with json
  • (1/30/2018) Replace trunicates with jinja templating engine
  • (1/27/2018) Added python 3 compatibility
  • (10/27/2017) Updated UI, noty.js
  • (9/25/2017) Add support for custom names
  • (6/3/2017) Now providing a docker image instead of building your own
  • (5/27/2017) - Please see https://github.com/shaggyloris/Device-Monitor-Dashboard for extended functionality.
    • Integrated SQLite DB, all controlled via web UI, API functionality to return JSON.
  • (5/6/17) Added validation of OS for script to run
  • (2/26/17) Update Easy Install to automatically install packages
  • (2/25/17) Added support for vertically scrolling table, adjusts circle size if on mobile device.
  • (2/24/17) Combined ping function to single file, added ability to check other ports. Also converted script to be more in line with python norms. Table rows now act as hyperlinks to address listed and will auto detect port if specified.
  • (2/20/17) Updated noty,jquery, notifications UI, mobile UI
  • (2/18/17) Added support to build custom docker container
  • (2/4/17) Easy Install script now supports Node.js, update wheel color
  • (2/3/17) Change status from online/offline text to colored orb indicators

Easy Install


bash -c "$(curl -sL https://raw.githubusercontent.com/circa10a/Device-Monitor-Dashboard/master/install.sh)"
  • Ubuntu, Nginx, Python 3 required for Easy Install
  • Follow the prompts!

Usage


  • Have a JSON file(array of objects) with hostnames, port, alias
    • Example JSON file
[
   {
       "url": "www.github.com",
       "port": 443,
       "alias": "GitHub"
   },
   {
       "url": "www.reddit.com",
       "port": 443,
       "alias": "Reddit"
   },
   {
       "url": "www.google.com",
       "port": 80,
       "alias": "Google"
   },
   {
       "url": "www.apple.com",
       "port": 80,
       "alias": null
   }
]
  • Update the python script (variable at the top) with the path/name of your file with hostnames and output file path.(default hostnames= ./hostnames.json default output= ./index.html`)
  • Run python3 report.py
  • Ensure that you place the output HTML file in the project directory so it can find its web dependencies
    • Page automcatically reloads every 60 seconds.

Docker!


docker run -d -p 80:80 -v ~/path/to/your/hostnames.json:/usr/share/nginx/html/hostnames.json --name monitor circa10a/device-monitor-dashboard

Note: Wait 5 min for cron job to execute and render an index.html

Build your own docker image:

git clone https://github.com/circa10a/Device-Monitor-Dashboard.git
cd Device-Monitor-Dashboard
  • Edit your hostnames.json file add your website, servers, switches, devices, etc.
docker build -t myrepo/monitor
docker run --name device-monitor -d -p 80:80 myrepo/monitor
- Known issue: Docker for Mac pings any address and returns success giving false results.

Automation


  • Setup a web server
  • Install a new cron job to run the report periodically cd $path/to/project_directory/ && python report.py &> /dev/null
  • Set output path in python script to write out html report to web serving directory such as /var/www/html
  • The page will automatically refresh every 60 seconds to reflect the new report generated by cron

Screenshots


alt text alt text

More Repositories

1

easy-soap-request

Small Node.js library to make SOAP requests easier
JavaScript
160
star
2

express-jwt

An example API for creating/verifying json web tokens
JavaScript
106
star
3

blockerized-dockchain

Because all problems are solvable with containers and blockchains
Python
86
star
4

k8s-label-rules-webhook

A validating admission webhook to ensure compliant labels in your k8s cluster
Go
53
star
5

terraform-provider-mcbroken

Base the count of your infrastucture resources on the current number of broken mcdonald's ice cream machines nationally or by a city of your choosing. Powered by https://mcbroken.com/
Go
30
star
6

go-geofence

A small library to detect if an IP address is close to yours or another of your choosing using https://ipbase.com
Go
18
star
7

pumpkin-pi

Raspberry pi project that controls jack-o-lantern via servo motor and PIR motion sensors
Go
18
star
8

go-aws-news

Go app + library to fetch what's new from AWS
Go
17
star
9

caddy-geofence

A caddy module for IP geofencing your caddy web server using ipbase.com
Go
15
star
10

terraform-provider-mailform

A terraform provider to send physical mail via https://mailform.io
Go
14
star
11

web-link-tester

Flask App to scrape hrefs from websites and validate links
HTML
12
star
12

cv-notifier

Easily detect objects using computer vision and call configurable webhooks
Python
10
star
13

vault-plugin-secrets-jenkins

A plugin for Hashicorp Vault to create ephemeral users and API tokens for Jenkins CI
Go
8
star
14

local-puppet-dev

Docker setup for testing puppet manifests
Puppet
8
star
15

ava

A discord implementation of the famous ava bot
JavaScript
6
star
16

react-foaas-card

The most offensive of react components
JavaScript
6
star
17

go-mailform

A small library to send physical mail from your Go applications using https://mailform.io
Go
5
star
18

filter-object-array

Small Node.js library to filter an array of objects with an object
JavaScript
4
star
19

mcbroken-dashboard

Entry for digitalocean app platform hackathon
Go
4
star
20

google-home-aws-news

A webhook for google assistance integrations to provide the latest AWS news
Go
4
star
21

terraform-local-minio

Automatically install and create local buckets with public policies for testing
HCL
4
star
22

github-pr-exporter

A prometheus exporter for monitoring pull requests for specified users in the last X number of days.
Go
3
star
23

packer-aws-tomcat-template

A packer template to build AMI's with apache tomcat installed and systemd enabled. Based on Amazon linux.
HCL
3
star
24

witchonstephendrive.com

A home automation project to control my Halloween decorations
Go
2
star
25

href-scraper

ruby CLI to scrape hrefs from single webpages
Ruby
1
star
26

prometheus

Deployment of my personal prometheus instance
HCL
1
star
27

circa10a.github.io

Hosting of Portfolio
JavaScript
1
star
28

circa10a

My profile readme
1
star
29

l33tcrypto

Cryptography for the most l33t haxx0rs
Java
1
star