0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-01-30 03:33:59 +00:00
alerta_alerta/contrib/experimental/alert-ucs.py
2013-04-10 11:55:13 +01:00

28 lines
489 B
Python

import UcsSdk
import time
def EventHandler(mce):
print 'Received a New Event with ClassId: ' + str(mce.mo.classId)
print "ChangeList: ", mce.changeList
print "EventId: ", mce.eventId
def main():
ucs = UcsSdk.UcsHandle()
ucs.UcsHandle.Login(username='', password='')
ucs.UcsHandle.AddEventHandler(classId='', callBack=EventHandler)
while True:
print '.',
time.sleep(5)
ucs.UcsHandle.Logout()
if __name__ == '__main__':
main()