Add : service without host will be just droped, like Nagios.
[shinken.git] / shinken / brok.py
blobd8b47bff005a30260623cbc127df174ba9ba50a9
1 #!/usr/bin/env python
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
11 #it under the terms of the GNU Affero General Public License as published by
12 #the Free Software Foundation, either version 3 of the License, or
13 #(at your option) any later version.
15 #Shinken is distributed in the hope that it will be useful,
16 #but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 #GNU Affero General Public License for more details.
20 #You should have received a copy of the GNU Affero General Public License
21 #along with Shinken. If not, see <http://www.gnu.org/licenses/>.
24 #A Brok is a peace of information exported by Shinken to the Broker.
25 #Broker can do whatever
26 #he wants with it.
28 class Brok:
29 __slots__ = ('__dict__', 'id', 'type', 'data')
30 id = 0
31 my_type = 'brok'
32 def __init__(self, type, data):
33 self.type = type
34 self.id = self.__class__.id
35 self.__class__.id += 1
36 self.data = data
39 def __str__(self):
40 return str(self.__dict__)+'\n'