Package Products :: Package ZenEvents :: Module zenackevents |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenEvents.zenackevents

     1  #!/usr/bin/env python
     2  ###########################################################################
     3  #
     4  # This program is part of Zenoss Core, an open source monitoring platform.
     5  # Copyright (C) 2007, Zenoss Inc.
     6  #
     7  # This program is free software; you can redistribute it and/or modify it
     8  # under the terms of the GNU General Public License version 2 as published by
     9  # the Free Software Foundation.
    10  #
    11  # For complete information please visit: http://www.zenoss.com/oss/
    12  #
    13  ###########################################################################
    14  import Globals
    15
    16  from Products.ZenUtils.ZenScriptBase import ZenScriptBase
    17
    18 -class zenackevents(ZenScriptBase):
    19
    20 -    def buildOptions(self):
    21          """basic options setup sub classes can add more options here"""
    22          ZenScriptBase.buildOptions(self)
    23          self.parser.add_option('--userid',
    24                      dest="userid",default="",
    25                      help="name of user who is acking the event")
    26
    27          self.parser.add_option('--evid',
    28                      dest="evids", action="append",
    29                      help="event id that is acked")
    30
    31          self.parser.add_option('--state', type='int',
    32                      dest="state", default=1,
    33                      help="event id that is acked [default: ack]")
    34
    35 -    def ack(self):
    36          self.dmd.ZenEventManager.manage_setEventStates(self.options.state,
    37                                      self.options.evids,self.options.userid)
    38
    39
    40  if __name__ == '__main__':
    41      zae = zenackevents(connect=True)
    42      zae.ack()
    43