oitc/hpmon-pushover

By oitc

Updated 20 days ago

Hompage monitoring tool that sends pushover messages on downtime.

Image
Networking
Developer tools
Monitoring & observability
0

1.4K

oitc/hpmon-pushover repository overview

Quick reference

Maintained by: Michael Oberdorf IT-Consulting

Source code: GitHub

Container image: DockerHub

What is the hpmon_pushover container?

It's a simple tool, developed in python, to validate if a given URL is up and running and sends a message over Pushover service if not.

Prerequisites to run the docker container

  1. You need a Pushover account and you need to create a new application for that (UserKey, ApiKey)
  2. You need to create a configuration file in json format with the webpages to check

Configuration

Container configuration

The container grab the configuration via environment variables.

Environment variable nameDescriptionRequiredDefault value
MONITORING_CONFIGURATION_URLThe URL (can also be a file://) to the configuration in JSON format.MANDATORY
PUSHOVER_USER_KEYThe user key of your pushover accountMANDATORY
PUSHOVER_API_KEYThe application key of your pushover applicationMANDATORY
REPEAT_ON_ERRORBoolean (true or false). If the monitor runs on an error. Repeat the call.OPTIONALfalse
REPEAT_ON_ERROR_COUNTERInteger Repeat n times.OPTIONAL1
REPEAT_ON_ERROR_WAIT_TIME_SECInteger Wait time in seconds between next try.OPTIONAL2
LOGLEVELThe loglevel of the application inside the container, can be one of: debug, info, warning, errorOPTIONAL info
Monitoring configuration

The configuration file (referenced in environment variable MONITORING_CONFIGURATION_URL) is in json format. The inner main json frame is:

{
  "webpages": []
}

Inside the webpages array, you can define objects with the following attributes:

Attribute nameDescriptionRequiredDefault value
monitoring_urlThe http or https URL to monitor.MANDATORY
response_ok_dataA pattern inside the http response body that defines everything is ok.optional
response_warn_dataA pattern inside the http response body that defines that there is a warning.optional
Example
{
  "webpages": [
    {
      "monitoring_url": "http://www.example.com/",
    },
    {
      "monitoring_url": "http://www.example.com/",
      "response_ok_data": "This domain is for use in illustrative examples in documents.",
    },
    {
      "monitoring_url": "http://www.example.com/",
      "response_ok_data": "Status: OK",
      "response_warn_data": "Status: WARNING"
    }
  ]
}

Docker run

docker run --rm \
  -e MONITORING_CONFIGURATION_URL='https://github.com/cybcon/docker.hpmon-pushover/blob/main/example_config.json?raw=true' \
  -e PUSHOVER_USER_KEY='myPushoverUserKey' \
  -e PUSHOVER_API_KEY='myPushoverApiKey' \
  oitc/hpmon-pushover:latest

Docker compose configuration

  monitoring:
    restart: "no"
    image: oitc/hpmon-pushover:latest
    environment:
      MONITORING_CONFIGURATION_URL: https://github.com/cybcon/docker.hpmon-pushover/blob/main/example_config.json?raw=true
      PUSHOVER_USER_KEY: myPushoverUserKey
      PUSHOVER_API_KEY: myPushoverApiKey

Example crontab entry

This is an example crontab entry to trigger the docker container every 5pm to send the updates for tomorrow using docker compose.

* 0,15,30,45 * * * /usr/bin/docker-compose -f docker-compose.yml run --rm monitoring >/dev/null 2>&1

Donate

I would appreciate a small donation to support the further development of my open source projects.

Donate with PayPal

License

Copyright (c) 2021-2026 Michael Oberdorf IT-Consulting

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Tag summary

Content type

Image

Digest

sha256:21c658172

Size

19.4 MB

Last updated

20 days ago

docker pull oitc/hpmon-pushover