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
9 #it under the terms of the GNU Affero General Public License as published by
10 #the Free Software Foundation, either version 3 of the License, or
11 #(at your option) any later version.
13 #Shinken is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 #GNU Affero General Public License for more details.
18 #You should have received a copy of the GNU Affero General Public License
19 #along with Shinken. If not, see <http://www.gnu.org/licenses/>.
22 from shinken
.satellitelink
import SatelliteLink
, SatelliteLinks
23 from shinken
.util
import to_int
, to_bool
, to_split
24 from shinken
.property import UnusedProp
, BoolProp
, IntegerProp
, FloatProp
, CharProp
, StringProp
, ListProp
27 class ReactionnerLink(SatelliteLink
):
29 my_type
= 'reactionner'
30 properties
={'reactionner_name': StringProp(
31 fill_brok
=['full_status'],
33 'address': StringProp(
34 fill_brok
=['full_status']),
37 fill_brok
=['full_status']),
40 fill_brok
=['full_status']),
41 'manage_sub_realms': BoolProp(
43 fill_brok
=['full_status']),
47 'min_workers': IntegerProp(
49 fill_brok
=['full_status'],
51 'max_workers': IntegerProp(
53 fill_brok
=['full_status'],
55 'processes_by_worker': IntegerProp(
57 fill_brok
=['full_status'],
59 'polling_interval': IntegerProp(
61 fill_brok
=['full_status'],
63 'manage_arbiters': IntegerProp(
65 'use_timezone': StringProp(
68 'timeout': IntegerProp(
70 fill_brok
=['full_status']),
71 'data_timeout': IntegerProp(
73 fill_brok
=['full_status']),
74 'max_check_attempts': IntegerProp(
76 fill_brok
=['full_status']),
77 'realm' : StringProp(default
=''),
79 running_properties
= {'con': StringProp(
83 fill_brok
=['full_status']),
86 'attempt': StringProp(
88 fill_brok
=['full_status']), # the number of failed attempt
89 'reachable': StringProp(
91 fill_brok
=['full_status']), # can be network ask or not (dead or check in timeout or error)
92 'configuration_errors' : StringProp(default
=[]),
97 return self
.reactionner_name
100 def register_to_my_realm(self
):
101 self
.realm
.reactionners
.append(self
)
105 class ReactionnerLinks(SatelliteLinks
):#(Items):
106 name_property
= "name"
107 inner_class
= ReactionnerLink