Skip to main content
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'])
#! /opt/venvs/command_watcher/bin/python

from command_watcher import Watch
watch = Watch(
    config_file='/etc/command-watcher.yml',
    service_name='texlive_update'
)

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

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

watch.final_report(
    status=0,
    performance_data={
        'installed_packages': installed_packages.line_count_stdout,
        'all_packages': all_packages.line_count_stdout,
    },
)
---
email:
    from_addr: logs@example.com
    to_addr: logs@example.com
    to_addr_critical: critical@example.com
    smtp_login: mailer@mail.example.com
    smtp_password: abcd
    smtp_server: mail.example.com:587

icinga:
    api_endpoint_host: localhost
    api_endpoint_port: 5665
    client_private_key: /etc/pretiac/api-client.key.pem
    client_certificate: /etc/pretiac/api-client.cert.pem
    ca_certificate: /etc/pretiac/ca.crt
    new_host_defaults:
        templates: [passive-host]
    new_service_defaults:
        templates: [passive-service]
        attrs:
        check_interval: monthly

beep:
    activated: true

Metadata

Release files for command_watcher 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for command_watcher 0.6.0
File Size Uploaded
command_watcher-0.6.0.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for command_watcher 0.6.0
File Interpreter ABI Platform
command_watcher-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / command_watcher-0.6.0.tar.gz

Download URL command_watcher-0.6.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
82dc563a6fe9d14d8201f4ff998c536e7bdf596f48dee5e79f819cd9afbf4c7b
BLAKE2b-256 checksum
How to use checksums
a25369c0688cddb878c8b9af8f2f473ff1f12062d88b3863a93e928306e7ccb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / command_watcher-0.6.0-py3-none-any.whl

Download URL command_watcher-0.6.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
562945564e1fa2b87d7cc828718d9ac716d869baf2210f58ae524d1f3d41c827
BLAKE2b-256 checksum
How to use checksums
acff0cbd7d810b90fcf283c6ad879539615ed2700c52d27f55df21425062d0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page