Fix : get back LiveStatus as default.
[shinken.git] / shinken / modules / dummy_scheduler.py
blob6319278ef791eb32fc902b61b755dff97e477d52
1 #!/usr/bin/python
2 #Copyright (C) 2009 Gabes Jean, naparuba@gmail.com
4 #This file is part of Shinken.
6 #Shinken is free software: you can redistribute it and/or modify
7 #it under the terms of the GNU Affero General Public License as published by
8 #the Free Software Foundation, either version 3 of the License, or
9 #(at your option) any later version.
11 #Shinken is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 #GNU Affero General Public License for more details.
16 #You should have received a copy of the GNU Affero General Public License
17 #along with Shinken. If not, see <http://www.gnu.org/licenses/>.
20 #This Class is an example of an Scheduler module
21 #Here for the configuration phase AND running one
24 #This text is print at the import
25 print "Detected module : Dummy module for Scheduler"
28 from shinken.basemodule import BaseModule
31 properties = {
32 'type' : 'dummy_scheduler',
33 'external' : False,
34 'phases' : ['retention'],
38 #called by the plugin manager to get a broker
39 def get_instance(mod_conf):
40 print "Get a Dummy scheduler module for plugin %s" % mod_conf.get_name()
41 instance = Dummy_scheduler(mod_conf, foo="bar")
42 return instance
46 #Just print some stuff
47 class Dummy_scheduler(BaseModule):
49 def __init__(self, mod_conf, foo):
50 BaseModule.__init__(self, mod_conf)
51 self.myfoo = foo
53 #Called by Scheduler to say 'let's prepare yourself guy'
54 def init(self):
55 print "Initilisation of the dummy scheduler module"
56 #self.return_queue = self.properties['from_queue']
59 #Ok, main function that is called in the retention creation pass
60 def update_retention_objects(self, sched, log_mgr):
61 print "[Dummy] asking me to update the retention objects"
64 #Should return if it succeed in the retention load or not
65 def load_retention_objects(self, sched, log_mrg):
66 print "[Dummy] asking me to load the retention objects"
67 return False
69 #From now external is not used in the scheduler job
70 # #When you are in "external" mode, that is the main loop of your process
71 # def main(self):
72 # while True:
73 # print "Raise a external command as example"
74 # e = ExternalCommand('Viva la revolution')
75 # self.return_queue.put(e)
76 # time.sleep(1)