avrilmaomao / lunakeeper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Luna: Simple Monitoring For Invisible Devices And Services

Build Status GitHub Workflow Status Coverage Status Licence

Luna is a simple monitoring system for invisible devices or services, like a RaspberryPi in your home or a scheduled task. It checks whether a monitored item is able to send requests during the required interval.

Luna Working FLow

Luna can be used for

  • checking a RaspberryPi is running with internet connection
  • checking a scheduled task is triggered regularly
  • checking an application not listening ports is up

Supported notification types

When Luna finds a monitored item missing, she will send you a notification. You can specify your notification info when adding or changing a monitored item.

  • Email
  • Slack

Requirements

  • the monitored item can send HTTP GET requests at a regular interval
  • the monitored item can reach the Luna server
  • the Luna server has Internet access

Develop and Deploy

Luna is developed using Django, the development and deployment process is just like normal Django apps. However,there are a few things that need to be taken special care of.

1.Settings for different environments

  • Luna uses production settings if an environment variable DJANGO_PRODUCTION is set , otherwise she uses development settings.
  • add luna/settings_prod.py file to add or override settings for production (Required). An example of settings_prod.py(settings_prod.py.example) is included for ease of use.
  • add luna/settings_dev.py file to add or override settings for development (Optional).

2.The Commands for checking monitored items

Luna uses a Django management command checkpony to check monitored items and send notifications. In production, you need to run this command every 5 minutes(using crontab under unix like system or Task Scheduler under Windows).

A Linux crontab example: */5 * * * * DJANGO_PRODUCTION=1 python management.py checkpony

(don't forget to set environment variable DJANGO_PRODUCTION ,if you are using it in production deployment. )

3. If you are not familiar with Django, you can follow this step-to-step guide to set up Luna in production(though basic Linux and database skills needed).

How to use

After deployment, navigate to Luna's index page in your browser. The index page will show the necessary steps and detailed api info for you to start monitoring.

Why Luna is the name

If you are a fan of My Little Pony, you must have been familiar with Princess Luna. In Equestria, Princess Luna manages the Moon and the night, she protects little ponies from nightmares.She will find ponies who are in a nightmare, go into that dream and help the pony get out of it.

About

License:MIT License


Languages

Language:Python 82.8%Language:HTML 17.2%