Module: check_mk
Branch: master
Commit: ffd664f68acc28fba26879cb73f56d4a2e2dc8c8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ffd664f68acc28…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 8 14:44:03 2014 +0200
#0202 cisco_temp_sensor: It is now possible to configure this check in WATO.
If you want to configure existing services ( created by this check), please do a reinventory first.
Otherwhise no action is required.
---
.werks/202 | 11 +++++++++
ChangeLog | 1 +
checkman/cisco_temp_sensor | 2 +-
checks/cisco_temp_sensor | 55 +++++++++++++++++++++++++-------------------
4 files changed, 44 insertions(+), 25 deletions(-)
diff --git a/.werks/202 b/.werks/202
new file mode 100644
index 0000000..f7511ab
--- /dev/null
+++ b/.werks/202
@@ -0,0 +1,11 @@
+Title: cisco_temp_sensor: It is now possible to configure this check in WATO.
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407501717
+Class: feature
+
+If you want to configure existing services ( created by this check), please do a reinventory first.
+Otherwhise no action is required.
+
diff --git a/ChangeLog b/ChangeLog
index d54ee8e..b373406 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
* 0197 check_uniserv: New Check for Uniserv Data Management Services...
* 0199 veeam_client: Check rewritten to get a nicer output
* 0200 arris_cmts_cpu,arris_cmts_temp: New Checks for Arris CMTS Devices ( Temperature and CPU Utilization)
+ * 0202 cisco_temp_sensor: It is now possible to configure this check in WATO....
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checkman/cisco_temp_sensor b/checkman/cisco_temp_sensor
index 40fa03d..34dcaab 100644
--- a/checkman/cisco_temp_sensor
+++ b/checkman/cisco_temp_sensor
@@ -10,7 +10,7 @@ description:
sensors MIB and vendor specific information.
Upper warning and critical levels are retrieved from the device
- via SNMP and thus need not to be configured.
+ via SNMP or can be set in WATO.
item:
The name of the sensors as found in the OID tree below.
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index 4a0affa..f41cdaf 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -127,43 +127,50 @@ def parse_cisco_temp_sensor(info):
# Create main dictionary (only of temperature sensors)
sensors = []
for id, sensortype, value, sensorstate in state_info:
+ # poor try to find temperature values
+ # who are given in tens of degress.
+ # Seems that some new firmware show this behavier.
+ # A normal Temperature Sensor has only a range up to
+ # 60 degree, so i choiced 70.
+ value = saveint(value)
+ if value > 70:
+ value = value / 10
sensors.append( ( id, descriptions.get(id), sensortype,
- saveint(value), sensorstate, thresholds[id] ) )
+ value, sensorstate, thresholds[id] ) )
return sensors
-
def inventory_cisco_temp_sensor(info):
sensors = parse_cisco_temp_sensor(info)
- # Use all temperature sensors with a non-empty description and valid threshold
- return [ (entry[1], None) for entry
- in sensors if entry[1] != None
- and entry[2] == '8'
- and ( len(entry[5]) == 2 or len(entry[5]) == 4 ) ]
+ for id, descr, sensortype, value, sensorstate, levels in sensors:
+ # Use all temperature sensors with a non-empty description and valid threshold
+ if descr != None and sensortype == '8' and len(levels) in [ 2, 4 ]:
+ yield descr, levels[0:2]
-def check_cisco_temp_sensor(item, _no_params, info):
+def check_cisco_temp_sensor(item, params, info):
sensors = parse_cisco_temp_sensor(info)
- for id, descr, sensortype, value, sensorstate, levels in sensors:
+ for id, descr, sensortype, temp, sensorstate, levels in sensors:
if item == descr:
- warn, crit = levels[0:2]
- # poor try to find temperature values
- # who are given in tens of degress.
- # Seems that some new firmware show this behavier.
- # A normal Temperature Sensor has only a range up to
- # 60 degree, so i choiced 70.
- if value > 70:
- value = value / 10
+ # Use build in levels if no lavels are configured
+ if params:
+ warn, crit = params
+ else:
+ warn, crit = levels[0:2]
+
+ infotext = "Temperature is: %.1f °C " % temp
+ levels = " (warn/crit at %.1f/%.1f °C)" % (warn, crit)
+ perfdata = [ ( "temperature", temp, warn, crit ) ]
+ state = 0
if sensorstate == "2":
return (3, "data from sensor currently not available")
elif sensorstate == "3":
return (3, "sensor is broken")
- if value >= crit:
+ if temp >= crit:
state = 2
- elif value >= warn:
+ infotext += levels
+ elif temp >= warn:
state = 1
- else:
- state = 0
- return (state, "%.1fC (levels at %.1f/%.1f)" % (value, warn, crit), [
- ( "temperature", value, warn, crit ) ])
+ infotext += levels
+ return state, infotext, perfdata
return (3, "sensor not found in SNMP data")
@@ -171,6 +178,7 @@ check_info['cisco_temp_sensor'] = {
"check_function" : check_cisco_temp_sensor,
"inventory_function" : inventory_cisco_temp_sensor,
"service_description": "Temperature %s",
+ "group" : "hw_temperature",
"has_perfdata" : True,
"snmp_scan_function" : lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower() and \
oid(".1.3.6.1.4.1.9.9.91.1.1.1.1.*") != None,
@@ -194,6 +202,5 @@ check_info['cisco_temp_sensor'] = {
4, # Thresholds
]),
],
- "group" : "temperature_auto"
}
Module: check_mk
Branch: master
Commit: 3dbd6f3baa4f5af53d87afe6ed329b02f6e6965e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3dbd6f3baa4f5a…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 8 13:42:06 2014 +0200
#0201 FIX Fixed error message in Rulelist of RBN
There was an error with an incomple rule entrie who leads to an exception the
WATO Notification configuration.
---
.werks/201 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 4 ++++
3 files changed, 16 insertions(+)
diff --git a/.werks/201 b/.werks/201
new file mode 100644
index 0000000..21b6467
--- /dev/null
+++ b/.werks/201
@@ -0,0 +1,11 @@
+Title: Fixed error message in Rulelist of RBN
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i6
+Date: 1407497923
+
+There was an error with an incomple rule entrie who leads to an exception the
+WATO Notification configuration.
diff --git a/ChangeLog b/ChangeLog
index 3920be5..d54ee8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* 1092 FIX: logwatch: now able to enter unicode text into the "Pattern (Regex)" field
* 0191 FIX: Added swp files to the ignore list for the WATO git feature...
* 1153 FIX: Changed custom user attributes can now be used immediately...
+ * 0201 FIX: Fixed error message in Rulelist of RBN...
1.2.5i5:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index e5d086c..8cc4126 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8565,6 +8565,10 @@ def render_notification_rules(rules, userid="", show_title=False, show_buttons=T
html.empty_icon_button()
notify_method = rule["notify_plugin"]
+ # catch rules with empty notify_plugin key
+ # TODO Mayby this should be avoided somewhere else ( e.g. rule editor)
+ if not notify_method:
+ notify_method = ( None, [] )
notify_plugin = notify_method[0]
table.cell(_("Type"), css="narrow")
Module: check_mk
Branch: master
Commit: 7c87e4fa5cb2b47cdfd93484dcc3d5464025eb38
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7c87e4fa5cb2b4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Aug 8 11:56:45 2014 +0200
#1154 FIX Availability: Fixed unwanted redirect to edit annotation page after editing availability options
When editing an availability timeline, a user could add an annotation to a period, and after that edit the
availability options. Now the user was redirected back to the annotation edit page, which was a bug. This
has been fixed now.
---
.werks/1154 | 11 +++++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 8 +++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1154 b/.werks/1154
new file mode 100644
index 0000000..56cd872
--- /dev/null
+++ b/.werks/1154
@@ -0,0 +1,11 @@
+Title: Availability: Fixed unwanted redirect to edit annotation page after editing availability options
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407491710
+Class: fix
+
+When editing an availability timeline, a user could add an annotation to a period, and after that edit the
+availability options. Now the user was redirected back to the annotation edit page, which was a bug. This
+has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index ba04921..18505e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@
* 1066 Implemented Dashboard Designer...
* 1067 FIX: Fixed login problem in LDAP connector when no user filter specified...
* 1094 FIX: sidebar snaping 'Tree of folders': fixed exception
+ * 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after editing availability options...
WATO:
* 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different OS versions)...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index ec12741..acdafa9 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -94,11 +94,11 @@ def render_availability(view, datasource, filterheaders, display_options,
return
# We need the availability options now, but cannot display the
- # form code for that yet.
+ # form code for that yet. Ignore the HTML code.
html.plug()
avoptions = render_availability_options()
range, range_title = avoptions["range"]
- avoptions_html = html.drain()
+ html.drain()
html.unplug()
timeline = not not html.var("timeline")
@@ -154,7 +154,9 @@ def render_availability(view, datasource, filterheaders, display_options,
html.end_context_buttons()
if not do_csv:
- html.write(avoptions_html)
+ # Render the avoptions again to get the HTML code, because the HTML vars have changed
+ # above (anno_ and editanno_ has been removed, which must not be part of the form
+ avoptions = render_availability_options()
if not html.has_user_errors():
if timeline and tl_aggr:
Module: check_mk
Branch: master
Commit: cfe28fafad99f88e4fb5568f249d7aa103d58e34
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cfe28fafad99f8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 5 08:39:14 2014 +0200
#1152 FIX mk-job: The check now captures currently running jobs and their start time
Previously the check did only get data of jobs which already had finished. This
was a bit weird, because the start time and duration of the jobs could be configured
to be monitored and checked, but was not applied during runtime.
You need to update the agent plugin mk-job to make this work correctly.
---
.werks/1152 | 13 +++++++++++++
ChangeLog | 1 +
agents/mk-job | 6 +++---
checks/job | 45 ++++++++++++++++++++++++++++++++++++---------
4 files changed, 53 insertions(+), 12 deletions(-)
diff --git a/.werks/1152 b/.werks/1152
new file mode 100644
index 0000000..05950c8
--- /dev/null
+++ b/.werks/1152
@@ -0,0 +1,13 @@
+Title: mk-job: The check now captures currently running jobs and their start time
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407220584
+Class: fix
+
+Previously the check did only get data of jobs which already had finished. This
+was a bit weird, because the start time and duration of the jobs could be configured
+to be monitored and checked, but was not applied during runtime.
+
+You need to update the agent plugin mk-job to make this work correctly.
diff --git a/ChangeLog b/ChangeLog
index 038136c..bdb0be4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
* 1071 FIX: oracle_rman_backups: Only inventorize ARCHIVELOG / DB FULL / DB INCR entries...
* 0195 FIX: fc_port: Check temporary disabled cause of problems with automatic detection...
NOTE: Please refer to the migration notes!
+ * 1152 FIX: mk-job: The check now captures currently running jobs and their start time...
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/agents/mk-job b/agents/mk-job
index 04da0c8..5f9ba96 100755
--- a/agents/mk-job
+++ b/agents/mk-job
@@ -59,9 +59,9 @@ if ! type $1 >/dev/null 2>&1; then
exit 1
fi
-date +"start_time %s" > "$OUTPUT_PATH/.$IDENT.running"
-/usr/bin/time -o "$OUTPUT_PATH/.$IDENT.running" --append \
+date +"start_time %s" > "$OUTPUT_PATH/$IDENT.running"
+/usr/bin/time -o "$OUTPUT_PATH/$IDENT.running" --append \
-f "exit_code %x\nreal_time %E\nuser_time %U\nsystem_time %S\nreads %I\nwrites %O\nmax_res_kbytes %M\navg_mem_kbytes %K\ninvol_context_switches %c\nvol_context_switches %w" $@
RC=$?
-mv "$OUTPUT_PATH/.$IDENT.running" "$OUTPUT_PATH/$IDENT"
+mv "$OUTPUT_PATH/$IDENT.running" "$OUTPUT_PATH/$IDENT"
exit $RC
diff --git a/checks/job b/checks/job
index 046a4fd..aa47ed7 100644
--- a/checks/job
+++ b/checks/job
@@ -57,7 +57,8 @@ def inventory_job(info):
for line in info:
if line[0] == '==>':
item = ' '.join(line[1:-1])
- inventory.append( (item, {} ) )
+ if not item.endswith('.running'):
+ inventory.append( (item, {} ) )
return inventory
def job_parse_real_time(s):
@@ -71,11 +72,26 @@ def job_parse_real_time(s):
def job_parse(item, info):
found = False
+ found_running = False
data = {}
for line in info:
if ' '.join(line[1:-1]) == item:
found = True
+ elif ' '.join(line[1:-1]) == item + '.running':
+ # There might be a second section per job, the contents of the
+ # <ident>.running file which exists during execution of the job.
+ # We use the start_time from this file.
+ found_running = True
+
+ elif found_running and line[0] == '==>':
+ continue # simply skip over this line
+
+ elif found_running and len(line) == 2:
+ key, val = line
+ if key == 'start_time':
+ data['running_start_time'] = int(val)
+
elif found and line[0] == '==>':
break # Stop at next section
@@ -101,10 +117,28 @@ def check_job(item, params, info):
if not job:
return 3, 'Got no information for this job'
+ def process_start_time(value, state, warn, crit):
+ display_value = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(value) )
+ job_age = time.time() - value
+ if crit > 0 and job_age >= crit:
+ state = max(state, 2)
+ display_value += "(!!) (more than %s ago)" % get_age_human_readable(crit)
+ elif warn > 0 and job_age >= warn:
+ state = max(state, 1)
+ display_value += "(!!) (more than %s ago)" % get_age_human_readable(warn)
+ return state, display_value
+
state = 0
output = []
perfdata = []
+ if 'running_start_time' in job:
+ output.append('Currently running')
+ state, display_value = process_start_time(job['running_start_time'], state, warn, crit)
+ output.append('(Started: %s)' % display_value)
+ return state, ' '.join(output)
+
+
txt = 'Exit-Code: %d' % job['exit_code']
if job['exit_code'] != 0:
state = max(state, 2)
@@ -128,14 +162,7 @@ def check_job(item, params, info):
elif key in [ 'real_time', 'user_time', 'system_time' ]:
display_value = get_age_human_readable(value)
elif key == 'start_time':
- display_value = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(value) )
- job_age = time.time() - value
- if crit > 0 and job_age >= crit:
- state = max(state, 2)
- display_value += "(!!) (more than %s ago)" % get_age_human_readable(crit)
- elif warn > 0 and job_age >= warn:
- state = max(state, 1)
- display_value += "(!!) (more than %s ago)" % get_age_human_readable(warn)
+ state, display_value = process_start_time(value, state, warn, crit)
else:
display_value = value
Module: check_mk
Branch: master
Commit: 82ae288385f9c7efac242a03ade5ecf3d0191e4e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=82ae288385f9c7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 6 18:31:01 2014 +0200
Fixed exception in hosts BI aggregation link icon
---
web/htdocs/valuespec.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 39e93ab..c635f38 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -3100,7 +3100,11 @@ class VisualFilterList(ListOfMultiple):
def filter_variable_settings(self, value, row):
vars = []
for fname in value.keys():
- vars += self._filters[fname].variable_settings(row)
+ try:
+ vars += self._filters[fname].variable_settings(row)
+ except KeyError:
+ # When the row misses at least one var for a filter ignore this filter completely
+ pass
return vars
# Realizes a Multisite/visual filter in a valuespec. It can render the filter form, get