Package ZenHub :: Module xmlClient
[hide private]
[frames] | no frames]

Source Code for Module ZenHub.xmlClient

 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   
14   
15  from xmlrpclib import ServerProxy 
16  from socket import getfqdn 
17   
18  from zenhub import XML_RPC_PORT 
19   
20 -def main():
21 proxy = ServerProxy('http://admin:zenoss@localhost:%d' % XML_RPC_PORT) 22 proxy.sendEvent(dict(summary='This is an event', 23 device=getfqdn(), 24 Class='/Status/Ping', 25 component='test', 26 severity=5)) 27 print proxy.getDevicePingIssues()
28 29 if __name__ == '__main__': 30 main() 31