Clean : (Grégory Starck) clean of some getattr code, bis.
[shinken.git] / shinken / acknowledge.py
blob7c75654668d2287cdf323926ac2b916ad0e13ea6
1 #!/usr/bin/env python
2 # Copyright (C) 2009-2010 :
3 # Gabes Jean, naparuba@gmail.com
4 # Gerhard Lausser, Gerhard.Lausser@consol.de
6 # This file is part of Shinken.
8 # Shinken is free software: you can redistribute it and/or modify it
9 # under the terms of the GNU Affero General Public License as
10 # published by the Free Software Foundation, either version 3 of the
11 # License, or (at your option) any later version.
13 # Shinken is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Affero General Public License for more details.
18 # You should have received a copy of the GNU Affero General Public
19 # License along with Shinken. If not, see <http://www.gnu.org/licenses/>.
21 """
22 Allows you to acknowledge the current problem for the specified service.
23 By acknowledging the current problem, future notifications (for the same
24 servicestate) are disabled.
25 """
26 class Acknowledge:
27 id = 0
29 # If the "sticky" option is set to one (1), the acknowledgement
30 # will remain until the service returns to an OK state. Otherwise
31 # the acknowledgement will automatically be removed when the
32 # service changes state. In this case Web interfaces set a value
33 # of (2).
35 # If the "notify" option is set to one (1), a notification will be
36 # sent out to contacts indicating that the current service problem
37 # has been acknowledged.
39 # If the "persistent" option is set to one (1), the comment
40 # associated with the acknowledgement will survive across restarts
41 # of the Shinken process. If not, the comment will be deleted the
42 # next time Nagios restarts. "persistent" not only means "survive
43 # restarts", but also
45 def __init__(self, ref, sticky, notify, persistent, author, comment):
46 self.id = self.__class__.id
47 self.__class__.id += 1
48 self.ref = ref # pointer to srv or host we are apply
49 self.sticky = sticky
50 self.notify = notify
51 self.author = author
52 self.comment = comment