Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:sebastien/watchdog

  • Loading branch information...
commit e5c78f90758fdb9ef56849cccce8e96964726cf1 2 parents a2e4424 + 21f9164
Sébastien Pierre authored
Showing with 46 additions and 13 deletions.
  1. +0 −8 README
  2. +37 −0 README.rst
  3. +9 −5 Sources/watchdog.py
8 README
View
@@ -1,8 +0,0 @@
-== Watchdog
-== Server monitoring and data-collection daemon
-
-Sorry, no 'setup.py' for now. Just have a look in the 'Examples' and 'Test'
-directories for more info. Just be sure that 'Source/watchdog.py' is in
-your $PYTHONPATH.
-
- -- Sébastien
37 README.rst
View
@@ -0,0 +1,37 @@
+Watchdog - Server monitoring and data-collection Daemon
+=======================================================
+
+We want...
+----------
+* to be notified when incidents happen (email, XMPP, ZeroMQ...)
+* automatic actions to be taken (restart, rm, git pull...)
+* to collect system statistics for further processing e.g. graphs
+* tie into existing/third-party Python code
+* play along nicely with existing deployment/configuration ecosystem
+ (fabric/cuisine)
+
+Overview
+--------
+* monitoring DSL: declarative programming to define monitoring
+ strategy
+* wide spectrum: from data collection and incident reporting to taking
+ automatic actions
+* Small, easy to read, a single file API
+* Revised BSD License
+* written in Python
+
+Use Cases
+---------
+* ensure service availability: test and start/stop when problems
+* collect system statistics/data, log locally and/or remotely
+* alert on system/service health, take actions
+
+Installation
+------------
+Sorry, no 'setup.py' for now. Just have a look in the 'Examples' and 'Test'
+directories for more info. Just be sure that 'Source/watchdog.py' is
+in 'sys.path'.
+
+More?
+-----
+Read the `presentation on Watchdog <http://ur1.ca/45ku5>`_
14 Sources/watchdog.py
View
@@ -851,16 +851,20 @@ def run(self):
class HTTP(Rule):
- def __init__(self, GET=None, POST=None, timeout=Time.s(10), freq=Time.m(1), fail=(), success=()):
+ def __init__(self, GET=None, POST=None, HEAD=None, timeout=Time.s(10), freq=Time.m(1), fail=(), success=()):
Rule.__init__(self, freq, fail, success)
url = None
#method = None
if GET:
+ method = "GET"
url = GET
- #method = "GET"
- if POST:
+ elif POST:
+ method = "GET"
url = POST
- #method = "POST"
+ elif HEAD:
+ method = "HEAD"
+ url = HEAD
+
if url.startswith("http://"):
url = url[7:]
server, uri = url.split("/", 1)
@@ -875,7 +879,7 @@ def __init__(self, GET=None, POST=None, timeout=Time.s(10), freq=Time.m(1), fail
self.uri = uri
self.body = ""
self.headers = None
- self.method = "GET"
+ self.method = method
self.timeout = timeout / 1000.0
def run(self):
Please sign in to comment.
Something went wrong with that request. Please try again.