This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 8ccda8f67e86cdff4ad1fd1b65e93cc45382a112 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 22 17:31:48 2015 +0200 added timeout on smtp module => without, the thread RunMonitoring may not end --- app/modules/monitoring_modules/http.py | 4 +++- app/modules/monitoring_modules/smtp.py | 3 +-- app/modules/storage_modules/shelve_db.py | 4 ---- app/process_monitoring.py | 5 +++-- views/hostpage.html | 3 +-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/modules/monitoring_modules/http.py b/app/modules/monitoring_modules/http.py index 56d3327..97c5b0a 100644 --- a/app/modules/monitoring_modules/http.py +++ b/app/modules/monitoring_modules/http.py @@ -16,7 +16,9 @@ def check(addr_host, port_list, cnfe): for i in range(len(port_list)): if port_list[i]['portname'] == part: http_port_found = True - res_http_check = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']) + res_http_check = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']), + None, + 10 ).getcode() == 200 if not http_port_found: exception_inst = getattr(cnfe, "CommandNotFoundException")( diff --git a/app/modules/monitoring_modules/smtp.py b/app/modules/monitoring_modules/smtp.py index f21ae0a..d5d37a9 100644 --- a/app/modules/monitoring_modules/smtp.py +++ b/app/modules/monitoring_modules/smtp.py @@ -16,8 +16,7 @@ def check(addr_host, port_list, cnfe): for i in range(len(port_list)): if port_list[i]['portname'] == part: smtp_port_found = True - s = smtplib.SMTP(addr_host, str(port_list[i]['portid'])) - s.quit() + smtplib.SMTP(addr_host, str(port_list[i]['portid']), None, 10) if not smtp_port_found: exception_inst = getattr(cnfe, "CommandNotFoundException")( part, addr_host diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index d32612a..0b3662b 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -6,8 +6,6 @@ import json import shelve import traceback import threading -import socket - import os.path @@ -162,8 +160,6 @@ class shelve_db: (see get_conection_modules_list() on module_loader) :param dict_mod_info: a dictionnary containing informations about the different monitoring modules (see get_info_mod_monitoring() on module_loader) - :param a list of integers representing the known ports for the connection modules, that may not have been - detected by nmap """ self.open_db() addr_host = str(addr_host) # Shelve doesn't support Unicode diff --git a/app/process_monitoring.py b/app/process_monitoring.py index efafd13..f9c7982 100644 --- a/app/process_monitoring.py +++ b/app/process_monitoring.py @@ -130,9 +130,10 @@ class RunMonitoring(threading.Thread): self.wsc = wsc def run(self): - sys.stdout.flush() + #sys.stdout.flush() for dict_mod in self.list_dict_mod: + #sys.stdout.flush() #print "Launching " + str(dict_mod['mod_name']) + " on " + str(dict_mod['addr']) - sys.stdout.flush() + #sys.stdout.flush() self.ml.run_one_monitoring_module(dict_mod['mod_name'], dict_mod['addr']) self.wsc.notify_state_change() \ No newline at end of file diff --git a/views/hostpage.html b/views/hostpage.html index cc79503..24aa4e2 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -116,12 +116,11 @@ <script type="text/ng-template" id="modal_conf_label.html"> <div class="modal-header"> - <h3 class="modal-title">Configure</h3> + <h3 class="modal-title">Configure {{conf_args.mod_name}} for {{conf_args.addr_host}}</h3> </div> <div class="modal-body"> <form> <div class="form-group"> - <h3>{{conf_args.mod_name}}</h3> <label for="freq">Frequency check: each</label> <div class="row" id="freq"> <div class="col-xs-2"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.