Skip to main content

A Python script to monitor the execution of a rsync task.

Project description

This package on the Python Package Index Tests Documentation Status

rsync-watch.py

A Python script to monitor the execution of a rsync task.

Features

  • The script rsync-watch.py parses the rsync --stats output and sends this statistics to a monitoring system like Nagios or Icinga using the NSCA protocol.

  • The script rsync-watch.py can be configured to perform various checks before starting the rsync process.

usage: rsync-watch.py [-h] [--host-name HOST_NAME]
                      [--dest-user-group USER_GROUP_NAME] [--exclude EXCLUDE]
                      [--rsync-args RSYNC_ARGS]
                      [--action-check-failed {exception,skip}]
                      [--check-file FILE_PATH] [--check-ping DESTINATION]
                      [--check-ssh-login SSH_LOGIN] [-v]
                      [--email-from-addr EMAIL_FROM_ADDR]
                      [--email-to-addr EMAIL_TO_ADDR]
                      [--email-to-addr-critical EMAIL_TO_ADDR_CRITICAL]
                      [--email-smtp-login EMAIL_SMTP_LOGIN]
                      [--email-smtp-password EMAIL_SMTP_PASSWORD]
                      [--email-smtp-server EMAIL_SMTP_SERVER]
                      [--nsca-remote-host NSCA_REMOTE_HOST]
                      [--nsca-password NSCA_PASSWORD]
                      [--nsca-encryption-method NSCA_ENCRYPTION_METHOD]
                      [--nsca-port NSCA_PORT] [--icinga-url ICINGA_URL]
                      [--icinga-user ICINGA_USER]
                      [--icinga-password ICINGA_PASSWORD]
                      [--beep-activated BEEP_ACTIVATED]
                      src dest

A Python script to monitor the execution of a rsync task.

positional arguments:
  src                   The source ([[USER@]HOST:]SRC)
  dest                  The destination ([[USER@]HOST:]DEST)

options:
  -h, --help            show this help message and exit
  --host-name HOST_NAME
                        The hostname to submit over NSCA to the monitoring.
  --dest-user-group USER_GROUP_NAME
                        Both the user name and the group name of the
                        destination will be set to this name.
  --exclude EXCLUDE     See the documention of --exclude in the rsync manual.
  --rsync-args RSYNC_ARGS
                        Rsync CLI arguments. Insert some rsync command line
                        arguments. Wrap all arguments in one string, for
                        example: --rsync-args '--exclude "this folder"'
  -v, --version         show program's version number and exit

checks:
  Perform different checks before running the rsync task.

  --action-check-failed {exception,skip}
                        Select action what to do when a check failed.
  --check-file FILE_PATH
                        Check if a file exists on the local machine.
  --check-ping DESTINATION
                        Check if a remote host is reachable by pinging.
                        DESTINATION can a IP address or a host name or a full
                        qualified host name.
  --check-ssh-login SSH_LOGIN
                        Check if a remote host is reachable over the network
                        by SSHing into it. SSH_LOGIN: “root@192.168.1.1” or
                        “root@example.com” or “example.com”.

email:
  Generated by the config_reader.

  --email-from-addr EMAIL_FROM_ADDR
                        The email address of the sender.
  --email-to-addr EMAIL_TO_ADDR
                        The email address of the recipient.
  --email-to-addr-critical EMAIL_TO_ADDR_CRITICAL
                        The email address of the recipient to send critical
                        messages to.
  --email-smtp-login EMAIL_SMTP_LOGIN
                        The SMTP login name.
  --email-smtp-password EMAIL_SMTP_PASSWORD
                        The SMTP password.
  --email-smtp-server EMAIL_SMTP_SERVER
                        The URL of the SMTP server, for example:
                        `smtp.example.com:587`.

nsca:
  Generated by the config_reader.

  --nsca-remote-host NSCA_REMOTE_HOST
                        The IP address of the NSCA remote host.
  --nsca-password NSCA_PASSWORD
                        The NSCA password.
  --nsca-encryption-method NSCA_ENCRYPTION_METHOD
                        The NSCA encryption method. The supported encryption
                        methods are: 0 1 2 3 4 8 11 14 15 16
  --nsca-port NSCA_PORT
                        The NSCA port.

icinga:
  Generated by the config_reader.

  --icinga-url ICINGA_URL
                        The HTTP URL. /v1/actions/process-check-result is
                        appended.
  --icinga-user ICINGA_USER
                        The user for the HTTP authentification.
  --icinga-password ICINGA_PASSWORD
                        The password for the HTTP authentification.

beep:
  Generated by the config_reader.

  --beep-activated BEEP_ACTIVATED
                        Activate the beep channel to report auditive messages.

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

rsync_watch-0.7.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

rsync_watch-0.7.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file rsync_watch-0.7.0.tar.gz.

File metadata

  • Download URL: rsync_watch-0.7.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b2 CPython/3.10.4 Linux/5.15.0-46-generic

File hashes

Hashes for rsync_watch-0.7.0.tar.gz
Algorithm Hash digest
SHA256 df6f300d31b3933abc4f6208fd8bda3a9115f603056254a6cba1382e83e2c339
MD5 541be5754d59c0bccf865e66423c5c9f
BLAKE2b-256 a0bb258a4de5f0acb6841469d70a94099bad26f17fbc14f2cfa28c2c7cbaaec2

See more details on using hashes here.

File details

Details for the file rsync_watch-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: rsync_watch-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b2 CPython/3.10.4 Linux/5.15.0-46-generic

File hashes

Hashes for rsync_watch-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 780956955d205f9c160ad893f575a86587b128224b29c3b6221113a73aef6684
MD5 a1b5699b0ed64d6385e7ad59e3aee8b3
BLAKE2b-256 2a5cb2ad5cdbcfb0c494405665f1ae7542c1d92c5a2613657c517b28d1c3df2b

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