#!/usr/bin/env python import urllib import pynotify from time import sleep, time from simplejson import loads server = 'http://localhost:5984/' pynotify.init('couchmon') n = pynotify.Notification(server) while True: tasks = loads(urllib.urlopen('%s_active_tasks' % server).read()) if tasks: n.props.body = "\n".join(["%s (%s): %s" % (t['type'], t['task'], t['status']) for t in tasks]) n.show() sleep(5)