Module: check_mk
Branch: master
Commit: 81c315699ed21e650a29c35250093c6448b37915
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=81c315699ed21e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 10 10:55:48 2018 +0200
5958 Introduce docker monitoring with Check_MK
With this change we prepare Check_MK for monitoring docker environments out
of the box. These checks work in different layers (node, container).
The docker monitoring is currently available through the linux agent. To get
a docker node monitored it should be enough to simply deploy the agent as
usual on the node. Check_MK will find all relevant checks automatically.
The agent on the node will iterate over all containers and execute the
Check_MK agent in the context of the container. In case there is a agent already
installed in the container, the agent of the container will be used. Otherwise
the node will execute the nodes agent in the context of the container.
In case you need specific agent plugins executed in the container, you can
add them to the container image together with the agent just like you would
do it for regular hosts.
By default the docker container specific parts are transported via piggyback
from the node to the Check_MK server. This means that you will have to create
hosts in your Check_MK use the short container ID as name.
For the docker container hosts please use the following configuration:
<ul>
<li>Set the "IP address family" to "No IP" for only processing the piggyback data.</li>
<li>Set the docker node as parent.</li>
<li>Enable HW/SW inventory for the node and the containers</li>
</ul>
The manual (or scripted) configuration of these hosts will be necessary with
the 1.5. Check_MK 1.6 will solve this problem automatically in a more elegant way.
There are other use cases, for example if you have not access to the node,
then you can also install the agent (including optional config and plugins)
into the image and make the container open a dedicated network port for
agent communication.
We'll add a dedicated docker monitoring page to the documentation in the
near future to describe this in detail.
The following changes have been made for now:
<h3>New check plugins</h3>
<ul>
<li>docker_node_info: Check the status of docker daemon<br>
Whether or not the docker daemon is running and functional on the docker
node.
</li>
<li>docker_node_info.containers: Count number of containers<br>
Counts the number of containers in the different states. Creates metrics
out of these information. Thresholds can be configured on the number of
containers in the different states.
</li>
<li>docker_node_disk_usage: Disk usage of docker files<br>
This check summarizes the disk usage of docker files (images, ...) on
the disks. It tells you whether or not you can safe disk space by
cleaning up things.
</li>
<li>docker_container_cpu: Check the CPU utilization of a docker container<br>
This check reports the percentage CPU utilization of a docker container.
Unlike the Linux CPU utilization check (kernel.util) it does only report
user and system time. More detailed values, like iowait, are not available.
</li>
<li>docker_container_mem: Docker container specific memory checking<br>
Instead of using the default linux memory check (mem), Check_MK is now
using the container specific memory check.
The main reason is that the memory information in the container is not
available through <tt>/proc/meminfo</tt> as usual. The memory data is available
through the kernels cgroup interface which is available in the containers
context below <tt>/sys/fs/cgroup/memory/memory.stat</tt>
The features of both checks are exactly the same.
</li>
<li>docker_container_status: Checks running state of container<br>
The check docker_container_status checks whether a container is running or not.
</li>
<li>docker_container_status.health: Check healthcheck API of containers<br>
Check the status of containers as reported by Docker's healthcheck API.
</li>
<h3>New HW / SW inventory plugins</h3>
<ul>
<li>docker_node_images: Inventorize docker node information<br>
Inventorizes information about repository, tag, ID, creation time, size,
labels and the amount of docker images. It also collect information about
how many containers currently use this image.
</li>
<li>docker_node_info: Inventory plugin displaying docker version<br>
Adds the docker version and node labels to the inventory tree.
</li>
<li>docker_container_labels: Inventorize the labels of container</li>
<li>docker_container_node_name: Inventorize node name of containers</li>
</ul>
Preparing linux agent for docker monitoring
<ul>
<li>The agent now detects whether or not it is being executed
in a docker container context.
</li>
<li>Find docker containers and execute agent in context<br>
In case the agent is running on a docker node, it iterates
all running containers and executes the Check_MK agent in
to context of the container to gather container specific
information.
In case a check_mk_agent is already installed in the
container, then this agent is executed.
In case there is no check_mk_agent installed, the agent
of the docker node is executed in the container.
</li>
</ul>
<h3>Changed checks</h3>
<ul>
<li>lnx_if: Exclude veth* network interfaces on docker nodes<br>
The veth* network interfaces created for docker containers are now
excluded by the linux agent in all cases. The interface names have no
direct match with the docker container name or ID. They seem to have
some kind of random nature.
These container specific interfaces are not relevant to be monitored
on the node. We are monitoring the docker network interfaces in the
container.
</li>
<li>df: Exclude docker local storage mounts on docker nodes<br>
The df check is now excluding all filesystems found below
<tt>/var/lib/docker</tt>, which is the default location for
the docker container local storage.
Depending on the used storage engine docker creates overlay
filesystems and mounts below this hierarchy for the started
containers.
The filesystems are not interesting for our monitoring. They
will be monitored from the container context.
</li>
<li>df mounts: Skip docker mounts for name resolution in container<br>
When docker containers are configured to perform name resolution there are
mounts at <tt>/etc/resolv.conf</tt>, <tt>/etc/hostname</tt> and
<tt>/etc/hosts</tt> which are not relevant to be monitored. These checks are
now always skipped.
</li>
<li>uptime: Is now reported correctly for docker containers<br>
In previous versions of the linux agent the uptime of the
docker node was reported by the agent when it is being executed
in a docker container context.
</li>
<li>Checks disabled in docker container contexts<br>
These checks do not make sense in the context of a docker container.
The agent is now skipping this section when executed in a container.
For some of the checks docker specific ones have been added (see above).
<ul>
<li>kernel</li>
<li>cpu.threads</li>
<li>cpu.load</li>
<li>drbd</li>
<li>lnx_thermal</li>
</ul>
</ul>
Change-Id: Ibfaa59803f464ac3d67edbbf29a72aa214ee7062
---
.werks/5958 | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 204 insertions(+)
diff --git a/.werks/5958 b/.werks/5958
new file mode 100644
index 0000000..ae3e49f
--- /dev/null
+++ b/.werks/5958
@@ -0,0 +1,204 @@
+Title: Introduce docker monitoring with Check_MK
+Level: 2
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1523350439
+Class: feature
+
+With this change we prepare Check_MK for monitoring docker environments out
+of the box. These checks work in different layers (node, container).
+
+The docker monitoring is currently available through the linux agent. To get
+a docker node monitored it should be enough to simply deploy the agent as
+usual on the node. Check_MK will find all relevant checks automatically.
+
+The agent on the node will iterate over all containers and execute the
+Check_MK agent in the context of the container. In case there is a agent already
+installed in the container, the agent of the container will be used. Otherwise
+the node will execute the nodes agent in the context of the container.
+
+In case you need specific agent plugins executed in the container, you can
+add them to the container image together with the agent just like you would
+do it for regular hosts.
+
+By default the docker container specific parts are transported via piggyback
+from the node to the Check_MK server. This means that you will have to create
+hosts in your Check_MK use the short container ID as name.
+
+For the docker container hosts please use the following configuration:
+
+<ul>
+<li>Set the "IP address family" to "No IP" for only processing the piggyback data.</li>
+<li>Set the docker node as parent.</li>
+<li>Enable HW/SW inventory for the node and the containers</li>
+</ul>
+
+The manual (or scripted) configuration of these hosts will be necessary with
+the 1.5. Check_MK 1.6 will solve this problem automatically in a more elegant way.
+
+There are other use cases, for example if you have not access to the node,
+then you can also install the agent (including optional config and plugins)
+into the image and make the container open a dedicated network port for
+agent communication.
+
+We'll add a dedicated docker monitoring page to the documentation in the
+near future to describe this in detail.
+
+The following changes have been made for now:
+
+<h3>New check plugins</h3>
+
+<ul>
+<li>docker_node_info: Check the status of docker daemon<br>
+
+ Whether or not the docker daemon is running and functional on the docker
+ node.
+ </li>
+
+<li>docker_node_info.containers: Count number of containers<br>
+
+ Counts the number of containers in the different states. Creates metrics
+ out of these information. Thresholds can be configured on the number of
+ containers in the different states.
+ </li>
+
+<li>docker_node_disk_usage: Disk usage of docker files<br>
+
+ This check summarizes the disk usage of docker files (images, ...) on
+ the disks. It tells you whether or not you can safe disk space by
+ cleaning up things.
+ </li>
+
+<li>docker_container_cpu: Check the CPU utilization of a docker container<br>
+
+ This check reports the percentage CPU utilization of a docker container.
+ Unlike the Linux CPU utilization check (kernel.util) it does only report
+ user and system time. More detailed values, like iowait, are not available.
+ </li>
+
+<li>docker_container_mem: Docker container specific memory checking<br>
+
+ Instead of using the default linux memory check (mem), Check_MK is now
+ using the container specific memory check.
+
+ The main reason is that the memory information in the container is not
+ available through <tt>/proc/meminfo</tt> as usual. The memory data is available
+ through the kernels cgroup interface which is available in the containers
+ context below <tt>/sys/fs/cgroup/memory/memory.stat</tt>
+
+ The features of both checks are exactly the same.
+ </li>
+
+<li>docker_container_status: Checks running state of container<br>
+
+ The check docker_container_status checks whether a container is running or not.
+ </li>
+
+<li>docker_container_status.health: Check healthcheck API of containers<br>
+
+ Check the status of containers as reported by Docker's healthcheck API.
+ </li>
+</ul>
+
+
+<h3>New HW / SW inventory plugins</h3>
+
+<ul>
+<li>docker_node_images: Inventorize docker node information<br>
+
+ Inventorizes information about repository, tag, ID, creation time, size,
+ labels and the amount of docker images. It also collect information about
+ how many containers currently use this image.
+ </li>
+
+<li>docker_node_info: Inventory plugin displaying docker version<br>
+
+ Adds the docker version and node labels to the inventory tree.
+ </li>
+<li>docker_container_labels: Inventorize the labels of container</li>
+<li>docker_container_node_name: Inventorize node name of containers</li>
+</ul>
+
+
+<h3>Preparing linux agent for docker monitoring</h3>
+
+<ul>
+<li>The agent now detects whether or not it is being executed
+ in a docker container context.
+ </li>
+
+<li>Find docker containers and execute agent in context<br>
+
+ In case the agent is running on a docker node, it iterates
+ all running containers and executes the Check_MK agent in
+ to context of the container to gather container specific
+ information.
+
+ In case a check_mk_agent is already installed in the
+ container, then this agent is executed.
+
+ In case there is no check_mk_agent installed, the agent
+ of the docker node is executed in the container.
+ </li>
+</ul>
+
+<h3>Changed checks</h3>
+
+<ul>
+<li>lnx_if: Exclude veth* network interfaces on docker nodes<br>
+
+ The veth* network interfaces created for docker containers are now
+ excluded by the linux agent in all cases. The interface names have no
+ direct match with the docker container name or ID. They seem to have
+ some kind of random nature.
+
+ These container specific interfaces are not relevant to be monitored
+ on the node. We are monitoring the docker network interfaces in the
+ container.
+ </li>
+
+<li>df: Exclude docker local storage mounts on docker nodes<br>
+
+ The df check is now excluding all filesystems found below
+ <tt>/var/lib/docker</tt>, which is the default location for
+ the docker container local storage.
+
+ Depending on the used storage engine docker creates overlay
+ filesystems and mounts below this hierarchy for the started
+ containers.
+
+ The filesystems are not interesting for our monitoring. They
+ will be monitored from the container context.
+ </li>
+
+<li>df mounts: Skip docker mounts for name resolution in container<br>
+
+ When docker containers are configured to perform name resolution there are
+ mounts at <tt>/etc/resolv.conf</tt>, <tt>/etc/hostname</tt> and
+ <tt>/etc/hosts</tt> which are not relevant to be monitored. These checks are
+ now always skipped.
+ </li>
+
+<li>uptime: Is now reported correctly for docker containers<br>
+
+ In previous versions of the linux agent the uptime of the
+ docker node was reported by the agent when it is being executed
+ in a docker container context.
+ </li>
+
+<li>Checks disabled in docker container contexts<br>
+
+ These checks do not make sense in the context of a docker container.
+ The agent is now skipping this section when executed in a container.
+ For some of the checks docker specific ones have been added (see above).
+
+ <ul>
+ <li>kernel</li>
+ <li>cpu.threads</li>
+ <li>cpu.load</li>
+ <li>drbd</li>
+ <li>lnx_thermal</li>
+ </ul>
+</ul>
Inventorizes labels and node name of docker containers
Message-ID: <5acc716f.SLdC5TDIP+G/UTyB%si(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: c8e4b63706b4133fe29d41df30e61fb0258b21d3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c8e4b63706b413…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Apr 9 17:08:23 2018 +0200
5963 docker_container_labels, docker_container_node_name: Inventorizes labels and node name of docker containers
Change-Id: Ib32f5110c4a5abf31a5bc6df68cd740f458bb931
---
.werks/5963 | 10 +++++++
agents/check_mk_agent.linux | 18 ++++++++----
inventory/docker_container_labels | 37 +++++++++++++++++++++++++
inventory/docker_container_node_name | 37 +++++++++++++++++++++++++
inventory/{docker_images => docker_node_images} | 10 +++----
5 files changed, 102 insertions(+), 10 deletions(-)
diff --git a/.werks/5963 b/.werks/5963
new file mode 100644
index 0000000..805302f
--- /dev/null
+++ b/.werks/5963
@@ -0,0 +1,10 @@
+Title: docker_container_labels, docker_container_node_name: Inventorizes labels and node name of docker containers
+Level: 1
+Component: inv
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1523285922
+Class: feature
+
+
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 4a3bf27..43e5d70 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -962,13 +962,15 @@ fi
# Iterate all running containers and report piggyback data for them
if type docker > /dev/null 2>&1 ; then
+ NODE_NAME=$(docker info --format "{{json .Name}}")
+
echo "<<<docker_node_info>>>"
docker info --format "{{json .}}" 2>&1
echo "<<<docker_system_df:sep(44)>>>"
docker system df --format "{{json .}}" 2>&1
- echo "<<<docker_images>>>"
+ echo "<<<docker_node_images>>>"
echo "[[[images]]]"
docker images --all --format "{{json .}}"
for image in $(docker images --all --format "{{.Repository}}");
@@ -981,10 +983,16 @@ if type docker > /dev/null 2>&1 ; then
# For the container status, we want information about *all* containers
for CONTAINER_ID in $(docker container ls -q --all); do
- echo "<<<<$CONTAINER_ID>>>>"
- echo "<<<docker_container_status>>>"
- docker inspect $CONTAINER_ID --format='{{json .State}}'
- echo "<<<<>>>>"
+ echo "<<<<$CONTAINER_ID>>>>"
+ echo "<<<docker_container_status>>>"
+ docker inspect $CONTAINER_ID --format='{{json .State}}'
+
+ echo "<<<docker_container_node_name>>>"
+ echo $NODE_NAME
+
+ echo "<<<docker_container_labels>>>"
+ docker inspect $CONTAINER_ID --format='{{json .Config.Labels}}'
+ echo "<<<<>>>>"
done
for CONTAINER_ID in $(docker container ls -q); do
diff --git a/inventory/docker_container_labels b/inventory/docker_container_labels
new file mode 100644
index 0000000..1469423
--- /dev/null
+++ b/inventory/docker_container_labels
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2018 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.
+
+
+def inv_docker_container_labels(info, inventory_tree):
+ import json
+ data = json.loads(" ".join(info[0]))
+ container_labels = inventory_tree.get_dict("software.applications.docker.container.")
+ container_labels["labels"] = ", ".join(["%s: %s" % (k,v) for k,v in data.items()])
+
+
+inv_info['docker_container_labels'] = {
+ 'inv_function': inv_docker_container_labels,
+}
diff --git a/inventory/docker_container_node_name b/inventory/docker_container_node_name
new file mode 100644
index 0000000..38301c6
--- /dev/null
+++ b/inventory/docker_container_node_name
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2018 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.
+
+
+def inv_docker_container_node_name(info, inventory_tree):
+ import json
+ data = json.loads(info[0][0])
+ container = inventory_tree.get_dict("software.applications.docker.container.")
+ container["node_name"] = data
+
+
+inv_info['docker_container_node_name'] = {
+ 'inv_function': inv_docker_container_node_name,
+}
diff --git a/inventory/docker_images b/inventory/docker_node_images
similarity index 93%
rename from inventory/docker_images
rename to inventory/docker_node_images
index d6ab2a4..21da417 100644
--- a/inventory/docker_images
+++ b/inventory/docker_node_images
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
-def _parse_docker_images(info):
+def _parse_docker_node_images(info):
import json
parsed = {}
section_name = None
@@ -52,8 +52,8 @@ def _parse_docker_images(info):
return parsed
-def inv_docker_images(info, inventory_tree, status_data_tree):
- parsed = _parse_docker_images(info)
+def inv_docker_node_images(info, inventory_tree, status_data_tree):
+ parsed = _parse_docker_node_images(info)
path = "software.applications.docker.images:"
inv_node = inventory_tree.get_list(path)
status_node = status_data_tree.get_list(path)
@@ -79,7 +79,7 @@ def inv_docker_images(info, inventory_tree, status_data_tree):
})
-inv_info['docker_images'] = {
- 'inv_function' : inv_docker_images,
+inv_info['docker_node_images'] = {
+ 'inv_function' : inv_docker_node_images,
'has_status_data' : True,
}
Module: check_mk
Branch: master
Commit: c985c37379b864ad503e519744cd3daabe3c3f01
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c985c37379b864…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Apr 9 15:02:28 2018 +0200
5833 FIX Fixed handling of 'acknowledged' parameter of the EC's UPDATE command
Previously, the 'acknowledged' parameter of the EC's UPDATE command was
processed after the event was already (partially) updated. When the
'acknowledged' parameter was missing or not an integer, this behavior was
confusing and could e.g. lead to missing history entries.
Now all parameters are checked before the event is modified, so no partial
updates happen. Furthermore, the 'acknowledged' parameter is optional now,
restoring the previous accidental behavior in a clean way.
Change-Id: I29e44d2c54b6b01ceaad8415c5012b5206cbc50d
---
.werks/5833 | 17 +++++++++++++++++
cmk/ec/main.py | 9 ++++++---
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.werks/5833 b/.werks/5833
new file mode 100644
index 0000000..1e65f88
--- /dev/null
+++ b/.werks/5833
@@ -0,0 +1,17 @@
+Title: Fixed handling of 'acknowledged' parameter of the EC's UPDATE command
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1523278661
+Class: fix
+
+Previously, the 'acknowledged' parameter of the EC's UPDATE command was
+processed after the event was already (partially) updated. When the
+'acknowledged' parameter was missing or not an integer, this behavior was
+confusing and could e.g. lead to missing history entries.
+
+Now all parameters are checked before the event is modified, so no partial
+updates happen. Furthermore, the 'acknowledged' parameter is optional now,
+restoring the previous accidental behavior in a clean way.
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index ed7ac4f..b5c4647 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -3756,13 +3756,16 @@ class StatusServer(ECServerThread):
event = self._event_status.event(int(event_id))
if not event:
raise MKClientError("No event with id %s" % event_id)
+ # Note the common practice: We validate parameters *before* doing any changes.
+ if acknowledged:
+ ack = int(acknowledged)
+ if ack and event["phase"] not in ["open", "ack"]:
+ raise MKClientError("You cannot acknowledge an event that is not open.")
+ event["phase"] = "ack" if ack else "open"
if comment:
event["comment"] = comment
if contact:
event["contact"] = contact
- if int(acknowledged) and event["phase"] not in ["open", "ack"]:
- raise MKClientError("You cannot acknowledge an event that is not open.")
- event["phase"] = int(acknowledged) and "ack" or "open"
log_event_history(self.settings, self._config, self._table_events, event, "UPDATE", user)
def handle_command_create(self, arguments):
Module: check_mk
Branch: master
Commit: 97a31ffbd8a5188df11617f8755e1df532808fc6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=97a31ffbd8a518…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Apr 9 14:34:47 2018 +0200
5832 Render snmpTrapAddress in a human-readable form even without SNMP trap translation
If SNMP trap translation was disabled, the originating IP address of a trap
appeared as a funny byte blob in EC messages. This has been fixed, the
usual dotted notation is used now.
Change-Id: I0ce011d15a0a42dee7ec1ff0a4be924e3e216947
---
.werks/5832 | 12 ++++++++++++
cmk/ec/main.py | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/5832 b/.werks/5832
new file mode 100644
index 0000000..2d54c76
--- /dev/null
+++ b/.werks/5832
@@ -0,0 +1,12 @@
+Title: Render snmpTrapAddress in a human-readable form even without SNMP trap translation
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1523277096
+Class: feature
+
+If SNMP trap translation was disabled, the originating IP address of a trap
+appeared as a funny byte blob in EC messages. This has been fixed, the
+usual dotted notation is used now.
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 9f889fe..ed7ac4f 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -1489,8 +1489,8 @@ class EventServer(ECServerThread):
for oid, value in var_bind_list:
key = str(oid)
- if value.__class__.__name__ == 'ObjectIdentifier':
- val = str(value)
+ if value.__class__.__name__ in ['ObjectIdentifier', 'IpAddress']:
+ val = value.prettyPrint()
elif value.__class__.__name__ == 'TimeTicks':
val = self.fmt_timeticks(value._value)
else: