Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created July 22, 2010 18:00
Show Gist options
  • Save jacobian/486338 to your computer and use it in GitHub Desktop.
Save jacobian/486338 to your computer and use it in GitHub Desktop.
# Poll interval of 2 minutes
set daemon 120
set logfile /var/log/monit.log
set mail-format {
from: [email protected]
subject: [monit] $SERVICE - $EVENT
}
# Global notify list
set alert [email protected] not { instance }
set alert [email protected] { connection content timeout }
# Main PyPI check
check host pypi.python.org with address pypi.python.org
if failed icmp type echo
count 5
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
if failed url http://pypi.python.org/pypi
content == "Python Package Index : PyPI"
timeout 30 seconds
3 cycles
then alert
else if succeeded 2 cycles then alert
# Mirrors.
check host b.pypi.python.org with address b.pypi.python.org
if failed icmp type echo
count 5
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
if failed url http://b.pypi.python.org/
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
check host c.pypi.python.org with address c.pypi.python.org
if failed icmp type echo
count 5
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
if failed url http://c.pypi.python.org/
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
check host d.pypi.python.org with address d.pypi.python.org
if failed icmp type echo
count 5
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
if failed url http://d.pypi.python.org/
timeout 30 seconds
2 cycles
then alert
else if succeeded 2 cycles then alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment