Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

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

Notifications You must be signed in to change notification settings

johannesschaefer/simple-network-monitor

Repository files navigation

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published