Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2007, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 as published by 8 # the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 from Products.ZenUtils import Time 1416 zem = dmd.ZenEventManager 17 startDate = args.get('startDate', zem.defaultAvailabilityStart()) 18 endDate = args.get('endDate', zem.defaultAvailabilityEnd()) 19 startDate, endDate = map(Time.ParseUSDate, (startDate, endDate)) 20 startDate = min(startDate, endDate - 1) 21 how = args.get('how', 'AVERAGE') 22 return dict(start=startDate, end=endDate, function=how)2325 swapper = { 'MAXIMUM':'MINIMUM', 'MINIMUM':'MAXIMUM'} 26 summary = summary.copy() 27 current = summary['function'] 28 summary['function'] = swapper.get(current, current) 29 return summary30 3133 import re 34 deviceClass = args.get('deviceClass', '/') or '/' 35 deviceFilter = args.get('deviceFilter', '') or '' 36 deviceMatch = re.compile('.*%s.*' % deviceFilter) 37 38 for d in dmd.Devices.getOrganizer(deviceClass).getSubDevices(): 39 if not d.monitorDevice(): continue 40 if not deviceMatch.match(d.id): continue 41 yield d42
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu May 7 11:46:28 2009 | http://epydoc.sourceforge.net |