Module: check_mk
Branch: master
Commit: 79d6e6392b8e77b3145da951375a00b11657d9a5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=79d6e6392b8e77…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 30 14:46:23 2018 +0200
Add docker icon for HW/SW inventory data
Change-Id: I5227cc4ae5087fec9f03cb7754d331fac8a1c248
---
web/htdocs/images/icon_docker.png | Bin 0 -> 1676 bytes
web/plugins/views/inventory.py | 23 ++++++++++++++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/images/icon_docker.png b/web/htdocs/images/icon_docker.png
new file mode 100644
index 0000000..e432b56
Binary files /dev/null and b/web/htdocs/images/icon_docker.png differ
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index add9516..b7dd386 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -690,6 +690,19 @@ inventory_displayhints.update({
},
".software.applications.check_mk.cluster.nodes:" : {
"title" : _("Nodes"),},
+ ".software.applications.docker.": {
+ "icon": "docker",
+ "title": "Docker",
+ },
+
+ ".software.applications.docker.images:": {
+ "title" : _("Images"),
+ "keyorder": ["repository", "tag", "id",
"creation", "size", "labels",
"amount_containers"],
+ },
+ ".software.applications.docker.images:*.id" : { "title" :
_("ID"), },
+ ".software.applications.docker.images:*.amount_containers" : {
"title" : _("# Containers"), },
+
+
".software.applications.docker.container.": {
"title" : _("Container"),
},
@@ -805,13 +818,6 @@ inventory_displayhints.update({
},
".software.applications.mssql.instances:*.clustered" : { "title"
: _("Clustered"), "paint" : "mssql_is_clustered"},
- ".software.applications.docker." : { "title" :
_("Docker") },
- ".software.applications.docker.images:" : { "title" :
_("Images"),
- "keyorder":
["repository", "tag", "id", "creation",
"size", "labels", "amount_containers"],
- },
- ".software.applications.docker.images:*.id" : { "title" :
_("ID"), },
- ".software.applications.docker.images:*.amount_containers" : {
"title" : _("# Containers"), },
-
".networking." : { "title" :
_("Networking"), "icon" : "networking" },
".networking.total_interfaces" : { "title" :
_("Interfaces"), "paint" : "count", },
".networking.total_ethernet_ports" : { "title" :
_("Ports"), "paint" : "count", },
@@ -1492,11 +1498,14 @@ class NodeRenderer(object):
part = "%s:%d" % (last, part)
finally:
_titleinfo.append(part)
+
titleinfo_path = ".%s." % ".".join(_titleinfo)
icon, title = inv_titleinfo(titleinfo_path, node)
+
if "%d" in title: # Replace with list index
list_index =
int(titleinfo_path.split(":")[-1].rstrip(".")) + 1
title = title % list_index
+
# Some displayhints may end with ":", eg.
".software.packages:"
if "%s:" % titleinfo_path[:-1] in inventory_displayhints:
icon, title = inv_titleinfo("%s:" % titleinfo_path[:-1], node)