2 # Copyright (C) 2009-2010 :
3 # Gabes Jean, naparuba@gmail.com
4 # Gerhard Lausser, Gerhard.Lausser@consol.de
5 # Gregory Starck, g.starck@gmail.com
6 # Hartmut Goebel, h.goebel@goebel-consult.de
8 # This file is part of Shinken.
10 # Shinken is free software: you can redistribute it and/or modify it
11 # under the terms of the GNU Affero General Public License as
12 # published by the Free Software Foundation, either version 3 of the
13 # License, or (at your option) any later version.
15 # Shinken is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # Affero General Public License for more details.
20 # You should have received a copy of the GNU Affero General Public
21 # License along with Shinken. If not, see <http://www.gnu.org/licenses/>.
24 Allows you to acknowledge the current problem for the specified service.
25 By acknowledging the current problem, future notifications (for the same
26 servicestate) are disabled.
31 #Just to list the properties we will send as pickle
32 #so to others daemons, so all but NOT REF
42 # If the "sticky" option is set to one (1), the acknowledgement
43 # will remain until the service returns to an OK state. Otherwise
44 # the acknowledgement will automatically be removed when the
45 # service changes state. In this case Web interfaces set a value
48 # If the "notify" option is set to one (1), a notification will be
49 # sent out to contacts indicating that the current service problem
50 # has been acknowledged.
52 # If the "persistent" option is set to one (1), the comment
53 # associated with the acknowledgement will survive across restarts
54 # of the Shinken process. If not, the comment will be deleted the
55 # next time Nagios restarts. "persistent" not only means "survive
58 def __init__(self
, ref
, sticky
, notify
, persistent
, author
, comment
):
59 self
.id = self
.__class
__.id
60 self
.__class
__.id += 1
61 self
.ref
= ref
# pointer to srv or host we are apply
65 self
.comment
= comment
68 #Call by picle for dataify the ackn
69 #because we DO NOT WANT REF in this pickleisation!
70 def __getstate__(self
):
72 # id is not in *_properties
73 res
= {'id' : self
.id}
74 for prop
in cls
.properties
:
75 if hasattr(self
, prop
):
76 res
[prop
] = getattr(self
, prop
)
80 #Inversed funtion of getstate
81 def __setstate__(self
, state
):
84 for prop
in cls
.properties
:
86 setattr(self
, prop
, state
[prop
])