GithubHelp home page GithubHelp logo

josef-friedrich / command-watcher Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 247 KB

Module to watch the execution of shell scripts. Both streams (stdout and stderr) are captured.

Home Page: https://pypi.org/project/command-watcher/

License: MIT License

Python 98.69% Shell 0.24% Makefile 1.07%

command-watcher's Introduction

This package on the Python Package Index Tests

command_watcher

Module to watch the execution of shell scripts. Both streams (stdout and stderr) are captured.

watch = Watch()
watch.log.critical('msg')
watch.log.error('msg')
watch.log.warning('msg')
watch.log.info('msg')
watch.log.debug('msg')
watch.run(['rsync', '-av', '/home', '/backup'])
from command_watcher import Watch
watch = Watch(
    config_file='/etc/command-watcher.ini',
    service_name='texlive_update'
)

tlmgr = '/usr/local/texlive/bin/x86_64-linux/tlmgr'

watch.run('{} update --self'.format(tlmgr))
watch.run('{} update --all'.format(tlmgr))
installed_packages = watch.run(
    '{} info --only-installed'.format(tlmgr), log=False
)
all_packages = watch.run('{} info'.format(tlmgr), log=False)

watch.final_report(
    status=0,
    performance_data={
        'installed_packages': installed_packages.line_count_stdout,
        'all_packages': all_packages.line_count_stdout,
    },
)
[email]
subject_prefix = [cwatcher]
from_addr =
to_addr = [email protected]
to_addr_critical = [email protected]
smtp_login = mailer
smtp_password = 1234
smtp_server = mail.example.com:587

[nsca]
remote_host = 1.2.3.4
password = asdf1234
encryption_method = 8
; port = 5667

[icinga]
url = https://icinga.example.com:5665
user = user
password = 1234

[beep]
activated = True

command-watcher's People

Contributors

josef-friedrich avatar

Watchers

 avatar  avatar  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.