Package ZenReports :: Module ReportRunner
[hide private]
[frames] | no frames]

Source Code for Module ZenReports.ReportRunner

 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  import Globals 
16  from Products.ZenUtils.ZCmdBase import ZCmdBase 
17   
18 -class ReportRunner(ZCmdBase):
19
20 - def main(self):
21 plugin = self.args[0] 22 args = {} 23 for a in self.args[1:]: 24 if a.find('=') > -1: 25 key, value = a.split('=', 1) 26 args[key] = value 27 self.log.debug("Running '%s' with %r", plugin, args) 28 result = self.dmd.ReportServer.plugin(plugin, args) 29 import pprint 30 pprint.pprint(result)
31 32 if __name__ == '__main__': 33 rr = ReportRunner() 34 rr.main() 35