Skip to main content

A simple app for sending telegram notification on completion of a long-running command.

Project description

Overwatcher

A simple app for sending telegram notification on completion of a long-running command.

Setting up

Install package:

pip install overwatcher

Setup environment variables (at least two required):

export OVERWATCHER_TOKEN=...
export OVERWATCHER_CHAT=...

The former should contain token of a telegram bot which could be obtained from @BotFather, the latter can be requested from @chatid_echo_bot. Other env variables are not necessary:

export OVERWATCHER_BASE_FILE_PATH=... # base filepath from which to start searching mentioned files (default value is /home)
export OVERWATCHER_N_FILES=... # the number of last files from the log to push (default value is 3)
export OVERWATCHER_N_LINES=... # the number of lines from command output to forward (default value is 20)
export OVERWATCHER_MAX_LINE_LENGTH=... # max number of characters on a single line (default value is 100)

Usage

Example:

python -m overwatcher notify "ls -alh && sleep 10"

Response is sent to a telegram chat:

Command echo nice is completed in 0.003 seconds. Result:
nice

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overwatcher-0.8.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file overwatcher-0.8.tar.gz.

File metadata

  • Download URL: overwatcher-0.8.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

File hashes

Hashes for overwatcher-0.8.tar.gz
Algorithm Hash digest
SHA256 4c0e03fd44ac2ad17a8821c437a916737332d05acda22773a6b224ea7c1e5894
MD5 8d928b6eca66158b09a5d2fd9af16bbf
BLAKE2b-256 a64c4877cdd338819a78fde04d472aa41e560eebff8697ce544fad4e99d7ef5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page