Module: check_mk
Branch: master
Commit: fd482c5b94c1ca3ce341675dea54761d65d0dca7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd482c5b94c1ca…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 11 11:23:04 2016 +0200
Fixed broken man page for sap.value-groups check
---
web/htdocs/wato.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4141097..881fd35 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -14808,7 +14808,9 @@ def mode_check_manpage(phase):
check_type = html.var("check_type")
if phase == "title":
- if not re.match("^[a-zA-Z0-9_.]+$", check_type):
+ # TODO: There is one check "sap.value-groups" which will be renamed to "sap.value_groups".
+ # As long as the old one is available, allow a minus here.
+ if not re.match("^[-a-zA-Z0-9_.]+$", check_type):
raise Exception("Invalid check type")
manpage = check_mk_local_automation("get-check-manpage", [ check_type ])
Module: check_mk
Branch: master
Commit: ac2e0e44a924aa6fa118366cb8520af52f55e46a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ac2e0e44a924aa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 11 11:22:28 2016 +0200
Fixed broken link in werk
---
.werks/715 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/715 b/.werks/715
index e15fb26..86f6a31 100644
--- a/.werks/715
+++ b/.werks/715
@@ -6,6 +6,6 @@ Date: 1395073928
Class: feature
Check_MK BI now also aggregates the information wether problems that make the aggregate
-non-OK are acknowledged. Please refer to the updated <a href="checkmk_bi.html">documentation
+non-OK are acknowledged. Please refer to the updated <a href="http://mathias-kettner.com/checkmk_bi.html">documentation
about BI</a> for details.
Module: check_mk
Branch: master
Commit: d840ca924cf881e6108293c8f71b2b9cc69bbbf9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d840ca924cf881…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 11 11:07:14 2016 +0200
Fixed HW/SW inventory of list nodes
---
modules/inventory.py | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/modules/inventory.py b/modules/inventory.py
index fa55dd2..83998b4 100644
--- a/modules/inventory.py
+++ b/modules/inventory.py
@@ -72,9 +72,8 @@ for f in filelist:
# This is just a small wrapper for the inv_tree() function which makes
# it clear that the requested tree node is treated as a list.
def inv_tree_list(path):
- l = []
- l += inv_tree(path)
- return l
+ # The [] is needed to tell pylint that a list is returned
+ return inv_tree(path, [])
# Function for accessing the inventory tree of the current host
@@ -82,14 +81,21 @@ def inv_tree_list(path):
# The path must end with : or .
# -> software is a dict
# -> packages is a list
-def inv_tree(path):
+def inv_tree(path, default_value=None):
global g_inv_tree
- node = g_inv_tree
+ if default_value != None:
+ node = default_value
+ else:
+ node = {}
+
current_what = "."
current_path = ""
while path:
+ if current_path == "":
+ node = g_inv_tree
+
parts = re.split("[:.]", path)
name = parts[0]
what = path[len(name)]
Module: check_mk
Branch: master
Commit: e4db79755a9feeb90e203fabfc5e8a0ab7aa4e30
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e4db79755a9fee…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed May 11 10:26:58 2016 +0200
Improved Unicode robustness.
---
bin/mkeventd | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/bin/mkeventd b/bin/mkeventd
index 134e33e..f060feb 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -97,6 +97,19 @@ history_columns = [
# Alas, we often have no clue about the actual encoding, so we have to guess:
# Initially we assume UTF-8, but fall back to latin-1 if it didn't work.
def decode_from_bytes(string_as_bytes):
+ # This is just a safeguard if we are inadvertedly called with a Unicode
+ # string. In theory this should never happen, but given the typing chaos in
+ # this script, one never knows. In the Unicode case, Python tries to be
+ # "helpful", but this fails miserably: Calling 'decode' on a Unicode string
+ # implicitly converts it via 'encode("ascii")' to a byte string first, but
+ # this can of course fail and doesn't make sense at all when we immediately
+ # call 'decode' on this byte string again. In a nutshell: The implicit
+ # conversions between str and unicode are a fundamentally broken idea, just
+ # like all implicit things and "helpful" ideas in general. :-P For further
+ # info see e.g. http://nedbatchelder.com/text/unipain.html
+ if type(string_as_bytes) == unicode:
+ return string_as_bytes
+
try:
return string_as_bytes.decode("utf-8")
except:
Module: check_mk
Branch: master
Commit: 04fa83c68f5a21f0a0e94cb36b3d2d1438fb91c8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=04fa83c68f5a21…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed May 11 09:47:41 2016 +0200
3131 FIX if64, if64adm: These checks now display the speed of interfaces slower than 1Mbit correctly
Previously, the two checks relied on a counter that has 10^6 bit resolution, so interfaces with
less than 1Mbit speed were reported as "speed unknown", whereas the if check was capped at 4Gbit
speed, reporting wrong speed for faster interfaces.
The if64, if64adm checks have now been updated to provide the correct speed for all interfaces.
---
.werks/3131 | 12 ++++++++++++
ChangeLog | 1 +
checks/if64.include | 12 +++++++++---
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.werks/3131 b/.werks/3131
new file mode 100644
index 0000000..a6ba5e5
--- /dev/null
+++ b/.werks/3131
@@ -0,0 +1,12 @@
+Title: if64, if64adm: These checks now display the speed of interfaces slower than 1Mbit correctly
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1462952497
+Class: fix
+
+Previously, the two checks relied on a counter that has 10^6 bit resolution, so interfaces with
+less than 1Mbit speed were reported as "speed unknown", whereas the if check was capped at 4Gbit
+speed, reporting wrong speed for faster interfaces.
+The if64, if64adm checks have now been updated to provide the correct speed for all interfaces.
diff --git a/ChangeLog b/ChangeLog
index 59f4122..97463fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -211,6 +211,7 @@
* 3528 FIX: netapp_api_protocol: fixed service discovery problem with older 7mode versions
* 3529 FIX: agent_netapp: fixed problem with older netapp versions (7Mode - Version 8.0)...
* 3573 FIX: ps: Fixed possible wrong matching of ps and ucb ps commands
+ * 3131 FIX: if64, if64adm: These checks now display the speed of interfaces slower than 1Mbit correctly...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/if64.include b/checks/if64.include
index cfa27d5..fe9a65e 100644
--- a/checks/if64.include
+++ b/checks/if64.include
@@ -29,9 +29,14 @@
def parse_if64(info):
parsed = []
for line in info:
- # Fix for switches like DLINK, with empty lines in MIB
+ # some DLINK switches apparently report a broken interface with index 0,
+ # filter that out
if saveint(line[1]) > 0:
- parsed.append(line[:4] + [saveint(line[4]) * 1000000] + line[5:])
+ # ifHighSpeed (idx 21) can't represent interfaces with less than 10^6 bit bandwidth,
+ # ifSpeed (idx 4) is capped at 4GBit.
+ # combine the two to get the actual interface speed
+ real_speed = (saveint(line[-1]) * 1000000) + (saveint(line[4]) % 1000000)
+ parsed.append(line[:4] + [real_speed] + line[5:-1])
return parsed
@@ -69,7 +74,7 @@ if64_snmp_end_oids = [
"2.2.1.1", # ifIndex 0
"2.2.1.2", # ifDescr 1
"2.2.1.3", # ifType 2
- "31.1.1.1.15", # ifHighSpeed .. 1000 means 1Gbit
+ "2.2.1.5", # ifSpeed 3
"2.2.1.8", # ifOperStatus 4
"31.1.1.1.6", # ifHCInOctets 5
"31.1.1.1.7", # ifHCInUcastPkts 6
@@ -86,4 +91,5 @@ if64_snmp_end_oids = [
"2.2.1.21", # ifOutQLen 17
"31.1.1.1.18", # ifAlias 18
BINARY("2.2.1.6"), # ifPhysAddress 19
+ "31.1.1.1.15", # ifHighSpeed -1 (parse_if64 assumes this is the last element)
]
Module: check_mk
Branch: master
Commit: 3c32f096ff6b806fec536dec94d5a3c978af85ce
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3c32f096ff6b80…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 11 08:28:42 2016 +0200
3573 FIX ps: Fixed possible wrong matching of ps and ucb ps commands
---
.werks/3573 | 10 ++++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 39 ++++++++++++++++++++++-----------------
3 files changed, 33 insertions(+), 17 deletions(-)
diff --git a/.werks/3573 b/.werks/3573
new file mode 100644
index 0000000..f8beadb
--- /dev/null
+++ b/.werks/3573
@@ -0,0 +1,10 @@
+Title: ps: Fixed possible wrong matching of ps and ucb ps commands
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462948016
+
+
diff --git a/ChangeLog b/ChangeLog
index d7a6e93..59f4122 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -210,6 +210,7 @@
* 3565 FIX: wmi checks: Fixed deprecation warning when WMI keys can not be found in agent output
* 3528 FIX: netapp_api_protocol: fixed service discovery problem with older 7mode versions
* 3529 FIX: agent_netapp: fixed problem with older netapp versions (7Mode - Version 8.0)...
+ * 3573 FIX: ps: Fixed possible wrong matching of ps and ucb ps commands
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index d251723..721b611 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -193,23 +193,28 @@ echo '<<<ps>>>'
# matching on the server we really need to whole command line. On linux there are arguments to
# make ps output the whole command line, but on solaris this seems to be missing. We use the ucb
# ps command to get the full command line instead. What a hack.
-UCB_PS=$(/usr/ucb/ps -agwwwx)
-PS=$(ps -o user,vsz,rss,pcpu,etime,pid,args $pszone | \
- sed -e 1d -e 's/ *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) */(\1,\2,\3,\4,\5,\6) /')
-while read -r LINE; do
- STATS=${LINE%) *}
- PID=${STATS##*,}
-
- CMD=$(echo "$UCB_PS" | grep "\s*$PID " | head -n1 | \
- awk '{ s = ""; for (i = 5; i <= NF; i++) s = s $i " "; print s }')
- # Only use the ucb ps line when it's not empty (process might already been gone) and the
- # ps line is long enough the be potentially stripped.
- if [ -z "$CMD" ] || [ ${#LINE} -lt 100 ]; then
- echo "$LINE"
- else
- echo "${STATS}) ${CMD}"
- fi
-done <<< "$PS"
+if [ -x /usr/ucb/ps ]; then
+ UCB_PS=$(/usr/ucb/ps -agwwwx)
+ PS=$(ps -o user,vsz,rss,pcpu,etime,pid,args $pszone | \
+ sed -e 1d -e 's/ *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) */(\1,\2,\3,\4,\5,\6) /')
+ while read -r LINE; do
+ STATS=${LINE%) *}
+ PID=${STATS##*,}
+
+ CMD=$(echo "$UCB_PS" | grep "^\s*$PID " | head -n1 | \
+ awk '{ s = ""; for (i = 5; i <= NF; i++) s = s $i " "; print s }')
+ # Only use the ucb ps line when it's not empty (process might already been gone) and the
+ # ps line is long enough the be potentially stripped.
+ if [ -z "$CMD" ] || [ ${#LINE} -lt 100 ]; then
+ echo "$LINE"
+ else
+ echo "${STATS}) ${CMD}"
+ fi
+ done <<< "$PS"
+else
+ ps -o user,vsz,rss,pcpu,args $pszone | \
+ sed -e 1d -e 's/ *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) */(\1,\2,\3,\4) /'
+fi
# Statgrab