Skip to content

Instantly share code, notes, and snippets.

@pandemicsyn
Created July 27, 2010 04:55
Show Gist options
  • Save pandemicsyn/491763 to your computer and use it in GitHub Desktop.
Save pandemicsyn/491763 to your computer and use it in GitHub Desktop.
import Growl
def growlAlert(self, type, eventclass, device):
"""
<type> = "New Alert" or "Clear"
<eventclass> (i.e. /Status/IpService)
<device> (i.e. server1.domain.com)
"""
name = "ZenWatch"
# alert type (either new or a clear)
alertTypes = ["New Alert", "Clear"]
# Register application
zenalert = Growl.GrowlNotifier(name, alertTypes)
zenalert.register()
# Send notification
zenalert.notify(type, eventclass, device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment