Module: check_mk
Branch: master
Commit: 845223e6a1463c7cdcdf7314f32276f79c97df73
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=845223e6a1463c…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Fri Jan 20 20:42:04 2017 +0100
4188 snmp_extended_info: Now capable to inventorize cisco backplane chassis
The inventory is now capable to inventorize chassis information in the same
way as other backplane components information is already used.
Change-Id: I45d34e48e1c0a9d698ef1dcf961910bb416fbe7b
---
.werks/4188 | 11 +++++++++++
ChangeLog | 1 +
inventory/snmp_extended_info | 28 ++++++++++++++--------------
web/plugins/views/inventory.py | 10 ++++++++++
4 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/.werks/4188 b/.werks/4188
new file mode 100644
index 0000000..a4d61cd
--- /dev/null
+++ b/.werks/4188
@@ -0,0 +1,11 @@
+Title: snmp_extended_info: Now capable to inventorize cisco backplane chassis
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.4.0i4
+Date: 1484941164
+Class: feature
+
+The inventory is now capable to inventorize chassis information in the same
+way as other backplane components information is already used.
+
diff --git a/ChangeLog b/ChangeLog
index 87b0c5e..5e5867f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -138,6 +138,7 @@
* 4314 FIX: Quick event delete icon works with checkboxes enabled now
HW/SW-Inventory:
+ * 4188 snmp_extended_info: Now capable to inventorize cisco backplane chassis...
* 4258 FIX: snmp_extended_info: fixed undefined variable
diff --git a/inventory/snmp_extended_info b/inventory/snmp_extended_info
index cd98e9a..222cc6b 100644
--- a/inventory/snmp_extended_info
+++ b/inventory/snmp_extended_info
@@ -35,17 +35,17 @@
def inv_snmp_extended_info(info):
map_type = {
- "1" : "Other",
- "2" : "Unknown",
- "3" : "Chassis",
- "4" : "Backplane",
- "5" : "Container",
- "6" : "PSU",
- "7" : "Fan",
- "8" : "Sensor",
- "9" : "Module",
- "10" : "Port",
- "11" : "Stack",
+ "1" : ( "Other", "others" ),
+ "2" : ( "Unknown", "unknowns" ),
+ "3" : ( "Chassis", "chassis" ),
+ "4" : ( "Backplane", "backplanes" ),
+ "5" : ( "Container", "containers" ),
+ "6" : ( "PSU", "psus" ),
+ "7" : ( "Fan", "fans" ),
+ "8" : ( "Sensor", "sensors" ),
+ "9" : ( "Module", "modules" ),
+ "10" : ( "Port", "ports" ),
+ "11" : ( "Stack", "stacks" ),
}
parsed = {}
@@ -61,12 +61,12 @@ def inv_snmp_extended_info(info):
if model:
node["model"] = model
# backplanes, psus, fans, sensors, modules
- elif entity_type in ["4", "6", "7", "8",
"9"]:
+ elif entity_type in ["3", "4", "6", "7",
"8", "9"]:
if parsed.get(parent):
- location_info = (map_type[parsed[parent][2]], parent)
+ location_info = (map_type[parsed[parent][2]][0], parent)
else:
location_info = ("Missing in ENTITY table", parent)
- node = inv_tree_list("hardware.components.%ss:" %
(map_type[entity_type]).lower())
+ node = inv_tree_list("hardware.components.%s:" %
(map_type[entity_type][1]))
node.append({
"index" : index,
"name" : name,
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index 295fdb6..060a0aa 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -620,6 +620,16 @@ inventory_displayhints.update({
".hardware.system.manufacturer" : { "title" :
_("Manufacturer") },
".hardware.components." : { "title" :
_("Physical Components") },
+ ".hardware.components.chassis:" : { "title" :
_("Chassis"), "render" : render_inv_dicttable,
+ "keyorder" : [
"index", "name", "description", "serial",
"model", "location" ],
+ "view" :
"invchassis_of_host" },
+ ".hardware.components.chassis:*.index" : { "title" :
_("Index") },
+ ".hardware.components.chassis:*.name" : { "title" :
_("Name") },
+ ".hardware.components.chassis:*.description" : { "title" :
_("Description") },
+ ".hardware.components.chassis:*.serial" : { "title" :
_("Serial Number") },
+ ".hardware.components.chassis:*.model" : { "title" :
_("Model Name") },
+ ".hardware.components.chassis:*.location" : { "title" :
_("Location") },
+
".hardware.components.backplanes:" : { "title" :
_("Backplanes"), "render" : render_inv_dicttable,
"keyorder" : [
"index", "name", "description", "serial",
"model", "location" ],
"view" :
"invbackplane_of_host" },