Module: check_mk
Branch: master
Commit: 0e5866bf2e7bf0ecf8e8eb09090ff4dbc161ab78
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e5866bf2e7bf0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 1 15:23:52 2011 +0100
validator: added check for perfometer
---
doc/helpers/validate_checks | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/doc/helpers/validate_checks b/doc/helpers/validate_checks
index 2aa0978..e66dd21 100755
--- a/doc/helpers/validate_checks
+++ b/doc/helpers/validate_checks
@@ -68,6 +68,10 @@ def get_checks():
return [ f for f in files if f.endswith(".include") and not f.startswith('.') ] + \
[ f for f in files if not f.endswith(".include") and not f.startswith('.') ]
+def get_perfometer_files():
+ files = os.listdir('web/plugins/perfometer')
+ return [ f for f in files if f.endswith(".py") and not f.startswith('.') ]
+
def check_has_perfdata(check):
return check_info[check][2] == 1
@@ -146,6 +150,11 @@ for check in get_checks():
if name not in ignored_variables and name not in vars_before_check:
global_vars[check] += [ name ]
+# Load all perfometers
+perfometers = {}
+for f in get_perfometer_files():
+ execfile('web/plugins/perfometer/' + f)
+
SCORE_START = 10
C_OK = 1
@@ -159,6 +168,7 @@ TESTS = {
'snmp_scan': C_OK,
'pnp_tmpl': C_OK,
'pnp_rra': C_OK,
+ 'perfometer': C_OK,
'snmp_scan': C_OK,
'reindent': C_OK,
'global_vars': C_OK,
@@ -298,6 +308,15 @@ def is_valid_pnp_rra(check):
def verify_pnp_rra(check):
return os.path.exists('pnp-rraconf/check_mk-%s.rra.cfg' % check)
+# Perfometer:
+# Checks with perfdata should provide a perfometer
+
+def is_valid_perfometer(check):
+ return check_has_perfdata(check)
+
+def verify_perfometer(check):
+ return 'check_mk-' + check in perfometers
+
# #############################################################################
# MAIN
# #############################################################################
Module: check_mk
Branch: master
Commit: cd8d5a5b72b58c71a0a00d9e776e151258f40db3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cd8d5a5b72b58c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 1 15:41:48 2011 +0100
validate: Added -t/--tests param to limit validations to be executed
---
doc/helpers/validate_checks | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/doc/helpers/validate_checks b/doc/helpers/validate_checks
index e48ac3c..798bea3 100755
--- a/doc/helpers/validate_checks
+++ b/doc/helpers/validate_checks
@@ -322,6 +322,7 @@ def verify_perfometer(check):
# #############################################################################
_args = [
+ ('t:', 'tests=', 'Put one or more tests (comma separated) to limit the validations to perform'),
('c:', 'checks=', 'Put one or more checks (comma separated) to limit the checks to validate'),
('l:', 'score-limit=', 'Set an upper score limit. Only checks with a lower score will be shown'),
('v', 'verbose', 'Enable verbose output'),
@@ -331,6 +332,7 @@ _args = [
_verbose = 0
_score_limit = None
_checks = []
+_tests = []
try:
opts, args = getopt.getopt(sys.argv[1:], ''.join([ x[0] for x in _args ]), [ x[1] for x in _args ])
except getopt.error, msg:
@@ -342,6 +344,9 @@ for o, a in opts:
_score_limit = int(a)
elif o in ('-c', '--checks'):
_checks = a.split(',')
+ elif o in ('-t', '--tests'):
+ _tests = a.split(',')
+ TESTS = dict([ (k, v) for k, v in TESTS.iteritems() if k in _tests ])
elif o in ('-h', '--help'):
usage()
else:
Module: check_mk
Branch: master
Commit: c928cb9f354eb16880416440f8866a39cb3844f3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c928cb9f354eb1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 1 14:53:47 2011 +0100
Updated bug entries
---
.bugs/163 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/.bugs/163 b/.bugs/163
new file mode 100644
index 0000000..247510f
--- /dev/null
+++ b/.bugs/163
@@ -0,0 +1,77 @@
+Title: backgrounds in downtime view not shown for host downtimes
+Component: multisite
+Benefit: 2
+State: open
+Cost: 4
+Date: 2011-03-01 14:42:34
+Class: nastiness
+
+The problem is that the host_state is not fetched via livestatus. These code parts were written by sir hack-a-lot ;-).
+This would workaround the problem and bring the color to the host columns . And the host_state and host_has_been_checked columns are fetched from much more views (maybe useless in most cases).
+
+Patch:
+
+diff --git a/web/htdocs/views.py b/web/htdocs/views.py
+index e8c9498..9baddb6 100644
+--- a/web/htdocs/views.py
++++ b/web/htdocs/views.py
+@@ -1049,6 +1049,7 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
+ if (not view["mustsearch"]) or html.var("search"):
+ # names for additional columns (through Stats: headers)
+ add_columns = datasource.get("add_columns", [])
++
+ columns, rows = query_data(datasource, columns, add_columns, query, only_sites, get_limit())
+ sort_data(rows, sorters)
+ else:
+@@ -1356,7 +1357,7 @@ def query_data(datasource, columns, add_columns, add_headers, only_sites = [], l
+ state_columns = []
+ if "service" in datasource["infos"]:
+ state_columns += [ "service_has_been_checked", "service_state" ]
+- elif "host" in datasource["infos"]:
++ if "host" in datasource["infos"]:
+ state_columns += [ "host_has_been_checked", "host_state" ]
+ for c in state_columns:
+ if c not in columns:
+diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
+index 135b1ed..6a870d1 100644
+--- a/web/plugins/views/layouts.py
++++ b/web/plugins/views/layouts.py
+@@ -141,14 +141,17 @@ def render_grouped_boxes(data, view, group_painters, painters, num_columns):
+
+ for row in rows:
+ register_events(row) # needed for playing sounds
++
+ if trclass == "odd":
+ trclass = "even"
+ else:
+ trclass = "odd"
++
+ state = row.get("service_state", None)
+ if state == None:
+ state = row.get("host_state", 0)
+ if state > 0: state +=1 # 1 is critical for hosts
++
+ html.write('<tr class="data %s%d">' % (trclass, state))
+ for p in painters:
+ paint(p, row)
+@@ -368,13 +371,19 @@ def render_grouped_list(data, view, group_painters, painters, num_columns):
+ # or host - if available - to color the complete line
+ if num_columns == 1:
+ # render state, if available through whole tr
+- state = row.get("service_state", 0)
++ if row.get('service_description', '') == '':
++ state = row.get("host_state", 0)
++ if state > 0: state +=1 # 1 is critical for hosts
++ else:
++ state = row.get("service_state", None)
+ else:
+ state = 0
++
+ if trclass == "odd":
+ trclass = "even"
+ else:
+ trclass = "odd"
++
+ html.write('<tr class="data %s%d">' % (trclass, state))
+
+ for p in painters: