[checkmk-commits] Check_MK Git: check_mk: #1938 FIX docsis_channels_upstream:

Andreas Boesl ab at mathias-kettner.de
Fri Feb 6 16:59:23 CET 2015


  fixed missing checks if channels had the same ChannelId
Message-ID: <54d4e4db.2tO1/8/zgGeV+5Ll%ab at 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: 189ced6446cac685ee4974f5408ba30e11350a27
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=189ced6446cac685ee4974f5408ba30e11350a27

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Fri Feb  6 16:58:07 2015 +0100

#1938 FIX docsis_channels_upstream: fixed missing checks if channels had the same ChannelId

DOCSIS services used only the ChannelId as item name.
<ul>
<li>Upstream Channel 1</li>
<li>Upstream Channel 2</li>
<li>Upstream Channel 3</li>
</ul>

There are instances were this ChannelId is not unique, which causes the check
to loose some services. With this update the docsis_channels_upstream check now
uses an additional parameter - the interface index - to make this service name unique.

<ul>
<li>Upstream Channel 1337.1</li>
<li>Upstream Channel 1338.2</li>
<li>Upstream Channel 1343.3</li>
<li>Upstream Channel 1363.1</li>
<li>Upstream Channel 1373.2</li>
<li>Upstream Channel 1393.3</li>
</ul>

<b>Note:</b> This extended item name is only used if it is requires, means if there
are duplicate ChannelId entries for this device.

---

 .werks/1938                     |   31 +++++++++++++++++++++++++++++++
 ChangeLog                       |    1 +
 checks/docsis_channels_upstream |    4 +++-
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/.werks/1938 b/.werks/1938
new file mode 100644
index 0000000..0101891
--- /dev/null
+++ b/.werks/1938
@@ -0,0 +1,31 @@
+Title: docsis_channels_upstream: fixed missing checks if channels had the same ChannelId
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1423237560
+
+DOCSIS services used only the ChannelId as item name.
+<ul>
+<li>Upstream Channel 1</li>
+<li>Upstream Channel 2</li>
+<li>Upstream Channel 3</li>
+</ul>
+
+There are instances were this ChannelId is not unique, which causes the check
+to loose some services. With this update the docsis_channels_upstream check now
+uses an additional parameter - the interface index - to make this service name unique.
+
+<ul>
+<li>Upstream Channel 1337.1</li>
+<li>Upstream Channel 1338.2</li>
+<li>Upstream Channel 1343.3</li>
+<li>Upstream Channel 1363.1</li>
+<li>Upstream Channel 1373.2</li>
+<li>Upstream Channel 1393.3</li>
+</ul>
+
+<b>Note:</b> This extended item name is only used if it is requires, means if there
+are duplicate ChannelId entries for this device.
diff --git a/ChangeLog b/ChangeLog
index 9147bfa..1cb4ecc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -148,6 +148,7 @@
     * 1936 FIX: check_form_submit: fixed crash on certain form fields with unnamed input elements
     * 1960 FIX: akcp_sensor_drycontact: Service description prefix changed from "Device" to "Dry Contact"...
             NOTE: Please refer to the migration notes!
+    * 1938 FIX: docsis_channels_upstream: fixed missing checks if channels had the same ChannelId...
 
     Multisite:
     * 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/docsis_channels_upstream b/checks/docsis_channels_upstream
index f93350f..6b9ce5e 100644
--- a/checks/docsis_channels_upstream
+++ b/checks/docsis_channels_upstream
@@ -41,9 +41,11 @@ def docsis_channels_upstream_convert(info):
     else:
         sig_info_dict = dict([ (x[0], x[1:]) for x in sig_info])
         cm_info_dict  = dict([ (x[0], x[1:]) for x in cm_info])
+        # If the channel id is not unique we also use the OID_END in the item name
+        is_unique = len(freq_info) == len(set(map(lambda x: x[1], freq_info)))
         for line in freq_info:
             endoid = line[0]
-            cid = line[1]
+            cid = is_unique and line[1] or "%s.%s" % (line[0], line[1])
             if line[2] != '0':
                 parsed[cid] = line[1:] + sig_info_dict[endoid] + cm_info_dict.get(endoid, [])
 



More information about the checkmk-commits mailing list