No description
Find a file
2024-01-29 17:16:46 -06:00
.gitignore Fix gitignore - was also ignoring ./docs/extensions/ 2024-01-29 17:16:46 -06:00
LICENSE Fix the loicense 2024-01-29 11:35:39 -06:00
main.py Initial commit - basics of checker extensions added 2024-01-29 10:45:39 -06:00
readme.md Move checker template to separate repo , fix various errors 2024-01-29 11:39:27 -06:00

Updog

What's updog?

Not much, you?

(it's a simple, extensible uptime monitor)

Warning

Extensions will be executed with no safety checks! Make sure an extension isn't malicious before adding it.

Uptime Checker Extensions

Updog doesn't do any monitoring by itself. Instead, extensions are used to check the status of whatever thing, send alerts, and log stuff. Updog just chains them together.

Some examples extensions:

Folder layout

Extensions need to be put in the ./extensions/checkers folder and the name of the file must match the name of the folder. In the future, alerts and logging folders will be added for those extensions. For now, there is only support for checkers.

Methods

*: indicates a method is required

__init__()*

Arguments:

  • A dict of arguments from checker-args in services.json - For no arguments, an empty dict will be used

Example:

{
    "url": "https://example.net",
    "port": 443
}

Return: None

get_status()*

Arguments: None

Return: An integer indicating status; the codes; what the code means is provided by get_return_codes()

These values can be overriden by providing get_return_codes()

get_return_codes()*

Arguments: None

Return: A dict containing integers and their associated statuses.

Example:

{
    0: "Down",
    50: "Partial outage",
    100: "Up"
}

To-do

  • Add basic functionality
    • Read services.json file:
{
    "site": {
        "name": "A Website",
        "checker": "CheckerTemplate",
        "checker-args": {
            "url": "https://example.net",
            "port": 443
        },
        "rate": 60,
        "alerts": "AlertsTemplate",
        "alerts-args": {
            "url": "https://example.com/webhook-url-or-whatever-goes-here"
        },
        "logging": "LoggingTemplate",
        "logging-args": {
            "format": "irrelevant, LoggingTemplate has no options lol"
        }
    }
}

The args are just passed to the extension as a dict, the extension handles it from there.

  • Add support for logging and alert extensions

All specs are still a work-in-progress, breaking changes are likely!