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
26 class BrokerLink(SatelliteLink
):
30 'broker_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']),
44 'manage_arbiters': BoolProp(
46 fill_brok
=['full_status'],
51 'polling_interval': IntegerProp(
53 fill_brok
=['full_status'],
55 'use_timezone': StringProp(
58 'timeout': IntegerProp(
60 fill_brok
=['full_status']),
61 'data_timeout': IntegerProp(
63 fill_brok
=['full_status']),
64 'max_check_attempts': IntegerProp(
66 fill_brok
=['full_status']),
67 'realm' : StringProp(default
=''),
70 running_properties
= {'con': StringProp(
74 fill_brok
=['full_status']),
77 'attempt': StringProp(
79 fill_brok
=['full_status']), # the number of failed attempt
80 'reachable': StringProp(
82 fill_brok
=['full_status']), # can be network ask or not (dead or check in timeout or error)
83 'configuration_errors' : StringProp(default
=[]),
88 return self
.broker_name
91 def register_to_my_realm(self
):
92 self
.realm
.brokers
.append(self
)
97 class BrokerLinks(SatelliteLinks
):
98 name_property
= "name"
99 inner_class
= BrokerLink