Module: check_mk
Branch: master
Commit: d57154234bff2f93268e2f248d3d3b4e217218a9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d57154234bff2f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 27 14:21:45 2015 +0100
raise exception when scan functions ask for OIDs without leading "."
---
modules/check_mk.py | 3 +++
modules/discovery.py | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e74d557..673ae20 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -739,6 +739,9 @@ def get_single_oid(hostname, ipaddress, oid):
# we do a snmpgetnext and try to find an OID with the prefix
# in question. The *cache* is working including the X, however.
+ if oid[0] != '.':
+ raise MKGeneralException("OID definition '%s' does not begin with ." % oid)
+
global g_single_oid_hostname
global g_single_oid_cache
diff --git a/modules/discovery.py b/modules/discovery.py
index 78fe93f..0315c32 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -345,6 +345,10 @@ def snmp_scan(hostname, ipaddress):
elif result:
found.append(check_type)
vverbose(" " + check_type)
+ except MKGeneralException:
+ # some error messages which we explicitly want to show to the user
+ # should be raised through this
+ raise
except:
pass
else:
Module: check_mk
Branch: master
Commit: cda6372d6fb9711929036a3efceca1c3aa92e9d9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cda6372d6fb971…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 27 14:04:39 2015 +0100
#2079 FIX freebsd agent: Was unable to find ntpq command with FreeBSD10
Added /usr/local/sbin to solve the issue. Seems ntpq has been moved
to this directory.
---
.werks/2079 | 11 +++++++++++
ChangeLog | 3 ++-
agents/check_mk_agent.freebsd | 2 +-
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2079 b/.werks/2079
new file mode 100644
index 0000000..a859125
--- /dev/null
+++ b/.werks/2079
@@ -0,0 +1,11 @@
+Title: freebsd agent: Was unable to find ntpq command with FreeBSD10
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1425042218
+
+Added /usr/local/sbin to solve the issue. Seems ntpq has been moved
+to this directory.
diff --git a/ChangeLog b/ChangeLog
index acb4a96..78350d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -205,11 +205,12 @@
* 2021 FIX: if_lancom: Also used for checking ELSA/T-Systems branded devices
* 2022 FIX: SNMP: Fixed handling of backslashes in SNMP data...
NOTE: Please refer to the migration notes!
- * 1224 FIX: Fixed rare Bug in case of clusterd network interfaces...
* 1863 FIX: cisco_power: fix for cases with a slash in the device description of a power supply...
NOTE: Please refer to the migration notes!
* 2023 FIX: if_lancom: Handle point-2-point interfaces of newer firmwares correctly
* 2027 FIX: fc_port: Fixed exception when wirespeed is reported as 0 by the device
+ * 1224 FIX: Fixed rare Bug in case of clusterd network interfaces...
+ * 2079 FIX: freebsd agent: Was unable to find ntpq command with FreeBSD10...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd
index 00301ae..d19ddc5 100755
--- a/agents/check_mk_agent.freebsd
+++ b/agents/check_mk_agent.freebsd
@@ -46,7 +46,7 @@ export MK_TMPDIR="/var/run/check_mk"
# Make sure, locally installed binaries are found
-PATH=$PATH:/usr/local/bin
+PATH=$PATH:/usr/local/bin:/usr/local/sbin
# All executables in PLUGINSDIR will simply be executed and their
# ouput appended to the output of the agent. Plugins define their own
Module: check_mk
Branch: master
Commit: 4fe7d6e6e8dfa4a0a159125a4ea389367ca37a95
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4fe7d6e6e8dfa4…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Feb 27 13:56:55 2015 +0100
#1224 FIX Fixed rare Bug in case of clusterd network interfaces
In case that all network interfaces don't have traffic for a moment (or counter wraps), Check_MK was unable to determine the active one.
The only solution is to use a random one here.
---
.werks/1224 | 11 +++++++++++
ChangeLog | 1 +
checks/if.include | 5 +++++
3 files changed, 17 insertions(+)
diff --git a/.werks/1224 b/.werks/1224
new file mode 100644
index 0000000..1e9709c
--- /dev/null
+++ b/.werks/1224
@@ -0,0 +1,11 @@
+Title: Fixed rare Bug in case of clusterd network interfaces
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1425041662
+
+In case that all network interfaces don't have traffic for a moment (or counter wraps), Check_MK was unable to determine the active one.
+The only solution is to use a random one here.
diff --git a/ChangeLog b/ChangeLog
index fd7f335..4987668 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -203,6 +203,7 @@
* 2021 FIX: if_lancom: Also used for checking ELSA/T-Systems branded devices
* 2022 FIX: SNMP: Fixed handling of backslashes in SNMP data...
NOTE: Please refer to the migration notes!
+ * 1224 FIX: Fixed rare Bug in case of clusterd network interfaces...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/if.include b/checks/if.include
index d484ef9..a972cd5 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -697,6 +697,7 @@ def check_if_common_single(item, params, info, force_counter_wrap = False, has_n
# which is master
if cluster_items:
maxval = 0
+ choosen_node = None
for node, result in cluster_items.items():
state, infotext, perfdata = result
for entry in perfdata:
@@ -705,6 +706,10 @@ def check_if_common_single(item, params, info, force_counter_wrap = False, has_n
maxval = max(maxval, value)
if maxval == value:
choosen_node = node
+ # In case that each node has a counter wrap for
+ # out, we use the last note from the list as source
+ if not choosen_node:
+ choosen_node = node
return cluster_items[choosen_node]
return (3, "no such interface")
Module: check_mk
Branch: master
Commit: c4887d10aa7148aaaff62374314e64a231d45c61
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c4887d10aa7148…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Feb 27 12:52:14 2015 +0100
memory.include: Now the function actually works
---
checks/memory.include | 70 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/checks/memory.include b/checks/memory.include
new file mode 100644
index 0000000..252cb47
--- /dev/null
+++ b/checks/memory.include
@@ -0,0 +1,70 @@
+#!/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-
+# 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_memory(used, total, params):
+
+ if params:
+ if type(params) == tuple:
+ params = { "levels" : ("perc_used", params) }
+ else:
+ params = { "levels" : ("ignore") }
+
+ perc_used = (float(used) / total) * 100
+ infotext = "Memory usage: %s (Used: %s, Total: %s)" % (
+ get_percent_human_readable(perc_used),
+ get_bytes_human_readable(used),
+ get_bytes_human_readable(total))
+
+ levelstext = ""
+ if params["levels"][0] == "ignore":
+ warn_abs, crit_abs = None, None
+ status = 0
+
+ elif params["levels"][0] == "perc_used":
+ warn_rel, crit_rel = params["levels"][1]
+ warn_abs, crit_abs = (warn_rel/100.0) * total, (crit_rel/100.0) * total
+ levelstext = " (warn/crit at %s/%s used)" % (get_percent_human_readable(warn_rel),
+ get_percent_human_readable(crit_rel))
+ elif params["levels"][0] == "abs_free":
+ warn_abs_free, crit_abs_free = params["levels"][1]
+ warn_abs, crit_abs = total - warn_abs_free, total - crit_abs_free
+ levelstext = " (warn/crit below %s/%s free)" % (
+ get_bytes_human_readable(warn_abs_free),
+ get_bytes_human_readable(crit_abs_free))
+
+ if warn_abs and crit_abs:
+ if used >= crit_abs:
+ status = 2
+ elif used >= warn_abs:
+ status = 1
+ else:
+ status = 0
+
+ if status:
+ infotext += levelstext
+
+ perfdata = [ ("memory_used", used, warn_abs, crit_abs, 0, total) ]
+ return status, infotext, perfdata