Module: check_mk
Branch: master
Commit: d4b8f873037f70a3e84d666ae1d3181133f559a3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d4b8f873037f70…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Jul 4 16:29:16 2016 +0200
3694 FIX fortigate_sessions_base: Added missing WATO rule
Conflicts:
ChangeLog
web/plugins/wato/check_parameters.py
---
.werks/3694 | 10 ++++++++++
ChangeLog | 1 +
checks/fortigate_sessions_base | 22 ++++++++++++----------
web/plugins/metrics/check_mk.py | 4 ++++
web/plugins/wato/check_parameters.py | 13 +++++++++++++
5 files changed, 40 insertions(+), 10 deletions(-)
diff --git a/.werks/3694 b/.werks/3694
new file mode 100644
index 0000000..93abc58
--- /dev/null
+++ b/.werks/3694
@@ -0,0 +1,10 @@
+Title: fortigate_sessions_base: Added missing WATO rule
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1467642109
+
+
diff --git a/ChangeLog b/ChangeLog
index 9c81753..e5a7760 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -296,6 +296,7 @@
* 3693 FIX: ups_eaton_enviroment: Fixed handling of dictionary-based parameters...
NOTE: Please refer to the migration notes!
* 3552 FIX: SNMPv3: Fixed login with security level noAuthNoPriv...
+ * 3694 FIX: fortigate_sessions_base: Added missing WATO rule
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/fortigate_sessions_base b/checks/fortigate_sessions_base
index 981aad4..5cd841b 100644
--- a/checks/fortigate_sessions_base
+++ b/checks/fortigate_sessions_base
@@ -31,18 +31,19 @@ def inventory_fortigate_sessions_base(info):
def check_fortigate_sessions_base(item, params, info):
warn, crit = params
- current = saveint(info[0][0])
- state = 0
- icon = ''
- if current >= warn:
- state = 1
- icon = "(!)"
+ current = int(info[0][0])
+ status = 0
if current >= crit:
- state = 2
- icon = "(!!)"
+ status = 2
+ elif current >= warn:
+ status = 1
- perf = [("session", current, warn, crit)]
- return state, "%d Session%s (warn/crit at %d/%d)" % (current, icon, warn,
crit), perf
+ infotext = "%d active sessions" % current
+ if status:
+ infotext += " (warn/crit at %d/%d)" % (warn, crit)
+
+ perfdata = [("session", current, warn, crit)]
+ return status, infotext, perfdata
check_info["fortigate_sessions_base"] = {
"inventory_function" : inventory_fortigate_sessions_base,
@@ -53,5 +54,6 @@ check_info["fortigate_sessions_base"] = {
"snmp_scan_function" : lambda oid: ".1.3.6.1.4.1.12356.101.1"
in oid(".1.3.6.1.2.1.1.2.0") and\
oid(".1.3.6.1.4.1.12356.101.4.1.8.0"),
"snmp_info" : ( ".1.3.6.1.4.1.12356.101.4.1", [ 8 ]),
+ "group" : "fortigate_sessions",
}
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 65ca01e..8a5dc97 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -4422,6 +4422,10 @@ check_metrics["check_mk-cisco_mem_asa"] = {
"mem_used" : { "name" : "mem_used_percent" }
}
+check_metrics["check_mk-fortigate_sessions_base"] = {
+ "session" : { "name" : "active_sessions" }
+}
+
#.
# .--Perf-O-Meters-------------------------------------------------------.
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index b346eb3..d4f15ea 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -198,6 +198,19 @@ register_check_parameters(
'dict'
)
+register_check_parameters(
+ subgroup_networking,
+ "fortigate_sessions",
+ _(u"Fortigate Active Sessions"),
+ Tuple(
+ title = _(u"Levels for active sessions"),
+ elements = [
+ Integer( title = _(u"Warning at"), default_value = 100000 ),
+ Integer( title = _(u"Critical at"), default_value = 150000 ),
+ ]),
+ None,
+ "first"
+)
#.
# .--Inventory-----------------------------------------------------------.