Giter VIP home page Giter VIP logo

johannesschaefer / simple-network-monitor Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 4.0 3.86 MB

A Simple Network Monitor for checking and monitor the hosts in your network. Easy and quick setup, modern web UI. Uses monitoring plugins from Nagios. Runs on Docker, Raspberry and any other Java capable computer.

License: MIT License

Shell 0.23% Dockerfile 1.25% Java 38.76% HTML 21.82% TypeScript 36.62% CSS 0.75% JavaScript 0.56%
network-monitoring host-monitoring raspberrypi raspberry-pi docker monitoring-plugins monitoring-server wake-on-lan wol wakeonlan

simple-network-monitor's Introduction

Simple Network Monitor

Build Status GitHub tag

The Simple Network Monitor (SNM) is a small service to monitor other hosts or network devices. It checks cyclic the availability of certain services. The SNM saves all probes in a database and creates charts out of it.

Dashboard on tablets

Dashboard on phones Host details Auto discovery of hosts Results of auto discovery

How to run

In all cases the application will be available under http://localhost:8080/, it is possible to access the application from outside by replacing localhost with your hostname or IP address.

Run the Java file directly

Download the Jar file from the Github release page and run the Jar with with following command.

java -jar snm.jar

Requirements:

Docker

Install docker on your system.

Then just run the following command:

docker run -dit --name simple-network-monitor --network host --restart unless-stopped johannesschafer/simple-network-monitor

Run with an persisted H2 db:

docker run -dit --name simple-network-monitor --network host -e "DB_URL=jdbc:h2:/db/snmdb" --restart unless-stopped johannesschafer/simple-network-monitor

This setup is using the network mode host. No port mapping is needed, it exposes the real network interface directly in the docker container. The reason for this is, that some operations only work correctly when the network interface is not virtual. E.g. the arp or etherwake command.

The network mode host only works correctly on Linux machines. Please use a port mapping on other machines instead, e.g. --publish 8080:8080 instead of --network host.

docker run -dit --name simple-network-monitor --publish 8080:8080 --restart unless-stopped johannesschafer/simple-network-monitor

docker-compose

There are several setups prepared in the docker-compose directory. Just check out the files from there and run one of the following variants.

h2 db in memory docker-compose up -d

h2 db in file docker-compose -f docker-compose.yml -f docker-compose.h2.yml up -d

maria db docker-compose -f docker-compose.yml -f docker-compose.mariadb.yml up -d

mysql docker-compose -f docker-compose.yml -f docker-compose.mysql.yml up -d

postgres docker-compose -f docker-compose.yml -f docker-compose.postgres.yml up -d

Please also check the content of the compose files, there are more options described.

To stop and shutdown a running compose setup just run docker-compose down --remove-orphans. This also removes all container.

Docker on Raspberry Pi

Install docker on your system. A good description can be found here: https://blog.alexellis.io/getting-started-with-docker-on-raspberry-pi/

Then just run the following command:

docker run -dit --name simple-network-monitor --network host --restart unless-stopped johannesschafer/simple-network-monitor-raspi

To persist the database add an -e "DB_URL=jdbc:h2:/db/snmdb" after the run parameter.

On a Raspberry Pi 1 the startup can take several minutes, but it runs.

It is also possible to use the docker-compose files from docker-compose, just add change the image name of the snm service to johannesschafer/simple-network-monitor-raspi.

General Docker hints

To change the public port, just change the first 8080 to the port number you want.

Setting

The following settings can be set externally. By default all settings have useful values for a first test run. For a productive usage these settings should be adjusted.

Name Description Commandline Docker Default
H2 Console Enables the H2 console --spring.h2.console.enabled=... H2_CONSOLE_ENABLED=... false
H2 allow others Expose the H2 console to other clients than localhost --spring.h2.console.settings.web-allow-others=... H2_CONSOLE_WEB_ALLOW_OTHERS=... false
DB URL Database URL --spring.datasource.url=... DB_URL=... jdbc:h2:mem:snmdb
DB Username Database username --spring.datasource.username=... DB_USERNAME=... sa
DB Password Database password --spring.datasource.password=... DB_PASSWORD=... org.h2.Driver
DB Driver Database driver class name --spring.datasource.driver-class-name=... DB_DRIVER=...
hosts file The name of the host file to load on startup --hosts-file=... HOSTS_FILE=... hosts.json
commands file The name of the command file to load on startup --commands-file=... COMMANDS_FILE=... commands.json
setting file The name of the setting file to load on startup --settings-file=... SETTINGS_FILE=... settings.json
Default Network This network will be shown in the auto discovery dialog --defaultNetwork=... DEFAULT_NETWORK=... 192.168.178.0/24
Unsecure Export Set this value to true, to export also the passwords --unsecureExport=... UNSECURE_EXPORT=... false
Hibernate Dialect --spring.jpa.properties.hibernate.dialect=... DB_DIALECT=...

For the file parameters, you can use an export of settings, commands or hosts from the application. The refer such a file set the value like --hosts-file=file:/myHosts.json.

simple-network-monitor's People

Contributors

dependabot[bot] avatar johannesschaefer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

simple-network-monitor's Issues

Wake On Lan is not showing on Host

Hi there,
I'm using your container and I'm trying to set some machines waking up throw Lan. When I edit the command wakeonlan it does not appear with the changes made when I go to Edit Host to perform it or even if I make a new command it will not be listed there. But if I run it on command prompt it will work.
Can you give me some info on that?

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.