[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a
Naparuba
naparuba at gmail.com
Tue Feb 28 22:07:35 UTC 2012
The following commit has been merged in the debian/master branch:
commit 42ad0befd9e59d9fab03edd08ec1ae7bd6a09eb8
Author: Naparuba <naparuba at gmail.com>
Date: Fri Nov 25 21:55:25 2011 +0100
*Fix : clean_previous_run call in the poller/reactionner
*Fix : Pyro exception print with Pyro4
*Fix : discovery launch
*Add : by default, no min worker for poller, so = NB CPU or 4
diff --git a/bin/shinken-discovery b/bin/shinken-discovery
index f901bc6..8b5e047 100755
--- a/bin/shinken-discovery
+++ b/bin/shinken-discovery
@@ -410,7 +410,7 @@ class DiscoveryMerger:
self.conf.remove_templates()
self.conf.pythonize()
self.conf.linkify()
- self.conf.apply_dependancies()
+ self.conf.apply_dependencies()
#self.conf.explode_global_conf()
#self.conf.propagate_timezone_option()
#self.conf.create_business_rules()
diff --git a/etc/brokerd.ini b/etc/brokerd.ini
index bebfc94..6ccc2fd 100644
--- a/etc/brokerd.ini
+++ b/etc/brokerd.ini
@@ -34,4 +34,4 @@ local_log=brokerd.log
# External modules watchdog. If a module got a brok queue() higher
# than this value, it will be killed and restart. Put to 0 to disable it
-max_queue_size=100000
\ No newline at end of file
+max_queue_size=100000
diff --git a/etc/shinken-specific.cfg b/etc/shinken-specific.cfg
index 0967944..33c3405 100644
--- a/etc/shinken-specific.cfg
+++ b/etc/shinken-specific.cfg
@@ -122,6 +122,7 @@ define broker{
modules Livestatus, Simple-log, WebUI
+
# Other interesting modules to add :
# PickleRetentionBroker : save data when quitting
# ToNdodb_Mysql : NDO database support
diff --git a/shinken/clients/livestatus.py b/shinken/clients/livestatus.py
index c99bbbd..5103a83 100644
--- a/shinken/clients/livestatus.py
+++ b/shinken/clients/livestatus.py
@@ -438,5 +438,7 @@ if __name__ == "__main__":
#print "Result", r
cp = LSConnectionPool(['tcp:localhost:50000', 'tcp:localhost:50000'])
- r = cp.launch_raw_query('GET hosts\nColumns name\n')
+ r = cp.launch_raw_query('GET hosts\nColumns name last_check\n')
print "Result", r
+ import time
+ print int(time.time())
diff --git a/shinken/dispatcher.py b/shinken/dispatcher.py
index a5b6a28..fc4bbf6 100644
--- a/shinken/dispatcher.py
+++ b/shinken/dispatcher.py
@@ -361,6 +361,7 @@ class Dispatcher:
#print "Want to give a satellites pack for the scheduler", satellites_for_sched
conf_package = (conf, override_conf, sched.modules, satellites_for_sched)
#print "Try to put the conf", conf_package
+
is_sent = sched.put_conf(conf_package)
if not is_sent:
logger.log('[%s] WARNING : configuration dispatching error for scheduler %s' %(r.get_name(), sched.get_name()))
diff --git a/shinken/modulesmanager.py b/shinken/modulesmanager.py
index c2bf8af..58ac1b3 100644
--- a/shinken/modulesmanager.py
+++ b/shinken/modulesmanager.py
@@ -293,7 +293,7 @@ If instance is external also shutdown it cleanly """
except Exception, exp:
pass
if queue_size > self.max_queue_size:
- logger.log("Error : the external module %s got a too high brok queue size (%s > %s)!" % (inst.get_name()), queue_size, self.max_queue_size)
+ logger.log("Error : the external module %s got a too high brok queue size (%s > %s)!" % (inst.get_name(), queue_size, self.max_queue_size))
logger.log("Setting the module %s to restart" % inst.get_name())
# We clean its queues, they are no more useful
inst.clear_queues(self.manager)
diff --git a/shinken/pollerlink.py b/shinken/pollerlink.py
index 1755f79..1c219ea 100644
--- a/shinken/pollerlink.py
+++ b/shinken/pollerlink.py
@@ -36,7 +36,7 @@ class PollerLink(SatelliteLink):
'poller_name': StringProp(fill_brok=['full_status'], to_send=True),
'port': IntegerProp(default=7771, fill_brok=['full_status']),
'passive' : BoolProp(default='0', fill_brok=['full_status'], to_send=True),
- 'min_workers': IntegerProp(default='1', fill_brok=['full_status'], to_send=True),
+ 'min_workers': IntegerProp(default='0', fill_brok=['full_status'], to_send=True),
'max_workers': IntegerProp(default='30', fill_brok=['full_status'], to_send=True),
'processes_by_worker': IntegerProp(default='256', fill_brok=['full_status'], to_send=True),
'poller_tags': ListProp(default='None', to_send=True),
diff --git a/shinken/satellite.py b/shinken/satellite.py
index f4dec89..644c6a4 100644
--- a/shinken/satellite.py
+++ b/shinken/satellite.py
@@ -62,6 +62,7 @@ except ImportError:
sys.exit("Shinken require the Python Pyro module. Please install it.")
Pyro = pyro.Pyro
+PYRO_VERSION = pyro.PYRO_VERSION
from shinken.message import Message
@@ -338,12 +339,16 @@ class Satellite(BaseSatellite):
except AttributeError , exp: # the scheduler must not be initialized
print exp
except Exception , exp:
- print "Unknown exception", exp
- if PYRO_VERSION < "4.0":
- print ''.join(Pyro.util.getPyroTraceback(exp))
- else:
- print ''.join(Pyro.util.getPyroTraceback())
- sys.exit(0)
+ print "Unknown exception", exp, type(exp)
+ try:
+ if PYRO_VERSION < "4.0":
+ print ''.join(Pyro.util.getPyroTraceback(exp))
+ else:
+ print ''.join(Pyro.util.getPyroTraceback())
+ except:
+ pass
+ raise
+
# We clean ONLY if the send is OK
if send_ok :
@@ -623,8 +628,13 @@ class Satellite(BaseSatellite):
# What the F**k? We do not know what happenned,
# so.. bye bye :)
except Exception , exp:
- print ''.join(Pyro.util.getPyroTraceback(exp))
- sys.exit(0)
+ print "Unknown exception", exp
+ try:
+ print ''.join(Pyro.util.getPyroTraceback(exp))
+ except:
+ pass
+ raise
+
# In android we got a Queue, and a manager list for others
@@ -658,7 +668,7 @@ class Satellite(BaseSatellite):
def clean_previous_run(self):
# Clean all lists
self.schedulers.clear()
- self.broks = self.broks[:]
+ self.broks.clear()
self.external_commands = self.external_commands[:]
@@ -720,14 +730,14 @@ class Satellite(BaseSatellite):
for mod in self.q_by_mod:
for q in self.q_by_mod[mod].values():
total_q += q.qsize()
- if total_q != 0 and wait_ratio < 5*self.polling_interval:
+ if total_q != 0 and wait_ratio < 2*self.polling_interval:
print "I decide to up wait ratio"
self.wait_ratio.update_load(wait_ratio * 2)
#self.wait_ratio.update_load(self.polling_interval)
else:
# Go to self.polling_interval on normal run, if wait_ratio
- # was >5*self.polling_interval,
- # it make it come near 5 because if < 5, go up :)
+ # was >2*self.polling_interval,
+ # it make it come near 2 because if < 2, go up :)
self.wait_ratio.update_load(self.polling_interval)
wait_ratio = self.wait_ratio.get_load()
print "Wait ratio:", wait_ratio
--
UNNAMED PROJECT
More information about the Pkg-nagios-changes
mailing list