GithubHelp home page GithubHelp logo

isabella232 / ewn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from larrabee/ewn

0.0 0.0 0.0 24 KB

Whis is wrapper script, what can notify you when your tasks failed.

License: GNU General Public License v3.0

Python 100.00%

ewn's Introduction

Execute With Notify

This is wrapper script, what can notify you when your tasks failed.

Features

  1. Notify with email
  2. Publish logs to Graylog/Logstash
  3. Notify with zabbix
  4. Run commands in background (key --daemon)
  5. Prevent duplicate processes
  6. Retry failed commands

Install

pip install ewn

Configure

You must modify file /etc/ewn.conf

usage

  • Exec command with notify for default recipients ('[email protected]' and '[email protected]'):
    ewn -c 'echo "This is test command" && /bin/false'
  • Exec command with notify for custom recipients ('[email protected]' and '[email protected]'):
    ewn -c 'echo "This is test command" && /bin/false' -r "[email protected]" "[email protected]"
  • Exec command with comment message. It will be attached to email and Graylog message:
    ewn -c 'echo "This is test command" && /bin/false' --comment "This command will always fail"
  • Exec command in background (daemon) mode. It will ignore SIGHUP signal.
    ewn -c 'echo "This is test command" && /bin/false' -d
  • Exec command that prevent duplicate processes:
    ewn -c 'echo "This is test command" && /bin/sleep 3600' --dont-duplicate
  • Exec command with 3 retry on failure and 30 sec interval between retries:
    ewn -c 'echo "This is test command" && /bin/false' --retry 3 --retry-sleep 30
  • Exec command with custom valid exitcodes (default is 0). If command exit with exit code 1, 3 or 255 email will not sent.
    ewn -c 'echo "This is test command" && /bin/false' --valid-exitcodes 1 3 255

You can combine any keys like:
ewn -c 'echo "This is test command" && /bin/false' -d --dont-duplicate -r "[email protected]" "[email protected]" --retry 3 --retry-sleep 30 --valid-exitcodes 1 --comment "This command will never fail because 1 on valid exitcodes"

License

GPL v3

ewn's People

Contributors

larrabee avatar

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.