Module: check_mk
Branch: master
Commit: 972c7be42335b1e225a98f08713fe777c4bfc47e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=972c7be42335b1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Sep 10 15:02:14 2018 +0200
6493 FIX netscaler_vserver: Discovers readable names
The OID .1.3.6.1.4.1.5951.4.1.3.1.1.1 (vsvrName) is used
for the server names. At a certain length the names are
cryptic and therefore unreadable.
In order to get readable names we preferable use the OID
.1.3.6.1.4.1.5951.4.1.3.1.1.59 (vsvrFullName).
After a rediscovery the full server names will be used.
In general the server names and full server names are
equal below a certain length.
Change-Id: I2bda98fd02c4c6992812610bcd589329351a575f
---
.werks/6493 | 19 +++++++++++++++++++
checks/netscaler_vserver | 14 ++++++++++----
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/.werks/6493 b/.werks/6493
new file mode 100644
index 0000000..c55e96c
--- /dev/null
+++ b/.werks/6493
@@ -0,0 +1,19 @@
+Title: netscaler_vserver: Discovers readable names
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1536583837
+Class: fix
+
+The OID .1.3.6.1.4.1.5951.4.1.3.1.1.1 (vsvrName) is used
+for the server names. At a certain length the names are
+cryptic and therefore unreadable.
+
+In order to get readable names we preferable use the OID
+.1.3.6.1.4.1.5951.4.1.3.1.1.59 (vsvrFullName).
+
+After a rediscovery the full server names will be used.
+In general the server names and full server names are
+equal below a certain length.
diff --git a/checks/netscaler_vserver b/checks/netscaler_vserver
index 47c6c57..7afacf7 100644
--- a/checks/netscaler_vserver
+++ b/checks/netscaler_vserver
@@ -85,8 +85,13 @@ factory_settings["netscaler_vserver_default_levels"] = {
def inventory_netscaler_vserver(info):
for line in info:
- if line[0]:
- yield line[0], {}
+ full_server_name = line[10]
+ if full_server_name:
+ server_name = full_server_name
+ else:
+ server_name = line[0]
+ if server_name:
+ yield server_name, {}
def check_netscaler_vserver(item, params, info):
@@ -95,8 +100,8 @@ def check_netscaler_vserver(item, params, info):
for name, ip, port, svr_type, svr_state, \
svr_health, svr_entitytype, request_rate, \
- rx_bytes, tx_bytes in info:
- if name == item:
+ rx_bytes, tx_bytes, full_name in info:
+ if item in [name, full_name]:
svr_state, svr_state_readable = \
netscaler_vserver_states.get(svr_state, ("unknown", 1))
yield svr_state, "Status: %s" % svr_state_readable
@@ -149,6 +154,7 @@ check_info["netscaler_vserver"] = {
43, # NS-ROOT-MIB::vsvrRequestRate
44, # NS-ROOT-MIB::vsvrRxBytesRate
45, # NS-ROOT-MIB::vsvrTxBytesRate
+ 59, # vsvrFullName
]),
"has_perfdata" : True,
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),