Skip to main content

ssh-wait waits for the service to be available over ssh

Project description

ssh_wait module and ssh-wait command

ssh-wait command

Usage: ssh-wait <options> <host>

ssh-wait will wait for the service to be available
on <host>.

    --verbose
        - print progress messages
    --nowait
        - check once and exit 0 if can connect exit 1 if cannot
    --wait-limit=<limit>
        - exit 2 if service is not avaiable within <limit> seconds.
          defaults to 600.
    --service=<service>
        - check the service <service>. Can be a service
          name or a port number. Default is ssh.

ssh_wait module

ssh_wait module

  • ssh_wait( host, service='ssh', wait=True, wait_limit=600, log_fn=print )

The ssh_wait function waits for host to be available if 'wait` is True. Otherwise it will checks once and returns.

The return code to indicate status of the host:

  • 0 - success the host is accepting ssh connections
  • 1 - failed to connect to host
  • 2 - failed to connect within wait_limit seconds
  • 3 - service is not known

The service argument can be either the name of the service (as listed in /etc/services) or the port number.

By default log_fn is the print function and will be used to log messages. Pass None for log_fn to surpress all 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

ssh-wait-1.0.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

ssh_wait-1.0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file ssh-wait-1.0.2.tar.gz.

File metadata

  • Download URL: ssh-wait-1.0.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ssh-wait-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3fd868def00734accc8f9667b2b2e8398dc9762443c934dc2c34ce7e177d41a9
MD5 9eed8f44ad1ea5bd4581379377c63202
BLAKE2b-256 cd59dddc33e10b28c3de293bd48631fb6b7e065f3beff522851144dcbd365db7

See more details on using hashes here.

File details

Details for the file ssh_wait-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ssh_wait-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ssh_wait-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b7317d148d11f33619af161913e995807c0c4aad82ae7dceb2d98c900f4aa560
MD5 1ca6f0747b6c311b8d9eac618444219b
BLAKE2b-256 9c9c954b1f2702ee0b9d6ee1140cfbff8cb5fadb1967f9e269c58e2076dcdb10

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