Module: check_mk
Branch: master
Commit: 8a5846d2e6a7f5994126e125013e7b01b46889e8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8a5846d2e6a7f5…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Dec 7 11:10:12 2015 +0100
#2884 mssql_blocked_sessions: the state of the blocked sessions is now configurable
---
.werks/2884 | 9 +++++++++
ChangeLog | 1 +
checkman/mssql_blocked_sessions | 6 +++---
checks/mssql_blocked_sessions | 13 +++++++++----
web/plugins/wato/check_parameters.py | 16 ++++++++++++++++
5 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/.werks/2884 b/.werks/2884
new file mode 100644
index 0000000..97f97a8
--- /dev/null
+++ b/.werks/2884
@@ -0,0 +1,9 @@
+Title: mssql_blocked_sessions: the state of the blocked sessions is now configurable
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1449482942
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 0a2671b..613a44c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,7 @@
* 2874 netstat_an.bat: Restrict output of connections to TCP, safes performance
* 2866 ewon: Added support for monitoring Wagner OxyReduct devices with their data exposed through an ewon router...
* 2867 check_http: client certificate and private key file parameters can now be set in wato...
+ * 2884 mssql_blocked_sessions: the state of the blocked sessions is now configurable
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checkman/mssql_blocked_sessions b/checkman/mssql_blocked_sessions
index 5617a78..26a8f2a 100644
--- a/checkman/mssql_blocked_sessions
+++ b/checkman/mssql_blocked_sessions
@@ -4,12 +4,12 @@ catalog: app/mssql
license: GPL
distribution: check_mk
description:
- This Checks lists all bolcked sessions on a MSSQL Server. As long at least one session is blocked,
- it will be {CRITICAL}.
+ This check lists all blocked sessions on a MSSQL Server. As long at least one session is blocked,
+ it will be {CRITICAL}. This state is configurable. The default value is {CRITICAL}.
This check needs the Check_MK mssql.vbs -plugin installed in
the agent. Please refer to the online documentation
for how to install that plugin.
inventory:
- One Check per Host will be created
+ One check per host will be created
diff --git a/checks/mssql_blocked_sessions b/checks/mssql_blocked_sessions
index 033e3e9..eb04e71 100644
--- a/checks/mssql_blocked_sessions
+++ b/checks/mssql_blocked_sessions
@@ -34,11 +34,15 @@
def inventory_mssql_blocked_sessions(info):
return [(None, None)]
-def check_mssql_blocked_sessions(item, params, info):
+def check_mssql_blocked_sessions(_no_item, params, info):
if len(info) > 1:
- for session_id, wait_duration_ms, wait_type, blocking_session_id in info[1:]:
- yield 2, "Session %s blocked by %s (Wait %s ms, Type: %s)" % \
- ( session_id, blocking_session_id, wait_duration_ms, wait_type )
+ state = 2
+ if params:
+ state = params.get("state", 2)
+ for session_id, wait_duration_ms, wait_type, blocking_session_id in info[1:]:
+ yield state, \
+ "Session %s blocked by %s (Wait %s ms, Type: %s)" % \
+ ( session_id, blocking_session_id, wait_duration_ms, wait_type )
else:
yield 0, "No blocked sessions"
@@ -47,4 +51,5 @@ check_info['mssql_blocked_sessions'] = {
'check_function' : check_mssql_blocked_sessions,
'inventory_function' : inventory_mssql_blocked_sessions,
'service_description' : "MSSQL Blocked Sessions",
+ 'group' : "mssql_blocked_sessions",
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 8997979..738c569 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -5342,6 +5342,22 @@ register_check_parameters(
match_type = "dict",
)
+register_check_parameters(
+ subgroup_applications,
+ "mssql_blocked_sessions",
+ _("MSSQL Blocked Sessions"),
+ Dictionary(
+ elements = [
+ ( "state",
+ MonitoringState(
+ title = _("State of MSSQL Blocked Sessions is treated as"),
+ default_value = 2,
+ )),
+ ],
+ ),
+ None,
+ "dict",
+)
register_check_parameters(
subgroup_applications,
Module: check_mk
Branch: master
Commit: dc53cb4d19abb62d55e29865e48188268a39b0f3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc53cb4d19abb6…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Dec 7 10:41:39 2015 +0100
#2867 check_http: client certificate and private key file parameters can now be set in wato
Users of these parameters should take extra care to verify the file names specified are valid.
---
.werks/2867 | 9 +++++++++
ChangeLog | 1 +
checks/check_http | 6 ++++++
web/plugins/wato/active_checks.py | 15 +++++++++++++++
4 files changed, 31 insertions(+)
diff --git a/.werks/2867 b/.werks/2867
new file mode 100644
index 0000000..94afa52
--- /dev/null
+++ b/.werks/2867
@@ -0,0 +1,9 @@
+Title: check_http: client certificate and private key file parameters can now be set in wato
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1449481056
+Class: feature
+
+Users of these parameters should take extra care to verify the file names specified are valid.
diff --git a/ChangeLog b/ChangeLog
index c0ec42c..0a2671b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@
* 2780 cisco_vss: detect this check on newer (15.1) devices
* 2874 netstat_an.bat: Restrict output of connections to TCP, safes performance
* 2866 ewon: Added support for monitoring Wagner OxyReduct devices with their data exposed through an ewon router...
+ * 2867 check_http: client certificate and private key file parameters can now be set in wato...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/check_http b/checks/check_http
index 85f882d..d1adddc 100644
--- a/checks/check_http
+++ b/checks/check_http
@@ -145,6 +145,12 @@ def check_http_arguments(params):
if settings.get("urlize"):
args += ' -L'
+ if "client_certificate" in settings:
+ args += ' -J %s' % settings["client_certificate"]
+
+ if "private_key" in settings:
+ args += ' -K %s' % settings["private_key"]
+
if not omit_ip:
args = " -I " + address + args
return args
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 8f798f7..6aa2d3c 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -973,6 +973,21 @@ register_rule(group,
"to the checked URL and this clickable."),
)
),
+ ( "client_certificate",
+ Filename(
+ title = _("Client Certificate File"),
+ help = _("Set the certificate the client uses to identify itself to the https server. "
+ "Needs to be in PEM format. "
+ "Please be very careful to enter a valid filename."),
+ )
+ ),
+ ( "private_key",
+ Filename(
+ title = _("Private Key File"),
+ help = _("Set the private key file (PEM format) matching the client certificate. "
+ "Please be very careful to enter a valid filename."),
+ )
+ ),
]
),