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 #! /usr/bin/env python 14 15 from PerformanceConfig import PerformanceConfig 16 from ZODB.POSException import POSError 17197821 "Get the known process status from the Event Manager" 22 from Products.ZenEvents.ZenEventClasses import Status_OSProcess 23 down = {} 24 conn = self.zem.connect() 25 try: 26 curs = conn.cursor() 27 query = ("SELECT device, component, count" 28 " FROM status" 29 " WHERE eventClass = '%s'" % Status_OSProcess) 30 if device: 31 query += " AND device = '%s'" % device 32 curs.execute(query) 33 for device, component, count in curs.fetchall(): 34 down[device] = (component, count) 35 finally: 36 self.zem.close(conn) 37 result = [] 38 for dev in self.config.devices(): 39 try: 40 component, count = down[dev.id] 41 result.append( (dev.id, component, count) ) 42 except KeyError: 43 pass 44 return result45 4648 'Get the OS Process configuration for all devices.' 49 result = [] 50 for dev in self.config.devices(): 51 if devices and dev.id not in devices: 52 continue 53 dev = dev.primaryAq() 54 try: 55 procinfo = dev.getOSProcessConf() 56 if procinfo: 57 result.append(procinfo) 58 except POSError: raise 59 except: 60 self.log.exception("device %s", dev.id) 61 return result62 63 66 67 70 71 74 7577 return listener.callRemote('updateDevice', config)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu Oct 25 16:28:21 2007 | http://epydoc.sourceforge.net |