Module: check_mk
Branch: master
Commit: 478842395b5586c1e6ccee40c51bea0e3dcfce46
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=478842395b5586…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Aug 5 13:51:39 2014 +0200
#0197 check_uniserv: New Check for Uniserv Data Management Services
This check uses a tcp connect to monitor the Uniserv Service.
Uniserv ( http://www.uniserv.com/ ) is a Data Management Service who offers
diffrent services like Address Checks, Banking Data Checks etc.
---
.werks/197 | 13 ++++++
ChangeLog | 1 +
checkman/check_uniserv | 16 +++++++
checks/check_uniserv | 63 +++++++++++++++++++++++++++
doc/treasures/active_checks/check_uniserv | 67 +++++++++++++++++++++++++++++
web/plugins/wato/active_checks.py | 38 ++++++++++++++++
6 files changed, 198 insertions(+)
diff --git a/.werks/197 b/.werks/197
new file mode 100644
index 0000000..2334331
--- /dev/null
+++ b/.werks/197
@@ -0,0 +1,13 @@
+Title: check_uniserv: New Check for Uniserv Data Management Services
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407239445
+Class: feature
+
+This check uses a tcp connect to monitor the Uniserv Service.
+Uniserv ( http://www.uniserv.com/ ) is a Data Management Service who offers
+diffrent services like Address Checks, Banking Data Checks etc.
+
+
diff --git a/ChangeLog b/ChangeLog
index 5626a53..ae3c049 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 0193 docsis_cm_status: New Check Status Check for Cable Modems with Docsis MIB.
* 1070 printer_input/printer_output: New checks to monitor input/output sub-units of printers...
* 0196 esx_vsphere_hostsystem: New subcheck for maintenance mode...
+ * 0197 check_uniserv: New Check for Uniserv Data Management Services...
* 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/check_uniserv b/checkman/check_uniserv
new file mode 100644
index 0000000..d1b59d8
--- /dev/null
+++ b/checkman/check_uniserv
@@ -0,0 +1,16 @@
+title: Uniserv Service
+agents: active
+catalog: agentless
+license: GPL
+distribution: check_mk
+description:
+ This check uses a tcp connect to monitor the Uniserv Service.
+ Uniserv ( http://www.uniserv.com/ ) is a Data Management Service who offers
+ diffrent services like Address Checks, Banking Data Checks etc.
+
+ Whith this active check it is possible to querie one address and the response from
+ uniserv against a regex, or you can simply try to receive the version number from uniserv to make
+ sure that the service is reachable.
+
+ This check can be configured by Wato.
+
diff --git a/checks/check_uniserv b/checks/check_uniserv
new file mode 100644
index 0000000..013dc33
--- /dev/null
+++ b/checks/check_uniserv
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+def check_uniserv_arguments(params):
+ args = " $HOSTADDRESS$"
+ args += " " + str(params['port'])
+ args += " " + quote_shell_string(params['service'])
+ if type(params['job']) == tuple:
+ job = params['job'][0]
+ else:
+ job = params['job']
+ if job == "version":
+ args += " VERSION"
+ else:
+ address = params['job'][1]
+ args += " ADDRESS"
+ args += " " + quote_shell_string(address['street'])
+ args += " " + str(address['street_no'])
+ args += " " + quote_shell_string(address['city'])
+ args += " " + quote_shell_string(address['search_regex'])
+
+ return args
+
+def check_uniserv_desc(params):
+ if type(params['job']) == tuple:
+ job = params['job'][0]
+ else:
+ job = params['job']
+ if job == "version":
+ return "Version"
+ else:
+ return "Address " + params['job'][1]['city']
+
+
+active_check_info['uniserv'] = {
+ "command_line" : '$USER1$/check_uniserv $ARG1$',
+ "argument_function" : check_uniserv_arguments,
+ "service_description" : check_uniserv_desc,
+}
+
diff --git a/doc/treasures/active_checks/check_uniserv b/doc/treasures/active_checks/check_uniserv
new file mode 100755
index 0000000..fd3e867
--- /dev/null
+++ b/doc/treasures/active_checks/check_uniserv
@@ -0,0 +1,67 @@
+#!/usr/bin/python
+import socket, sys
+BUFFER_SIZE = 1024
+try:
+ HOST = sys.argv[1]
+ TCP_PORT = int(sys.argv[2])
+ SERVICE = sys.argv[3]
+ JOB = sys.argv[4]
+ if JOB == "ADDRESS":
+ STREET = sys.argv[5]
+ STREET_NR = sys.argv[6]
+ CITY = sys.argv[7]
+ REGEX = sys.argv[8]
+except:
+ print " Usage: client_uniserv.py HOSTNAME PORT SERVICE (VERSION|ADDRESS STREET NR CITY SEARCH_REGEX) "
+ sys.exit(3)
+
+def parse_response(data):
+ info = dict([ x.split('=') for x in data.split(";") ][:-1])
+ if info['type'] == '1':
+ print "Invalid response: " % str(info)
+ sys.exit(3)
+ return info
+
+s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+s.connect((HOST, TCP_PORT))
+
+sendstring = "open:service="+SERVICE+";servicehost="+HOST+"\n"
+s.send(sendstring)
+
+data = parse_response(s.recv(BUFFER_SIZE))
+if not data.get('session'):
+ print "Error getting SID. Response was: " + str(data)
+ sys.exit(3)
+sid = data.get('session')
+
+if JOB == "VERSION":
+ sendstring = "version:session="+sid+"\n"
+ s.send(sendstring)
+ data = parse_response(s.recv(BUFFER_SIZE))
+ state = 0
+ infotext = "Version is " + data['version_str']
+elif JOB == "ADDRESS":
+ import re
+ sendstring = "exec:session=%s;request_type=check_address;in_str=%s;in_hno=%s;in_city=%s\n" % \
+ ( sid, STREET, STREET_NR, CITY )
+ s.send(sendstring)
+ data = parse_response(s.recv(BUFFER_SIZE))
+
+ sendstring = "fetch:session="+sid+";out_zip=?;out_city=?\n"
+ s.send(sendstring)
+ data = parse_response(s.recv(BUFFER_SIZE))
+
+ state = 0
+ infotext = "Address is %s %s" % ( data['out_zip'], data['out_city'])
+ if not re.match( REGEX, data['out_city']):
+ infotext += " But excpects %s" % REGEX
+ state = 2
+else:
+ state = 3
+ infotext = "JOB not known"
+
+s.send("close:session="+sid+"\n")
+s.close()
+
+print infotext
+sys.exit(state)
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 18273dd..be4ee0c 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -475,6 +475,44 @@ register_rule(group,
match = 'all'
)
+register_rule(group,
+ "active_checks:uniserv", Dictionary(
+ title = _("Check uniserv service"), optional_keys = False, elements = [
+ ("port",
+ Integer( title = _("Port") )),
+ ("service",
+ TextAscii( title = _("Service String"),
+ help = _("Enter here the uniserve service name. (Has nothting to do with service description)")
+ )),
+ ("job",
+ CascadingDropdown(
+ title = _("Mode of the Check"),
+ help = _("Choose if you just want to query the version number,"
+ " or if you want to check the response to a address querie"),
+ choices = [
+ ("version", _("Check for Version")),
+ ("address", _("Check for a Address"),
+ Dictionary(
+ title = _("Address Check mode"),
+ optional_keys = False,
+ elements = [
+ ( "street",
+ TextAscii( title = _("Street name"))),
+ ( "street_no",
+ Integer( title = _("Street number"))),
+ ( "city",
+ TextAscii( title = _("City name"))),
+ ( "search_regex",
+ TextAscii( title = _("Check City against Regex"),
+ help = _( "The City name from the response will be checked against "
+ "the regular expression specified here"),
+ )),
+ ]
+ )),
+ ]
+ )),
+
+ ]))
register_rule(group,
"active_checks:http",
Module: check_mk
Branch: master
Commit: c67f0be79cf0ba768d359a2a31983470eecd1d50
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c67f0be79cf0ba…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Aug 5 11:10:19 2014 +0200
esx_vsphere_hostsystem.maintenance: Added manual
---
checkman/esx_vsphere_hostsystem.maintenance | 21 +++++++++++++++++++++
checks/esx_vsphere_hostsystem | 1 -
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/checkman/esx_vsphere_hostsystem.maintenance b/checkman/esx_vsphere_hostsystem.maintenance
new file mode 100644
index 0000000..6715708
--- /dev/null
+++ b/checkman/esx_vsphere_hostsystem.maintenance
@@ -0,0 +1,21 @@
+title: VMWare ESX Host System: Maintenance State
+agents: vsphere
+catalog: os/misc
+license: GPL
+distribution: check_mk
+description:
+ This check queries the maintenance State of an ESX host
+ system via the vsphere agent and returns:
+
+ {OK} if the ESX host has the same sate since the last service detection
+
+ {CRIT} if the state has changed.
+
+ The behavior can be changed by a Wato rule to force Maintenance mode or not.
+
+ See "Monitoring VMWare ESX with Check_MK" in the online documentation
+ as well.
+
+inventory:
+ On each ESX host one check is generated.
+
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index b885c00..7f7d262 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -211,7 +211,6 @@ def inventory_esx_vsphere_hostsystem_maintenance(info):
data = esx_vsphere_hostsystem_convert(info)
if 'runtime.inMaintenanceMode' in data:
current_state = str(data['runtime.inMaintenanceMode'][0]).lower()
- print current_state
return [(None, { 'target_state' : current_state })]
def check_esx_vsphere_hostsystem_maintenance(_no_item, params, info):
Module: check_mk
Branch: master
Commit: 3adef29f4f79911e22bd8cfd951c30d597b323fe
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3adef29f4f7991…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 5 08:28:00 2014 +0200
Updated bug entries #2128, #2152, #2154
---
.bugs/2128 | 7 +++++--
.bugs/2152 | 7 +++++--
.bugs/2154 | 7 +++++--
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/.bugs/2128 b/.bugs/2128
index 5dd4bef..511f3b7 100644
--- a/.bugs/2128
+++ b/.bugs/2128
@@ -1,10 +1,13 @@
Title: mk-job: Start time is only available after job finished
Component: checks
-State: open
+Class: bug
+State: done
Date: 2014-04-22 08:32:35
Targetversion: 1.2.5i1
-Class: bug
This should really be changed. The start time should be available once the job has been
started. The check needs to deal with the old job info and the start time of the just
started and currently running job while the job is running.
+
+2014-08-05 08:27:09: changed state open -> done
+Has been fixed. The check does process the currently running commands start_time.
diff --git a/.bugs/2152 b/.bugs/2152
index be404a8..293ee6c 100644
--- a/.bugs/2152
+++ b/.bugs/2152
@@ -1,10 +1,13 @@
Title: Resorting of embedded views in dashboard drop display_options
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2014-04-15 10:49:41
Targetversion: future
-Class: bug
If you resort a view by clicking on a column header (of a view that is
contained in the dashboard) then the display options get lost and the
title and context buttons appear.
+
+2014-08-05 07:56:17: changed state open -> done
+Has been solved with new dashboard editor
diff --git a/.bugs/2154 b/.bugs/2154
index e286e45..3f1896f 100644
--- a/.bugs/2154
+++ b/.bugs/2154
@@ -1,9 +1,9 @@
Title: Online-Status of users not correct
Component: wato
-State: open
+Class: bug
+State: done
Date: 2014-05-07 11:52:58
Targetversion: 1.2.5i1
-Class: bug
In the WATO users page there is a gray or green ball that indicates
wether a user is currently online. This is assumed to work as follows:
@@ -18,3 +18,6 @@ At least 50 users where active, but just a couple being displayed as online. It
the case that some cache prohibits the correct update of the last_seen information in
WATO, so that the last_seen.mk files are not being loaded and an old state of them being
used.
+
+2014-08-05 07:59:37: changed state open -> done
+Has been solved in 1.2.5i1.
Module: check_mk
Branch: master
Commit: 6316b43d11597bc1c60960b861d3a2a19ab1c813
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6316b43d11597b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 4 09:50:15 2014 +0200
Fixed various problems when loading builtin dashboards of old format
---
web/htdocs/dashboard.py | 31 ++++++++++++++++++++++++++++---
web/plugins/sidebar/wato.py | 3 ++-
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index c95cb0e..cc13b0d 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -60,13 +60,14 @@ dashlet_min_size = 10, 10 # Minimum width and height of dashlets
# thus must be reinitialized everytime a language-change has
# been detected.
def load_plugins():
- global loaded_with_language, dashboards
+ global loaded_with_language, dashboards, builtin_dashboards_transformed
if loaded_with_language == current_language:
return
# Load plugins for dashboards. Currently these files
# just may add custom dashboards by adding to builtin_dashboards.
load_web_plugins("dashboard", globals())
+ builtin_dashboards_transformed = False
# This must be set after plugin loading to make broken plugins raise
# exceptions all the time and not only the first time (when the plugins
@@ -82,7 +83,7 @@ def load_plugins():
for name, board in builtin_dashboards.items():
config.declare_permission("dashboard.%s" % name,
board["title"],
- board["description"],
+ board.get("description", ""),
config.builtin_role_ids)
# Make sure that custom views also have permissions
@@ -98,14 +99,27 @@ def load_dashboards():
# referenced by url, e.g. dashboard['url'] = 'hoststats.py'
# FIXME: can be removed one day. Mark as incompatible change or similar.
def transform_builtin_dashboards():
+ global builtin_dashboards_transformed
+ if builtin_dashboards_transformed:
+ return # Only do this once
for name, dashboard in builtin_dashboards.items():
+ # Do not transform dashboards which are already in the new format
+ if 'context' in dashboard:
+ continue
+
+ # Transform the dashlets
for nr, dashlet in enumerate(dashboard['dashlets']):
if dashlet.get('url', '').startswith('dashlet_') and dashlet['url'].endswith('.py'):
+ # hoststats and servicestats
dashlet['type'] = dashlet['url'][8:-3]
del dashlet['url']
- elif dashlet.get('url', '') != '':
+
+ elif dashlet.get('url', '') != '' or dashlet.get('urlfunc'):
+ # Normal URL based dashlet
dashlet['type'] = 'url'
+
elif dashlet.get('view', '') != '':
+ # Transform views
# There might be more than the name in the view definition
view_name = dashlet['view'].split('&')[0]
@@ -113,6 +127,11 @@ def transform_builtin_dashboards():
load_view_into_dashlet(dashlet, nr, view_name)
del dashlet['view']
+ else:
+ raise MKGeneralException(_('Unable to transform dashlet %d of dashboard %s. '
+ 'You will need to migrate it on your own. Definition: %r' %
+ (nr, name, html.attrencode(dashlet))))
+
# the modification time of builtin dashboards can not be checked as on user specific
# dashboards. Set it to 0 to disable the modification chech.
dashboard.setdefault('mtime', 0)
@@ -122,6 +141,12 @@ def transform_builtin_dashboards():
dashboard['title'] = _('No title')
dashboard['show_title'] = False
+ dashboard.setdefault('context_type', 'global')
+ dashboard.setdefault('context', {})
+ dashboard.setdefault('topic', _('Overview'))
+ dashboard.setdefault('description', dashboard.get('title', ''))
+ builtin_dashboards_transformed = True
+
def load_view_into_dashlet(dashlet, nr, view_name):
import views
views.load_views()
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 0583eb4..d584332 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import config, wato, views
+import config, wato, views, dashboard
# +----------------------------------------------------------------------+
# | __ ___ _____ ___ |
@@ -215,6 +215,7 @@ def render_wato_foldertree():
selected_topic, selected_target = config.load_user_file("foldertree", (_('Hosts'), 'allhosts'))
views.load_views()
+ dashboard.load_dashboards()
topic_views = visuals_by_topic(views.permitted_views().items() + dashboard.permitted_dashboards().items())
topics = [ (t, t) for t, s in topic_views ]
html.select("topic", topics, selected_topic, onchange = 'wato_tree_topic_changed(this)')
Module: check_mk
Branch: master
Commit: 1a070043e2ce66ba31176af8054c923222229e71
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a070043e2ce66…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 1 15:38:28 2014 +0200
#0194 FIX raritan_pdu_inlet: Check now outputs the correct values
The complete checks has been rewritten cause of a few problems with the old version.
A re-inventory of all raritan pdu devices is needed after update.
---
.werks/194 | 11 +++++++++++
ChangeLog | 2 ++
checks/raritan_pdu_inlet | 6 +++---
checks/raritan_pdu_inlet.include | 4 +++-
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/194 b/.werks/194
new file mode 100644
index 0000000..07eb1a2
--- /dev/null
+++ b/.werks/194
@@ -0,0 +1,11 @@
+Title: raritan_pdu_inlet: Check now outputs the correct values
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.5i6
+Date: 1406900223
+Class: fix
+
+The complete checks has been rewritten cause of a few problems with the old version.
+A re-inventory of all raritan pdu devices is needed after update.
+
diff --git a/ChangeLog b/ChangeLog
index 7aca901..31c01d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
* 0187 FIX: hp_proliant_power: Fixed Wato configuration
* 0192 FIX: oracle_rman_backups: Not longer try to make a inventory for broken plugin outputs
+ * 0194 FIX: raritan_pdu_inlet: Check now outputs the correct values...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/raritan_pdu_inlet b/checks/raritan_pdu_inlet
index a81c3c8..000d861 100644
--- a/checks/raritan_pdu_inlet
+++ b/checks/raritan_pdu_inlet
@@ -28,8 +28,8 @@ def raritan_pdu_inlet_convert(info):
# List of tuples, sorting like the snmp output,
# each tuple contains: capabilities, Unit, digits
translation = (
+ ( '2', 1 ),
( '1', 0 ),
- ( '2', 0 ),
( '3', 0 ),
( '4', 0 ),
( '-1', 2 ),
@@ -40,10 +40,10 @@ def raritan_pdu_inlet_convert(info):
for line in info:
y = 0
state = line[1]
- for value in line[2:]:
+ for value in line[1:]:
item = phases[i] + '-' + capabilities[translation[y][0]]
unit = translation[y][0]
- digits = translation[y][2]
+ digits = translation[y][1]
yield item, unit, digits, '1', state, value
y += 1
i += 1
diff --git a/checks/raritan_pdu_inlet.include b/checks/raritan_pdu_inlet.include
index b7bc570..8fab020 100644
--- a/checks/raritan_pdu_inlet.include
+++ b/checks/raritan_pdu_inlet.include
@@ -79,7 +79,9 @@ sensor_states = {
def inventory_raritan_pdu_inlet_generic(info):
for line in info:
- yield line[0], None
+ # Ignore closed sensor state
+ if line[4] != '1':
+ yield line[0], None
def check_raritan_pdu_inlet_generic(item, _no_params, info):
for line in info: