GithubHelp home page GithubHelp logo

thecatlady / docker-qnap-pushover Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 5.0 509 KB

Pushover notifications for QNAP NAS system events ๐Ÿ””

Home Page: https://hub.docker.com/r/thecatlady/qnap-pushover

License: MIT License

Dockerfile 2.54% Python 97.46%
notifications python docker container pushover qnap notification nas event-notification event-notifications

docker-qnap-pushover's Introduction

Update (February 2, 2022)

Hi folksโ€”I am not running QTS on my QNAP NAS anymore, and thus unfortunately am no longer able to test/maintain this project.

I am archiving this repository, but please feel free to fork and continue improving on it!

qnap-pushover ๐Ÿ””

Image Size Last Commit Build Status
Python Code Quality Become a GitHub Sponsor

Pushover notifications for QNAP NAS system events

Usage

Docker images are available from both GitHub Container Registry (GHCR) and Docker Hub.

If you would prefer to pull from GHCR, simply replace thecatlady/qnap-pushover with ghcr.io/thecatlady/qnap-pushover in the examples below.

Docker Compose (recommended)

Add the following volume and service definitions to a docker-compose.yml file:

volumes:
  qnap-pushover:
services:
  qnap-pushover:
    image: thecatlady/qnap-pushover
    container_name: qnap-pushover
    environment:
      - TZ=America/New_York #optional
      - LOG_LEVEL=WARN #optional
      - NOTIFY_LEVEL=WARN #optional
      - NOTIFY_ONLY= #optional
      - POLL_INTERVAL=10 #optional
      - INCLUDE= #optional
      - EXCLUDE= #optional
      - TESTING_MODE=false #optional
      - PUSHOVER_TOKEN=<Pushover application API token>
      - PUSHOVER_RECIPIENT=<Pushover user and/or group key(s)>
    volumes:
      - qnap-pushover:/data
      - /etc/logs/event.log:/event.log:ro
    restart: always

Then, run the following command from the directory containing your docker-compose.yml file:

docker-compose up -d

Docker CLI

Run the following command to create the required named volume:

docker volume create qnap-pushover

Then, run the following command to create the container:

docker run -d \
  --name=qnap-pushover \
  -e TZ=America/New_York `#optional` \
  -e LOG_LEVEL=WARN `#optional` \
  -e NOTIFY_LEVEL=WARN `#optional` \
  -e NOTIFY_ONLY= `#optional` \
  -e POLL_INTERVAL=10 `#optional` \
  -e INCLUDE= `#optional` \
  -e EXCLUDE= `#optional` \
  -e TESTING_MODE=false `#optional` \
  -e PUSHOVER_TOKEN=<Pushover application API token> \
  -e PUSHOVER_RECIPIENT=<Pushover user and/or group key(s)> \
  -v qnap-pushover:/data \
  -v /etc/logs/event.log:/event.log:ro \
  --restart always \
  thecatlady/qnap-pushover

Updating

The process to update the container when a new image is available is dependent on how you set it up initially.

Docker Compose

Run the following commands from the directory containing your docker-compose.yml file:

docker-compose pull qnap-pushover
docker-compose up -d
docker image prune

Docker CLI

Run the commands below, followed by your original docker run command:

docker stop qnap-pushover
docker rm qnap-pushover
docker pull thecatlady/qnap-pushover
docker image prune

Parameters

The container image is configured using the following parameters passed at runtime:

Parameter Function Default Value Required?
-e TZ= TZ database name of system time zone; e.g., America/New_York Etc/UTC no
-e LOG_LEVEL= Container logging level; DEBUG < INFO < WARNING < ERROR < CRITICAL WARNING no
-e NOTIFY_LEVEL= Minimum system event type to generate a notification; INFO < WARNING < ERROR WARNING no
-e NOTIFY_ONLY= Set of system event types for which to generate a notification (comma-delimited), e.g. INFO,ERROR
(Value is ignored if NOTIFY_LEVEL is also set)
no
-e POLL_INTERVAL= Poll interval in seconds 10 no
-e INCLUDE= List of keywords which must be present in the event description to trigger a notification (comma-delimited) no
-e EXCLUDE= List of keywords which must not be present in the event description to trigger a notification (comma-delimited) no
-e TESTING_MODE= Testing mode (true or false); if set to true, will re-queue the last 10 system log events at every container start and result in duplicate notifications false no
-e PUSHOVER_TOKEN= Pushover application API token; e.g., azGDORePK8gMaC0QOYAMyEEuzJnyUi yes
-e PUSHOVER_RECIPIENT= Pushover user and/or group key(s); e.g., uQiRzpo4DXghDmr9QzzfQu27cmVRsG or gznej3rKEVAvPUxu9vvNnqpmZpokzF (up to 50, comma-delimited) yes
-v qnap-pushover:/data Container data volume yes
-v /etc/logs/event.log:/event.log:ro QNAP event logs (mounted as read-only) yes
--restart Container restart policy (always or unless-stopped recommended) no no

Building Locally

If you would like to make modifications to the code, you can build the Docker image yourself instead of pulling the pre-built image available from GitHub Container Registry (GHCR) and Docker Hub.

git clone https://github.com/TheCatLady/docker-qnap-pushover.git
cd docker-qnap-pushover
docker build --no-cache --pull -t thecatlady/qnap-pushover .

Once the image has been built, follow the directions in the "Usage" section above to start the container.

How to Contribute

Show your support by starring this project! ๐ŸŒŸ Pull requests, bug reports, and feature requests are also welcome!

You can also support me by becoming a GitHub sponsor or making a one-time donation ๐Ÿ’–

docker-qnap-pushover's People

Contributors

dependabot[bot] avatar mtlott avatar thecatlady avatar vincentcox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-qnap-pushover's Issues

Distinct filters for event severity

Hi!
We've already exchanged some ideas on reddit, now I've been using qnap-pushover for a while and I think it could be useful to have a distinct set of included/excluded words for each event level (WARN, INFO, ERROR): in this way I could, for example, receive notifications about all the ERRORS (no filter) while filtering warnings and infos with specific words. Maybe the same thing could be achieved having more containers running and introducing the possibility to set the event severity level to notify (instead of the highest that includes all the lower) and setting each container to listen only to a severity level.

Thanks!

How are you

Many thanks to the author for this script !
I would like to ask, how to run .py directly in the linux shell without deploying docker, and how to parse variables?
I don't need pushover to push, how to use Bark push instead?
Thanks for answering!

Not working....

I have tried installing this on my QNAP NAS (TS453D) but it stops immediately after it starts. I have tried both creating the yaml as instructed, and creating the container from the Docker Hub, but have the same results.

I have created another container on the NAS (CentOS) and that runs without issues.

Am I missing something?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.