Monitoring SSHd and web servers?
nomailplease at sonic.net
Fri Mar 14 19:13:57 CET 2008
Gilles Ganault <nospam at nospam.com> wrote:
>I'd like to monitor connections to a remote SSH and web server. Does
>someone have some code handy that would try to connect every 5mn, and
>print an error if the script can't connect?
This script has been pretty reliable for us for the past few years,
much more reliable than the expect script it replaced.
quiet = open("/dev/null", "rw")
sys.stdin = quiet
sys.stdout = quiet
sys.stderr = quiet
smtp = pexpect.spawn("telnet " + sys.argv + " 25")
More information about the Python-list