Tuesday, November 2, 2010

Displaying Even Classes on the command line

I whipped up a little script the other day to check all my events for typos and such.  It can also be easily modified to clear out rules, regex or transforms in event classes.  Just be sure to call commit() if you do modify any data.

Here it is:

#!/usr/bin/env python
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
dmd = ZenScriptBase(connect=True).dmd

def _displayEventRules(evtclass):
    for eclass in evtclass.getSubOrganizers():
        _displayEventRules(eclass)

    for inst in evtclass.instances():
        out = ""
        if inst.rule:
            out += "  [rule]  " + str(inst.rule) +"\n"
        if inst.regex:
            out += "  [regex] " + str(inst.regex) +"\n"
        if inst.transform:
            out += "  [transform] " + str(inst.regex) +"\n"
        if out:
            print str(evtclass.getOrganizerName())
            print out
            print
            
def displayEventClasses():
    for e in dmd.Events.getSubOrganizers():
        _displayEventRules(e)

displayEventClasses()

Wednesday, October 20, 2010

Zenoss

Lately I've been playing around with Zenoss at work. It's a great program to monitor your network and all the devices and servers on it.

It's written in Python, so it's right up my ally. You can expand it with ZenPacks. Little python add-ons that add functionality to the overall program. Later, I'll add more information on what I've learned and share information on making setting up and running Zenoss easier (and more automatic).

Tuesday, January 19, 2010

Google Phone

So I went and got myself an android phone. I saw the new Nexus One and knew the I had to have it. In fact, I'm addind this entry from it right now.