Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

zendmd script to list all maint windows

VERSION 1 
Created on: Nov 6, 2009 5:38 PM by michael - Last Modified:  Nov 6, 2009 5:39 PM by michael

# this script prints out all maint windows that will run in the future
# to run zendmd < getMaintWindows.py

# Michael Nugent, michael.nugent@zvents.com

#for epoch -> human time conversion
import time

#note, you must have at least 1 device
device = find('*')
mw = device.maintenanceWindowSearch()
mresult = []
for m in mw:
        ob = m.getObject()
        mresult.append(ob)

for n in mresult:
        if(n.enabled and n.repeat != 'Never'):
                print n.name
                print time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime(n.start))
                print n.duration
                print n.repeat
                print n.breadCrumbs()
                print "------------------------"

Comments (0)

More Like This

  • Retrieving data ...

More by michael