Module: check_mk
Branch: master
Commit: b3433b371a1de2d40d9c2a54a7414ba6c46d4f55
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3433b371a1de2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 19 19:56:46 2018 +0200
6021 FIX Combined graphs: Fixed handling of optional metrics
When trying to render combined graphs with graph templates that have optional
metrics, these graphs could not be rendered. For example the "CPU utilization"
graphs of some devices could not be displayed in combined graphs.
Change-Id: I3f4e507fcba40da8955834c8808d2ecdbb67d4ae
---
.werks/6021 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.werks/6021 b/.werks/6021
new file mode 100644
index 0000000..daaf1f0
--- /dev/null
+++ b/.werks/6021
@@ -0,0 +1,13 @@
+Title: Combined graphs: Fixed handling of optional metrics
+Level: 1
+Component: metrics
+Class: fix
+Compatible: compat
+Edition: cee
+State: unknown
+Version: 1.6.0i1
+Date: 1524160513
+
+When trying to render combined graphs with graph templates that have optional
+metrics, these graphs could not be rendered. For example the "CPU utilization"
+graphs of some devices could not be displayed in combined graphs.
Module: check_mk
Branch: master
Commit: 679c379ad4dbd0a2240979ab5714a49759dea2c2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=679c379ad4dbd0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 19 19:30:53 2018 +0200
6020 FIX View permitted group selection: Increased size of select fields
The contact group selection fields have now a better initial size
and are also resizable which may be useful in case you have very
long group names.
Change-Id: Ibc404e0ecf5a4037d8be200edb62aacbeac836ed
---
.werks/6020 | 13 +++++++++++++
web/htdocs/check_mk.css | 1 +
web/htdocs/visuals.py | 2 +-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/6020 b/.werks/6020
new file mode 100644
index 0000000..8fc5344
--- /dev/null
+++ b/.werks/6020
@@ -0,0 +1,13 @@
+Title: View permitted group selection: Increased size of select fields
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1524158989
+
+The contact group selection fields have now a better initial size
+and are also resizable which may be useful in case you have very
+long group names.
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 16b2818..2acc3b3 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -623,6 +623,7 @@ table.vs_duallist td {
table.vs_duallist td select {
width: 100%;
height: 200px;
+ resize: both;
}
table.vs_duallist td.head {
text-align:center;
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 31a6485..50b7fa0 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -911,7 +911,7 @@ class PublishTo(CascadingDropdown):
with_foreign_groups=with_foreign_groups,
title = _("Publish to members of contact groups"),
rows = 5,
- size = 40,
+ size = 80,
)),
],
title = _('Make this %s available for other users') % type_title,
Module: check_mk
Branch: master
Commit: 5130a060a82f7147994fe2dd4748b4a4cba13cdd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5130a060a82f71…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Apr 6 16:54:42 2018 +0200
docker_container_mem: Skeleton for a check, include information about total memory in agent section
Change-Id: I8278f981a834e40293c74abf7c28f0c20313babd
---
agents/check_mk_agent.linux | 6 +-
checks/docker_container_mem | 134 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 139 insertions(+), 1 deletion(-)
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index a3f5b04..44a215a 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -114,7 +114,11 @@ function section_mem()
grep -E -v '^Swap:|^Mem:|total:' < /proc/meminfo
else
echo '<<<docker_container_mem>>>'
- cat /sys/fs/cgroup/memory/memory.stat
+ echo -n "usage_in_bytes "
+ cat /sys/fs/cgroup/memory/memory.usage_in_bytes
+ echo -n "limit_in_bytes "
+ cat /sys/fs/cgroup/memory/memory.limit_in_bytes
+ grep -F 'MemTotal:' /proc/meminfo
fi
}
diff --git a/checks/docker_container_mem b/checks/docker_container_mem
new file mode 100644
index 0000000..eb630ff
--- /dev/null
+++ b/checks/docker_container_mem
@@ -0,0 +1,134 @@
+#!/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.
+
+# cur[cgroup.name]['memory.usage_in_bytes'] = cgroup['memory.usage_in_bytes']
+# cache = cgroup['memory.stat']['cache']
+# cur[cgroup.name]['memory.usage_in_bytes'] = cgroup['memory.usage_in_bytes'] - cache
+# cur[cgroup.name]['memory.limit_in_bytes'] = min(int(cgroup['memory.limit_in_bytes']), measures['global']['total_memory'])
+
+
+# Example:
+#
+# <<<docker_container_mem>>>
+# cache 57294848 -> Cached
+# rss 43728896
+# rss_huge 27262976
+# shmem 13275136
+# mapped_file 32395264
+# dirty 0
+# writeback 0
+# pgpgin 2270817
+# pgpgout 2252796
+# pgfault 4699689
+# pgmajfault 466
+# inactive_anon 13275136
+# active_anon 43556864
+# inactive_file 22306816
+# active_file 21712896
+# unevictable 0
+# hierarchical_memory_limit 9223372036854771712
+# MemTotal: 16299300 kB
+
+# cache -> page cache, including tmpfs (shmem), in bytes
+# rss -> anonymous and swap cache, not including tmpfs (shmem), in bytes
+# mapped_file -> size of memory-mapped mapped files, including tmpfs (shmem), in bytes
+# -> 'rss + mapped_file" will give you resident set size of cgroup.
+# -> mapped_file - # of bytes of mapped file (includes tmpfs/shmem)
+# swap -> swap usage, in bytes
+
+# When you interpret the values reported by memory.stat, note how the various statistics inter-relate:
+#
+# active_anon + inactive_anon = anonymous memory + file cache for tmpfs + swap cache
+# Therefore, active_anon + inactive_anon ≠ rss, because rss does not include tmpfs.
+# active_file + inactive_file = cache - size of tmpfs
+
+# 5.2 stat file
+#
+# memory.stat file includes following statistics
+#
+# # per-memory cgroup local status
+# cache - # of bytes of page cache memory.
+# rss - # of bytes of anonymous and swap cache memory (includes
+# transparent hugepages).
+# rss_huge - # of bytes of anonymous transparent hugepages.
+# mapped_file - # of bytes of mapped file (includes tmpfs/shmem)
+# swap - # of bytes of swap usage
+
+# dirty - # of bytes that are waiting to get written back to the disk.
+# writeback - # of bytes of file/anon cache that are queued for syncing to
+# disk.
+
+# inactive_anon - # of bytes of anonymous and swap cache memory on inactive
+# LRU list.
+# active_anon - # of bytes of anonymous and swap cache memory on active
+# LRU list.
+
+# inactive_file - # of bytes of file-backed memory on inactive LRU list.
+# active_file - # of bytes of file-backed memory on active LRU list.
+
+# hierarchical_memory_limit - # of bytes of memory limit with regard to hierarchy
+# under which the memory cgroup is
+# hierarchical_memsw_limit - # of bytes of memory+swap limit with regard to
+# hierarchy under which memory cgroup is.
+
+# Note:
+# Only anonymous and swap cache memory is listed as part of 'rss' stat.
+# This should not be confused with the true 'resident set size' or the
+# amount of physical memory used by the cgroup.
+# 'rss + mapped_file" will give you resident set size of cgroup.
+# (Note: file and shmem may be shared among other cgroups. In that case,
+# mapped_file is accounted only when the memory cgroup is owner of page
+# cache.)
+
+
+
+def parse_docker_container_mem(info):
+ parsed = {}
+ for line in info:
+ if line[0] == "MemTotal:":
+ if line[2] == "kB":
+ parsed["system_mem_total"] = int(line[1]) * 1024
+ #TODO: Other cases?
+ else:
+ parsed[line[0]] = int(line[1])
+ return parsed
+
+
+def inventory_docker_container_mem(parsed):
+ pprint.pprint(parsed)
+ return [(None, None)]
+
+
+def check_docker_container_mem(_no_item, params, parsed):
+ return 3, 'not yet implemented'
+
+
+check_info['docker_container_mem'] = {
+ 'parse_function' : parse_docker_container_mem,
+ 'inventory_function' : inventory_docker_container_mem,
+ 'check_function' : check_docker_container_mem,
+ 'service_description' : 'Memory',
+}