Module: check_mk
Branch: master
Commit: 5c51baf41200b0a058afbf3fbc4ac31740654ea5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5c51baf41200b0…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Sat Nov 30 00:01:28 2013 +0100
modbus_value: New check and Agent to modbus devices
This is the first approach to monitor modbus devices. Modbus is an industry bus wich can
be found for example in power devices for buildings.
---
.werks/102 | 9 +++
ChangeLog | 1 +
agents/special/agent_modbus | Bin 0 -> 7472 bytes
agents/special/agent_modbus.cpp | 109 +++++++++++++++++++++++++++++++
checkman/modbus_value | 17 +++++
checks/agent_modbus | 38 +++++++++++
checks/modbus_value | 65 ++++++++++++++++++
web/plugins/perfometer/check_mk.py | 7 ++
web/plugins/wato/check_parameters.py | 16 +++++
web/plugins/wato/datasource_programs.py | 34 ++++++++++
10 files changed, 296 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=5c51baf412…
Module: check_mk
Branch: master
Commit: 33c6dbdf077e9118179d759708e95d60c99f3750
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33c6dbdf077e91…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Nov 29 17:09:52 2013 +0100
Updated bug entries #0837
---
.bugs/837 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/837 b/.bugs/837
new file mode 100644
index 0000000..9b732b5
--- /dev/null
+++ b/.bugs/837
@@ -0,0 +1,9 @@
+Title: Service levels are missing in gui
+Component: multisite
+State: open
+Date: 2013-11-29 17:07:45
+Targetversion: 1.2.3i6
+Class: nastiness
+
+Its not possible to see the service levels on Hosts/ Services in Multisite. The Reason is,
+that they are no part of the livestatus output. With cmc its not possible to looking into the configfile to see the sl.
Module: check_mk
Branch: master
Commit: 3855b69e8559f11267929f5e190260b747085bdc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3855b69e8559f1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 29 15:55:19 2013 +0100
FIX Fix computation of hour-of-the-day and day-of-month prediction
This fix addresses two problems in the implementation of the predictive levels:
<ul>
<li>When you selected a prediction for <i>Hour of the day</i> you would get 24
single predictions and 24 separated graphs. This has been replaced by one single
predection for the whole day, which is much more conveniant.</li>
<li>The implementation of the <i>Day of the month</i> was broken. It would create
a prediction of just one day instead. This is fixed now.</li>
</ul>
---
.werks/10 | 17 +++++++++++++++++
ChangeLog | 1 +
2 files changed, 18 insertions(+)
diff --git a/.werks/10 b/.werks/10
new file mode 100644
index 0000000..fb473bc
--- /dev/null
+++ b/.werks/10
@@ -0,0 +1,17 @@
+Title: Fix computation of hour-of-the-day and day-of-month prediction
+Level: 1
+Component: core
+Version: 1.2.3i7
+Date: 1385736766
+Class: fix
+
+This fix addresses two problems in the implementation of the predictive levels:
+
+<ul>
+<li>When you selected a prediction for <i>Hour of the day</i> you would get 24
+single predictions and 24 separated graphs. This has been replaced by one single
+predection for the whole day, which is much more conveniant.</li>
+<li>The implementation of the <i>Day of the month</i> was broken. It would create
+a prediction of just one day instead. This is fixed now.</li>
+</ul>
+
diff --git a/ChangeLog b/ChangeLog
index 1fb1efd..ab595e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core & Setup:
* 0217 FIX: More verbose error output for SNMP errors on the command line...
* 0288 FIX: Error messages of datasource programs (e.g. VSphere Agent) are now visible within WATO...
+ * 0010 FIX: Fix computation of hour-of-the-day and day-of-month prediction...
Checks & Agents:
* 0060 cisco_fantray: new check for monitoring fan trays of Cisco Nexus switches
Module: check_mk
Branch: master
Commit: e60c59a82aad2c25887c49f50438550a7ab502ac
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e60c59a82aad2c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 29 15:57:51 2013 +0100
FIX Inline SNMP: Check_MK check helpers are closing UDP sockets now
In previous versions, the Check-Helpers in Check_MK were opening UDP
sockets for each host and caching them during their runtime. This resulted
in too many open sockets with a large amount of hosts. Now closing all
the sockets after an action iteration.
---
.werks/292 | 11 +++++++++++
ChangeLog | 1 +
modules/check_mk.py | 4 ++++
3 files changed, 16 insertions(+)
diff --git a/.werks/292 b/.werks/292
new file mode 100644
index 0000000..bcd1cd7
--- /dev/null
+++ b/.werks/292
@@ -0,0 +1,11 @@
+Title: Inline SNMP: Check_MK check helpers are closing UDP sockets now
+Level: 1
+Component: core
+Version: 1.2.3i7
+Date: 1385736912
+Class: fix
+
+In previous versions, the Check-Helpers in Check_MK were opening UDP
+sockets for each host and caching them during their runtime. This resulted
+in too many open sockets with a large amount of hosts. Now closing all
+the sockets after an action iteration.
diff --git a/ChangeLog b/ChangeLog
index 1fb1efd..0bb936d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core & Setup:
* 0217 FIX: More verbose error output for SNMP errors on the command line...
* 0288 FIX: Error messages of datasource programs (e.g. VSphere Agent) are now visible within WATO...
+ * 0292 FIX: Inline SNMP: Check_MK check helpers are closing UDP sockets now...
Checks & Agents:
* 0060 cisco_fantray: new check for monitoring fan trays of Cisco Nexus switches
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 24c5164..3d26e16 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -5069,6 +5069,10 @@ def cleanup_globals():
global g_walk_cache
g_walk_cache = {}
+ if 'g_snmp_sessions' in globals():
+ global g_snmp_sessions
+ g_snmp_sessions = {}
+
# Diagnostic function for detecting global variables that have
# changed during checking. This is slow and canno be used
Module: check_mk
Branch: master
Commit: 993c970897545df300850452bf3f21dc75b0687d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=993c970897545d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 29 15:27:13 2013 +0100
Added note to inventory draft
---
doc/drafts/LIESMICH.hardwareinventur | 7 +++++++
modules/check_mk_base.py | 2 +-
modules/prediction.py | 16 +++++++++++-----
web/htdocs/wato.py | 18 ++++++++++++++----
4 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/doc/drafts/LIESMICH.hardwareinventur b/doc/drafts/LIESMICH.hardwareinventur
index d3c9196..efca246 100644
--- a/doc/drafts/LIESMICH.hardwareinventur
+++ b/doc/drafts/LIESMICH.hardwareinventur
@@ -208,3 +208,10 @@ sind ja einfach anzuzeigen. Wenn aber etwas gebraucht wird wie "Version von
RPM-Paket X", dann ist das X ja variabel. Dies könnten wir evtl. lösen,
in dem wir den bestehenden Mechanismus zum Anzeigen von Service-Daten in
Hosttabellen verwenden.
+
+
+-------------------------------------------------------------------------------
+ N O T I Z E N
+-------------------------------------------------------------------------------
+
+- Das ganze muss natürlich auch auf Workstations funktionieren!
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index e2aed27..657749f 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1361,7 +1361,7 @@ def pnp_cleanup(s):
# | These functions are used in some of the checks. |
# +----------------------------------------------------------------------+
-# Generic function for checking a value against levels. This also support
+# Generic function for checking a value against levels. This also supports
# predictive levels.
# value: currently measured value
# dsname: name of the datasource in the RRD that corresponds to this value
diff --git a/modules/prediction.py b/modules/prediction.py
index bf114d3..db1041f 100644
--- a/modules/prediction.py
+++ b/modules/prediction.py
@@ -314,15 +314,21 @@ def get_predictive_levels(dsname, params, cf, levels_factor=1.0):
if p in params:
how, (warn, crit) = params[p]
if how == "absolute":
- levels.append((ref_value + (sig * warn * levels_factor), ref_value + (sig * crit * levels_factor)))
+ this_levels = (ref_value + (sig * warn * levels_factor), ref_value + (sig * crit * levels_factor))
elif how == "relative":
- levels.append((ref_value + sig * (ref_value * warn / 100),
- ref_value + sig * (ref_value * crit / 100)))
+ this_levels = (ref_value + sig * (ref_value * warn / 100),
+ ref_value + sig * (ref_value * crit / 100))
else: # how == "stdev":
- levels.append((ref_value + sig * (stdev * warn),
- ref_value + sig * (stdev * crit)))
+ this_levels = (ref_value + sig * (stdev * warn),
+ ref_value + sig * (stdev * crit))
+
+ if what == "upper" and "levels_upper_min" in params:
+ limit_warn, limit_crit = params["levels_upper_min"]
+ this_levels = (max(limit_warn, this_levels[0]), max(limit_crit, this_levels[1]))
+ levels.append(this_levels)
else:
levels.append((None, None))
+
# print levels
return ref_value, levels
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 24c2aca..eb2fc5c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12159,7 +12159,7 @@ def PredictiveLevels(**args):
dif = args.get("default_difference", (2.0, 4.0))
return Dictionary(
title = _("Predictive Levels"),
- optional_keys = [ "weight", "levels_upper", "levels_lower" ],
+ optional_keys = [ "weight", "levels_upper", "levels_upper_min", "levels_lower", "levels_lower_max" ],
default_keys = [ "levels_upper" ],
columns = 1,
headers = "sup",
@@ -12188,7 +12188,7 @@ def PredictiveLevels(**args):
# )),
( "levels_upper",
CascadingDropdown(
- title = _("Dynamic levels (upper bound)"),
+ title = _("Dynamic levels - upper bound"),
choices = [
( "absolute",
_("Absolute difference from prediction"),
@@ -12216,9 +12216,20 @@ def PredictiveLevels(**args):
)),
]
)),
+ ( "levels_upper_min",
+ Tuple(
+ title = _("Limit for upper bound dynamic levels"),
+ help = _("Regardless of how the dynamic levels upper bound are computed according to the prediction: "
+ "the will never be set below the following limits. This avoids false alarms "
+ "during times where the predicted levels would be very low."),
+ elements = [
+ Float(title = _("Warning level is at least")),
+ Float(title = _("Critical level is at least")),
+ ]
+ )),
( "levels_lower",
CascadingDropdown(
- title = _("Dynamic levels (lower bound)"),
+ title = _("Dynamic levels - lower bound"),
choices = [
( "absolute",
_("Absolute difference from prediction"),
@@ -12246,7 +12257,6 @@ def PredictiveLevels(**args):
)),
]
)),
-
]
)
Module: check_mk
Branch: master
Commit: 1070a172040ba633325af5e439c212bed043842a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1070a172040ba6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 29 15:24:40 2013 +0100
winperf_ts_sessions: New check to monitor Microsoft Terminal Server sessions
This check can be used to monitor the number of active and inactive user sessions.
---
.werks/291 | 8 ++++
ChangeLog | 1 +
checkman/winperf_ts_sessions | 27 +++++++++++++
checks/winperf_ts_sessions | 73 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 33 +++++++++++++++
5 files changed, 142 insertions(+)
diff --git a/.werks/291 b/.werks/291
new file mode 100644
index 0000000..22303e8
--- /dev/null
+++ b/.werks/291
@@ -0,0 +1,8 @@
+Title: winperf_ts_sessions: New check to monitor Microsoft Terminal Server sessions
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1385735024
+Class: feature
+
+This check can be used to monitor the number of active and inactive user sessions.
diff --git a/ChangeLog b/ChangeLog
index 5c16105..7d0a106 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@
* 0101 liebert_chiller_status: New check for Liebert Chiller devices
* 0083 brocade_mlx: Temperature sensors of one module now in one common check...
* 0008 df: Solaris agent now also supports samfs
+ * 0291 winperf_ts_sessions: New check to monitor Microsoft Terminal Server sessions...
* 0024 FIX: cisco_wlc: removed check configuration parameter ap_model...
* 0003 FIX: ps: Remove exceeding [ and ] in service description when using process inventory...
* 0037 FIX: checkman browser (cmk -m) was not working properly in network subtree...
diff --git a/checkman/winperf_ts_sessions b/checkman/winperf_ts_sessions
new file mode 100644
index 0000000..f55db18
--- /dev/null
+++ b/checkman/winperf_ts_sessions
@@ -0,0 +1,27 @@
+title: Microsoft Terminal Server Sessions
+agents: linux
+catalog: os/kernel
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the number of active and inactive Microsoft Terminal
+ Server Sessions using the windows performance counters (agent section
+ {<<<winperf_ts_sessions>>>}).
+
+ To make this check work, you need to configure the agent via it's .ini
+ file to forward the terminal service session related counters. Take a
+ look at the windows monitoring documentation for details.
+
+ It allows to set {WARN} and {CRIT} tresholds on the active and idle session.
+
+inventory:
+ The check generates service per host.
+
+perfdata:
+ The check generates perfdata for the active and inactive sessions.
+
+[parameters]
+paramaeters(dict): A dictionary with the following optional keys:
+
+ {"active"}: A tuple of warn and crit thresholds
+ {"inactive"}: A tuple of warn and crit thresholds
diff --git a/checks/winperf_ts_sessions b/checks/winperf_ts_sessions
new file mode 100644
index 0000000..dd9b6c7
--- /dev/null
+++ b/checks/winperf_ts_sessions
@@ -0,0 +1,73 @@
+#!/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.
+
+# Example output from agent:
+# <<<winperf_ts_sessions>>>
+# 1385714515.93 2102
+# 2 1 rawcount
+# 4 1 rawcount
+# 6 0 rawcount
+
+# Counters, relative to the base ID (2102)
+# 2 Total number of Terminal Services sessions.
+# 4 Number of active Terminal Services sessions.
+# 6 Number of inactive Terminal Services sessions.
+
+def inventory_winperf_ts_sessions(info):
+ if len(info) > 1:
+ return [ (None, {}) ]
+
+def check_winperf_ts_sessions(_unused, params, info):
+ if not info or len(info) == 1:
+ return 3, "Performance counters not available"
+ total, active, inactive = [ int(l[0]) for l in info[1:4] ]
+
+ state = 0
+ state_txt = []
+ for val, key, title in [ (active, 'active', 'Active'),
+ (inactive, 'inactive', 'Inactive') ]:
+ txt = '%d %s' % (val, title)
+ if key in params:
+ if val > params[key][0]:
+ state = max(state, 2)
+ txt += ' (!!)'
+ elif val > params[key][1]:
+ state = max(state, 1)
+ txt += ' (!)'
+ state_txt.append(txt)
+
+ perfdata = [ ('active', active, ), ('inactive', inactive) ]
+ return state, ", ".join(state_txt), perfdata
+
+check_config_variables.append("winperf_ts_sessions")
+
+check_info["winperf_ts_sessions"] = {
+ 'check_function': check_winperf_ts_sessions,
+ 'inventory_function': inventory_winperf_ts_sessions,
+ 'service_description': 'Sessions',
+ 'has_perfdata': True,
+ 'group': 'winperf_ts_sessions',
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 8cac46e..7ffd889 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3139,6 +3139,39 @@ register_check_parameters(
)
register_check_parameters(
+ subgroup_applications,
+ "winperf_ts_sessions",
+ _("Windows Terminal Server Sessions"),
+ Dictionary(
+ help = _("This check monitors number of active and inactive terminal "
+ "server sessions."),
+ elements = [
+ ( "active",
+ Tuple(
+ title = _("Number of active sessions"),
+ elements = [
+ Integer(title = _("Warning if above"), unit = _("sessions"), default_value = 100),
+ Integer(title = _("Critical if above"), unit = _("sessions"), default_value = 200),
+ ],
+ ),
+ ),
+ ( "inactive",
+ Tuple(
+ title = _("Number of inactive sessions"),
+ help = _("Levels for the number of sessions that are currently inactive"),
+ elements = [
+ Integer(title = _("Warning if above"), unit = _("sessions"), default_value = 10),
+ Integer(title = _("Critical if above"), unit = _("sessions"), default_value = 20),
+ ],
+ ),
+ ),
+ ]
+ ),
+ None,
+ None
+)
+
+register_check_parameters(
subgroup_storage,
"raid",
_("RAID: overall state"),
Module: check_mk
Branch: master
Commit: 1be408dcd181c3b84453048cf2d4809d055fd66a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1be408dcd181c3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 29 14:24:55 2013 +0100
Automatically schedule inventory check after service config change
Now after each change of the service configuration of a host via WATO -
may it be via manual changes or a bulk inventory - the inventory check
is automatically rescheduled in order to reflect the new service state
correctly immediately.
You can switch off this behaviour via a new global option called <i>Inventory
triggers inventory check</i>. The default setting is <b>on</b>.
---
.werks/9 | 14 ++++++++++++++
ChangeLog | 1 +
modules/automation.py | 15 +++++++++++++++
modules/check_mk.py | 1 +
web/plugins/wato/check_mk_configuration.py | 14 ++++++++++++++
5 files changed, 45 insertions(+)
diff --git a/.werks/9 b/.werks/9
new file mode 100644
index 0000000..be7f088
--- /dev/null
+++ b/.werks/9
@@ -0,0 +1,14 @@
+Title: Automatically schedule inventory check after service config change
+Level: 2
+Component: wato
+Version: 1.2.3i7
+Date: 1385731404
+Class: feature
+
+Now after each change of the service configuration of a host via WATO -
+may it be via manual changes or a bulk inventory - the inventory check
+is automatically rescheduled in order to reflect the new service state
+correctly immediately.
+
+You can switch off this behaviour via a new global option called <i>Inventory
+triggers inventory check</i>. The default setting is <b>on</b>.
diff --git a/ChangeLog b/ChangeLog
index 660f019..580014d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
* 0053 New rule for configuring the display_name of a service...
* 0216 Supporting float values as SNMP timeout value now...
* 0082 Improved online help for LDAP connections...
+ * 0009 Automatically schedule inventory check after service config change...
* 0048 FIX: Tests on host diagnose page are executed parallel now...
* 0033 FIX: Fixed problem when saving settings in WATOs host diagnostic page...
* 0205 FIX: NagVis related permissions of roles can be edited again...
diff --git a/modules/automation.py b/modules/automation.py
index 94dc497..6b4da4a 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -465,6 +465,21 @@ def automation_write_autochecks_file(hostname, table):
for ct, item, paramstring in table:
f.write(" (%r, %r, %r, %s),\n" % (hostname, ct, item, paramstring))
f.write("]\n")
+ if inventory_check_autotrigger and inventory_check_interval:
+ schedule_inventory_check(hostname)
+
+def schedule_inventory_check(hostname):
+ try:
+ import socket
+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ s.connect(livestatus_unix_socket)
+ now = int(time.time())
+ command = "SCHEDULE_FORCED_SVC_CHECK;%s;Check_MK inventory;%d" % (hostname, now)
+ s.send("COMMAND [%d] %s\n" % (now, command))
+ except Exception, e:
+ if opt_debug:
+ raise
+
def automation_parse_autochecks_file(hostname):
def split_python_tuple(line):
diff --git a/modules/check_mk.py b/modules/check_mk.py
index c1113cd..24c5164 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -246,6 +246,7 @@ inventory_check_interval = None # Nagios intervals (4h = 240)
inventory_check_severity = 1 # warning
inventory_check_do_scan = True # include SNMP scan for SNMP devices
inventory_max_cachefile_age = 120 # secs.
+inventory_check_autotrigger = True # Automatically trigger inv-check after automation-inventory
always_cleanup_autochecks = True
# Nagios templates and other settings concerning generation
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index f07a86f..9162b01 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1064,6 +1064,20 @@ register_configvar(group,
]
))
+register_configvar(group,
+ "inventory_check_autotrigger",
+ Checkbox(
+ title = _("Inventory triggers inventory check"),
+ label = _("Automatically schedule inventory check after service configuration changes"),
+ help = _("When this option is enabled then after each change of the service "
+ "configuration of a host via WATO - may it be via manual changes or a bulk "
+ "inventory - the inventory check is automatically rescheduled in order "
+ "to reflect the new service state correctly immediately."),
+ default_value = True,
+ ))
+
+
+
_if_portstate_choices = [
( '1', 'up(1)'),