All Projects → a-bali → janitor

a-bali / janitor

Licence: GPL-3.0 license
Availability monitoring and alerting for IOT devices

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to janitor

Homeassistant Config
Configuration for @brianjking & @KinnaT's Home Assistant Installation
Stars: ✭ 80 (+45.45%)
Mutual labels:  home-automation, homeautomation, sensors, homeassistant
Awesome Home Assistant
A curated list of amazingly awesome Home Assistant resources.
Stars: ✭ 3,487 (+6240%)
Mutual labels:  home-automation, homeautomation, homeassistant, hassio
Home Assistant Config
🏠 My Home Assistant configuration, a bit different that others :) Be sure to 🌟 this repository for updates!
Stars: ✭ 1,050 (+1809.09%)
Mutual labels:  home-automation, homeautomation, homeassistant
Home Assistantconfig
🏠 Home Assistant configuration & Documentation for my Smart House. Write-ups, videos, part lists, and links throughout. Be sure to ⭐ it. Updated FREQUENTLY!
Stars: ✭ 3,687 (+6603.64%)
Mutual labels:  home-automation, homeautomation, homeassistant
Homeassistant
Example Home Assistant Configs
Stars: ✭ 846 (+1438.18%)
Mutual labels:  home-automation, homeautomation, homeassistant
Homeassistant
Example Home Assistant Configs
Stars: ✭ 168 (+205.45%)
Mutual labels:  home-automation, homeautomation, homeassistant
Streamdeck Homeassistant
🏠 Use the Elgato Stream Deck as Home Assistant controller. Call any available service and toggle lights or resume your music.
Stars: ✭ 69 (+25.45%)
Mutual labels:  home-automation, homeautomation, homeassistant
Home-Assistant-Config
🏠 My huizebruin Home Assistant configuration, Be sure to 🌟 this repository for updates! huizebruin
Stars: ✭ 29 (-47.27%)
Mutual labels:  home-automation, homeassistant, hassio
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (+85.45%)
Mutual labels:  home-automation, homeautomation, homeassistant
haconfigs
My Home-Assistant configuration files
Stars: ✭ 61 (+10.91%)
Mutual labels:  home-automation, homeautomation, homeassistant
esp32-motorized-roller-blinds
Control your motorized blinds with Web interface/ MQTT. Easy integration with automation systems like Home Assistant and OpenHab. 3d printing model for Leroy Merlin blinds.
Stars: ✭ 51 (-7.27%)
Mutual labels:  home-automation, homeassistant
homeassistant-phonetrack
PhoneTrack custom device_tracker component for Home Assistant.
Stars: ✭ 20 (-63.64%)
Mutual labels:  homeassistant, hassio
Home-Assistant-Configuration
🏡 My home assistant configuration!
Stars: ✭ 28 (-49.09%)
Mutual labels:  homeassistant, hassio
snmp notifier
A webhook to relay Prometheus alerts as SNMP traps, because sometimes, you have to deal with legacy
Stars: ✭ 33 (-40%)
Mutual labels:  alert, notification
addon-tailscale
Tailscale - Home Assistant Community Add-ons
Stars: ✭ 47 (-14.55%)
Mutual labels:  homeassistant, hassio
gotify-push
Chrome Extension for Send Push Notification 🔔 to gotify/server ☁
Stars: ✭ 32 (-41.82%)
Mutual labels:  notification, gotify
home-assistant-config
🏠 Home Assistant Configuration & Documentation for my smart home using Node-RED for automations. Press ⭐ for notification of updates.
Stars: ✭ 34 (-38.18%)
Mutual labels:  home-automation, homeassistant
notice.js
💯 Javascript notification library
Stars: ✭ 25 (-54.55%)
Mutual labels:  alert, notification
flex-table-card
Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept
Stars: ✭ 122 (+121.82%)
Mutual labels:  home-automation, homeassistant
plugwise-beta
Custom-component / development version of the Plugwise Home Assistant platform
Stars: ✭ 23 (-58.18%)
Mutual labels:  home-automation, homeassistant

janitor

Objective

Janitor is a standalone tool that monitors the availability of your IOT devices and alerts you in case a device goes missing or stops transmitting data. This is particulary useful if you have many sensors, possibly with unstable hardware or connection, so you can take action in case of any issues and monitor the stability of your devices.

Janitor does not aim to implement any additional functionalities, therefore is not an alternative to your other home automation software (e.g. HASS). Focusing on solely this functionality will enable to keep this tool simple and efficient.

Janitor currently supports the following monitoring methods:

  • MQTT: Janitor will subscribe to predefined MQTT topics and monitor incoming messages. An average transmit frequency will be calculated for each channel and in case no new messages are received within this interval, Janitor will alert you (the threshold can be configured as a multiple of the average frequency or as absolute values per topic). This method is particulary useful for any kind of sensors submitting data regularly via MQTT (e.g. temperature).
  • Ping: Janitor will ping predefined hosts with a predefined frequency (configurable on a per host basis) and will alert you in case of no reply (the threshold used for consecutively missed pings can be configured). This method is useful for any kind of IOT devices e.g. sensors, cameras etc.
  • HTTP: Janitor will send a HTTP GET request to predefined addresses and check for reply, and, optionally, whether the reply contains a predefined string. Janitor will alert you in case of consecutively unsuccessful requests above the configured threshold. The frequency and timeout are also configurable per address. This method is useful for any kind of services with a web interface (e.g. APIs, hosted services etc.).
  • Exec: Janitor will execute a preconfigured command and check for its exit code. Janitor will alert you in case of consecutively unsuccessful executions above the configured threshold. The frequency and timeout are also configurable per command. With this method you can implement any kind of custom monitoring.

Janitor currently supports the following alert methods:

  • Telegram: Janitor will send a message to a predefined Telegram channel.
  • Gotify: Janitor will send a push message to Gotify.
  • MQTT: Janitor will publish a message to a preconfigured topic on a preconfigured MQTT server. The message will contain a JSON payload (see sample config for example). This is suitable for automations e.g. in HASS.
  • Exec: Janitor will execute a preconfigured command. This enables creating any type of custom alerting method.

Additionally, Janitor has a web interface where you can see the current status and historical data, remove items, change timeouts, intervals and thresholds and reload the configuration file (see screenshot below).

Finally, Janitor includes a simple JSON api with the following endpoints:

  • /api/data provides a snapshot of all monitoring related data.
  • /api/stats provides the count of monitoring targets in functional/dysfunctional state.

Screenshot

Screenshot

Building and installing

Janitor is written in Go and will compile to a single standalone binary. Janitor should compile and work both on Linux and on Windows.

For compiling, first install the necessary prerequisites and packr for embedding the HTML template in the binary:

$ go get github.com/eclipse/paho.mqtt.golang
$ go get github.com/go-telegram-bot-api/telegram-bot-api
$ go get gopkg.in/yaml.v2
$ go get github.com/gobuffalo/packr/packr
$ go get github.com/gobuffalo/packr

Then use the following commands to clone the repository and build the binary:

$ git clone https://github.com/a-bali/janitor.git
$ cd janitor
$ packr build

This will create the standalone binary named janitor that you can place anywhere you like.

Configuration and usage

For configuration, a YAML formatted file is required. Please use the sample configuration file and change it according to your needs, following the comments in the file. Most of the variables are optional and have reasonable defaults, for details please see the comments.

A minimal but already operational configuration can be as short as follows (assuming Janitor's web interface will be available on its default port which is 8080):

monitor:
  mqtt:
    server: mymqtt.server
    targets:
    - topic: "/sensors/#"
alert:
  gotify:
    server: "http://mygotify.server:1234"
    token: gotify_token

Once you created a configuration file, Janitor can be launched as follows:

$ janitor path/to/your/configfile.yml

Janitor will log to standard output. The log is viewable on the web interface as well, where you can delete monitored targets and reload the configuration file (e.g. in case you added new targets or changed any of the settings).

Janitor will not daemonize itself. It is recommended to create a systemd service for janitor in case you want it running continuously.

Running with Docker

Docker Hub automatically builds an image from the latest version of Janitor that can be pulled as abali/janitor. To use this, map your configuration file to /janitor/config.yml:

$ docker run -v $(pwd)/config.yml:/janitor/config.yml -p 8080:8080 abali/janitor

Alternatively, you can use the supplied Dockerfile to build a container yourself :

$ git clone https://github.com/a-bali/janitor.git
$ cd janitor
$ docker build . -t janitor
$ docker run -v $(pwd)/config.yml:/janitor/config.yml -p 8080:8080 janitor

Future plans and contributing

Janitor's objective is clear and simple: to monitor the availability and operation of IOT devices and alert in case if any issues. Any future improvements should follow this objective and thus either add new ways of monitoring, or add new ways of alerting.

Janitor is open source software and you are encouraged to send pull requests via Github that improve the software.

License

Janitor is licensed under GPL 3.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].