Module: check_mk
Branch: master
Commit: 1a43b657879bc7639c7750976267efd58c64418e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a43b657879bc7…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu May 11 10:13:22 2017 +0200
4644 f5_bigip_mem: Improved Memory Check. Now also for TMM
As HR-MIB and UCD-MIB delivered incorrect information, F5 devices now have
their own checkplugin for memory. This includes also a separate Memory
Service for the TMM (Traffic Management Module). <b>Important</b>: This is
an incompatible change. You need to rediscover your services to remove the
hr_mem check and add the new f5_bigip_mem check.
Change-Id: Ibd85cf77202ae0739652be84a7c1e2b8639fac2b
---
.werks/4644 | 14 ++++++++
checkman/f5_bigip_mem | 13 +++++++
checkman/f5_bigip_mem.tmm | 14 ++++++++
checks/f5_bigip_mem | 90 +++++++++++++++++++++++++++++++++++++++++++++++
checks/ucd.include | 14 +++++---
5 files changed, 141 insertions(+), 4 deletions(-)
diff --git a/.werks/4644 b/.werks/4644
new file mode 100644
index 0000000..8f6828c
--- /dev/null
+++ b/.werks/4644
@@ -0,0 +1,14 @@
+Title: f5_bigip_mem: Improved Memory Check. Now also for TMM
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.5.0i1
+Date: 1494490116
+Class: feature
+
+As HR-MIB and UCD-MIB delivered incorrect information, F5 devices now have
+their own checkplugin for memory. This includes also a separate Memory
+Service for the TTM (Traffic Management Module). <b>Important</b>: This is
+an incompatible change. You need to rediscover your services to remove the
+hr_mem check and add the new f5_bigip_mem check.
diff --git a/checkman/f5_bigip_mem b/checkman/f5_bigip_mem
new file mode 100644
index 0000000..55b5d12
--- /dev/null
+++ b/checkman/f5_bigip_mem
@@ -0,0 +1,13 @@
+title: F5 Big-IP: Usage of memory
+agents: snmp
+catalog: hw/network/f5
+license: GPL
+distribution: check_mk
+description:
+ This check measures the memory usage of F5 BIG-IP devices.
+
+ The logic used for monitoring is exactly the same as in the agent based
+ check {mem.used}. Please refer to the man page of that check for details.
+
+inventory:
+ One service for the target host will be created.
diff --git a/checkman/f5_bigip_mem.tmm b/checkman/f5_bigip_mem.tmm
new file mode 100644
index 0000000..91da2c7
--- /dev/null
+++ b/checkman/f5_bigip_mem.tmm
@@ -0,0 +1,14 @@
+title: F5 Big-IP: Usage of TMM memory
+agents: snmp
+catalog: hw/network/f5
+license: GPL
+distribution: check_mk
+description:
+ This check measures the memory usage of the TMM (Traffic Management Module)
+ in F5 BIG-IP devices.
+
+ The logic used for monitoring is exactly the same as in the agent based
+ check {mem.used}. Please refer to the man page of that check for details.
+
+inventory:
+ One service for the target host will be created.
diff --git a/checks/f5_bigip_mem b/checks/f5_bigip_mem
new file mode 100644
index 0000000..17fa5b8
--- /dev/null
+++ b/checks/f5_bigip_mem
@@ -0,0 +1,90 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 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-
+# tails. 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:
+# Overall memory
+# .1.3.6.1.4.1.3375.2.1.7.1.1.0 8396496896 sysHostMemoryTotal
+# .1.3.6.1.4.1.3375.2.1.7.1.2.0 1331092416 sysHostMemoryUsed
+#
+# TMM (Traffic Management Module) memory
+# .1.3.6.1.4.1.3375.2.1.1.2.1.44.0 0 sysStatMemoryTotal
+# .1.3.6.1.4.1.3375.2.1.1.2.1.45.0 0 sysStatMemoryUsed
+
+factory_settings["f5_bigip_mem_default_levels"] = {
+ "levels" : ("perc_used", (80.0, 90.0))
+}
+
+def parse_f5_bigip_mem(info):
+ parsed = {
+ "mem" : (info[0][0], info[0][1]),
+ "tmm" : (info[0][2], info[0][3]),
+ }
+ return parsed
+
+def inventory_f5_bigip_mem(parsed):
+ return [ ( "total", {} ) ]
+
+
+def check_f5_bigip_mem(item, params, parsed):
+ mem_total, mem_used = parsed["mem"]
+ return check_memory_simple(float(mem_used), float(mem_total), params)
+
+check_info['f5_bigip_mem'] = {
+ 'parse_function' : parse_f5_bigip_mem,
+ 'inventory_function' : inventory_f5_bigip_mem,
+ 'check_function' : check_f5_bigip_mem,
+ 'service_description' : 'Memory',
+ 'has_perfdata' : True,
+ 'snmp_info' : (".1.3.6.1.4.1.3375.2.1", [
+ "7.1.1", # F5-BIGIP-SYSTEM-MIB::sysHostMemoryTotal
+ "7.1.2", # F5-BIGIP-SYSTEM-MIB::sysHostMemoryUsed
+ "1.2.1.143", # F5-BIGIP-SYSTEM-MIB::sysStatMemoryTotalKb
+ "1.2.1.144", # F5-BIGIP-SYSTEM-MIB::sysStatMemoryUsedKb
+ ]),
+ 'snmp_scan_function' : lambda oid: ".1.3.6.1.4.1.3375" in oid(".1.3.6.1.2.1.1.2.0"),
+ 'default_levels_variable' : 'f5_bigip_mem_default_levels',
+ 'group' : 'memory_simple',
+ 'includes' : [ "memory.include" ],
+}
+
+def inventory_f5_bigip_mem_tmm(parsed):
+ if not float(parsed["tmm"][0]) == 0:
+ return [ ( "TMM", {} ) ]
+
+
+def check_f5_bigip_mem_tmm(item, params, parsed):
+ mem_total, mem_used = parsed["tmm"]
+ return check_memory_simple(float(mem_used) * 1024, float(mem_total) * 1024, params)
+
+check_info['f5_bigip_mem.tmm'] = {
+ 'inventory_function' : inventory_f5_bigip_mem_tmm,
+ 'check_function' : check_f5_bigip_mem_tmm,
+ 'service_description' : 'Memory',
+ 'has_perfdata' : True,
+ 'default_levels_variable' : 'f5_bigip_mem_default_levels',
+ 'group' : 'memory_simple',
+ 'includes' : [ "memory.include" ],
+}
diff --git a/checks/ucd.include b/checks/ucd.include
index 7ec70db..cffa43d 100644
--- a/checks/ucd.include
+++ b/checks/ucd.include
@@ -56,11 +56,17 @@ def hr_mem_scan_function(oid):
# We prefer HOST-RESOURCES-MIB implementation but not in case
# of devices, which are known to report incorrect information
# about mem usage
- return not "pfsense" in oid(".1.3.6.1.2.1.1.1.0").lower() or \
- (oid(".1.3.6.1.2.1.25.1.1.0") and \
- not ucd_scan_function(oid))
+ return (not "pfsense" in oid(".1.3.6.1.2.1.1.1.0").lower() and \
+ ignore_ucd_and_hr(oid)) or \
+ (oid(".1.3.6.1.2.1.25.1.1.0") and \
+ not ucd_scan_function(oid))
def ucd_mem_scan_function(oid):
# Avoid inverting output of a function in a check plugin and be
# descriptive about what a function is actually doing
- return not hr_mem_scan_function(oid)
+ return not hr_mem_scan_function(oid) and \
+ ignore_ucd_and_hr(oid)
+
+def ignore_ucd_and_hr(oid):
+ # Some devices report incorrect data on both hr and ucd
+ return not oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.3375") # F5 BigIP
Module: check_mk
Branch: master
Commit: 9b930e1e40cf16adc1d9d7345b11d9a9e071d232
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b930e1e40cf16…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Tue Feb 28 09:50:05 2017 +0100
4440 check_sftp: New Check for SFTP Connections
With this new active check you are able to verify successfull logins and
optionally a timestamp of a file or operability of getting/putting a file.
This plugin needs the python libary paramiko and is therefore not out of
the box compatible with older releases of Check_MK.
Change-Id: If476f67177e82aad52b509ea8b7a141b4281bb82
---
.werks/4440 | 14 +++
active_checks/check_sftp | 248 ++++++++++++++++++++++++++++++++++++++
checks/check_sftp | 62 ++++++++++
web/plugins/wato/active_checks.py | 87 +++++++++++++
4 files changed, 411 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=9b930e1e40…
Module: check_mk
Branch: master
Commit: 33b62e6a9e9c20b541ccca35898103cb73feac34
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33b62e6a9e9c20…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Tue May 23 14:15:04 2017 +0200
4568 FIX mk_inventory.vbs: fixed getNetworkAdpater function to prevent errors caused by null arrays
Change-Id: I1a0c3f109471019e3af4337c37ed34012d114ba8
---
.werks/4568 | 10 ++++++++++
agents/windows/plugins/mk_inventory.vbs | 14 ++++++++++----
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/.werks/4568 b/.werks/4568
new file mode 100644
index 0000000..054040f
--- /dev/null
+++ b/.werks/4568
@@ -0,0 +1,10 @@
+Title: mk_inventory.vbs: fixed getNetworkAdpater function to prevent errors caused by null arrays
+Level: 2
+Component: inv
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495541509
+Class: fix
+
+
diff --git a/agents/windows/plugins/mk_inventory.vbs b/agents/windows/plugins/mk_inventory.vbs
index 6b5b7cc..df3990a 100644
--- a/agents/windows/plugins/mk_inventory.vbs
+++ b/agents/windows/plugins/mk_inventory.vbs
@@ -141,13 +141,19 @@ Sub getNetworkAdapter(arrVars)
For Each adapterCfg in AdapterConfigs
If entry.name = adapterCfg.Description Then
- outPut("Address: " & join(adapterCfg.IPAddress))
- outPut("Subnet: " & join(adapterCfg.IPSubnet))
- outPut("DefaultGateway: " & join(adapterCfg.DefaultIPGateway))
+ If not isNull(adapterCfg.IPAddress) Then
+ outPut("Address: " & join(adapterCfg.IPAddress))
+ End If
+ If not isNull(adapterCfg.IPSubnet) Then
+ outPut("Subnet: " & join(adapterCfg.IPSubnet))
+ End If
+ If not isNull(adapterCfg.DefaultIPGateway) Then
+ outPut("DefaultGateway: " & join(adapterCfg.DefaultIPGateway))
+ End If
End If
Next
End If
- Next
+ Next
End Sub
Sub RecurseForExecs(strFolderPath)
Module: check_mk
Branch: master
Commit: 91cd714ad085537329a7b601c451708338530ed3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91cd714ad08553…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Tue May 9 16:05:09 2017 +0200
4567 FIX inventory of interfaces: prevent showing negative last_state_change value
On SNMP devices sysUpTime is a 32-bit counter and will roll over after 496 days.
ifLastChange is the timestamp from sysUpTime when the state changed. At
inventory time we got a negative value if sysUpTime was smaller then
ifLastChange (because it rolled over) using the normal formula. If sysUpTime is
smaller than ifLastChange we add 496 days for the rollover now.
When the device reboots all last_state_change values are set to 0 by the device
so those cases are not affected by the fix..
Beware there's no way to get the count of times the sysUpTime counter rolled
over so the last_state_change is not accurate in case it's in real more than 496
days ago. ...but this situation has never been different. This fix just removes
another error in shown values.
Change-Id: I885abb577f888598918067e4396c0af12801a98b
---
.werks/4567 | 23 +++++++++++++++++++++++
inventory/if | 10 ++++++++++
2 files changed, 33 insertions(+)
diff --git a/.werks/4567 b/.werks/4567
new file mode 100644
index 0000000..c4b564c
--- /dev/null
+++ b/.werks/4567
@@ -0,0 +1,23 @@
+Title: inventory of interfaces: prevent showing negative last_state_change value
+Level: 2
+Component: inv
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1494337855
+Class: fix
+
+On SNMP devices sysUpTime is a 32-bit counter and will roll over after 496 days.
+ifLastChange is the timestamp from sysUpTime when the state changed. At
+inventory time we got a negative value if sysUpTime was smaller then
+ifLastChange (because it rolled over) using the normal formula. If sysUpTime is
+smaller than ifLastChange we add 496 days for the rollover now.
+
+When the device reboots all last_state_change values are set to 0 by the device
+so those cases are not affected by the fix..
+
+Beware there's no way to get the count of times the sysUpTime counter rolled
+over so the last_state_change is not accurate in case it's in real more than 496
+days ago. ...but this situation has never been different. This fix just removes
+another error in shown values.
+
diff --git a/inventory/if b/inventory/if
index b24bc6a..dcc44f5 100644
--- a/inventory/if
+++ b/inventory/if
@@ -73,6 +73,16 @@ def inv_if(info, params):
if last_change > 0:
state_age = uptime - last_change
+
+ # Assume counter rollover in case uptime is less than last_change and
+ # add 497 days (counter maximum).
+ # This way no negative chenge times are shown anymore. The state change is shown
+ # wrong in case it's really 497 days ago when state changed but there's no way to
+ # get the count of rollovers since change (or since uptime) and it's better the
+ # wrong negative state change is not shown anymore...
+ if state_age < 0:
+ state_age = 42949672 - last_change + uptime
+
else:
# Assume point of time of boot as last state change.
state_age = uptime
Module: check_mk
Branch: master
Commit: 040a908aa33901109978dc54dc718b50ebe93f99
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=040a908aa33901…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue May 23 13:35:21 2017 +0200
4690 FIX Fixed handling of state changes when cmcdump is used
State changes coming in via cmcdump were always considered "hard" state
changes, leading to superfluous logging in the history file and wrong
alerts. This has been fixed.
Change-Id: I6c890a92ff42de53af9094ab61465f105e3ece20
---
.werks/4690 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.werks/4690 b/.werks/4690
new file mode 100644
index 0000000..18c0548
--- /dev/null
+++ b/.werks/4690
@@ -0,0 +1,12 @@
+Title: Fixed handling of state changes when cmcdump is used
+Level: 1
+Component: core
+Compatible: compat
+Edition: cee
+Version: 1.5.0i1
+Date: 1495539171
+Class: fix
+
+State changes coming in via cmcdump were always considered "hard" state
+changes, leading to superfluous logging in the history file and wrong
+alerts. This has been fixed.
Module: check_mk
Branch: master
Commit: aff06f54d44f73bc1b5775067c635c010d7605ca
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aff06f54d44f73…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue May 23 13:28:45 2017 +0200
4746 FIX Fixed using HW/SW inventory filters in views without inventory painters
When adding a HW/SW inventory related filter to a view without adding a sorter
or painter, this resulted in a KeyError exception.
Change-Id: I69e6666b22fa16744e1e3884bc77261eb0e80c6e
---
.werks/4746 | 12 ++++++++++++
web/htdocs/views.py | 20 ++++++++------------
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/.werks/4746 b/.werks/4746
new file mode 100644
index 0000000..8853a05
--- /dev/null
+++ b/.werks/4746
@@ -0,0 +1,12 @@
+Title: Fixed using HW/SW inventory filters in views without inventory painters
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1495538857
+
+When adding a HW/SW inventory related filter to a view without adding a sorter
+or painter, this resulted in a KeyError exception.
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 3ae10c5..0bcf0a8 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1508,10 +1508,6 @@ def show_view(view, show_heading = False, show_buttons = True,
# Check that all needed information for configured single contexts are available
visuals.verify_single_contexts('views', view, datasource.get('link_filters', {}))
- # Af any painter, sorter or filter needs the information about the host's
- # inventory, then we load it and attach it as column "host_inventory"
- need_inventory_data = False
-
# Prepare Filter headers for Livestatus
# TODO: When this is used by the reporting then *all* filters are
# active. That way the inventory data will always be loaded. When
@@ -1522,8 +1518,6 @@ def show_view(view, show_heading = False, show_buttons = True,
for filt in all_active_filters:
header = filt.filter(tablename)
filterheaders += header
- if filt.need_inventory():
- need_inventory_data = True
# Apply the site hint / filter
if html.var("site"):
@@ -1578,9 +1572,6 @@ def show_view(view, show_heading = False, show_buttons = True,
columns = get_needed_regular_columns(group_cells + cells, sorters, datasource)
join_columns = get_needed_join_columns(join_cells, sorters, datasource)
- # Inventory data needed to render the view?
- need_inventory_data = is_inventory_data_needed(group_cells, cells, sorters)
-
# Fetch data. Some views show data only after pressing [Search]
if (only_count or (not view.get("mustsearch")) or html.var("filled_in") in ["filter", 'actions', 'confirm', 'painteroptions']):
# names for additional columns (through Stats: headers)
@@ -1604,8 +1595,9 @@ def show_view(view, show_heading = False, show_buttons = True,
if join_cells:
do_table_join(datasource, rows, filterheaders, join_cells, join_columns, only_sites)
- # Add inventory data if one of the painters or filters needs it
- if need_inventory_data:
+ # If any painter, sorter or filter needs the information about the host's
+ # inventory, then we load it and attach it as column "host_inventory"
+ if is_inventory_data_needed(group_cells, cells, sorters, all_active_filters):
for row in rows:
if "host_name" in row:
row["host_inventory"] = inventory.host(row["host_name"])
@@ -1737,7 +1729,7 @@ def get_needed_join_columns(join_cells, sorters, datasource):
return list(join_columns)
-def is_inventory_data_needed(group_cells, cells, sorters):
+def is_inventory_data_needed(group_cells, cells, sorters, all_active_filters):
for cell in cells:
if cell.has_tooltip():
if cell.tooltip_painter_name().startswith("inv_"):
@@ -1751,6 +1743,10 @@ def is_inventory_data_needed(group_cells, cells, sorters):
if cell.painter().get("load_inv"):
return True
+ for filt in all_active_filters:
+ if filt.need_inventory():
+ return True
+
return False