From 1a8b1e0586b546124795e178dcc52c32f1905186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Wed, 27 May 2020 22:17:26 +0200 Subject: [PATCH 1/8] Add missing tags to profiles tables Some tables were missing tags, this won't work when tables have multiple rows. --- .../snmp/data/profiles/_base_cisco.yaml | 7 ++- .../snmp/data/profiles/_base_cisco_voice.yaml | 46 +++++++++++++++---- .../snmp/data/profiles/apc_ups.yaml | 8 ++-- .../snmp/data/profiles/cisco-csr1000v.yaml | 2 +- .../snmp/data/profiles/isilon.yaml | 2 +- .../snmp/data/profiles/palo-alto.yaml | 9 +++- snmp/metadata.csv | 1 - 7 files changed, 56 insertions(+), 19 deletions(-) diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco.yaml index c72ee41d494b0..6850ad471bc6f 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco.yaml @@ -87,6 +87,11 @@ metrics: symbols: - OID: 1.3.6.1.4.1.9.9.13.1.4.1.3 name: ciscoEnvMonFanState + metric_tags: + - column: + OID: 1.3.6.1.4.1.9.9.13.1.4.1.1 + name: ciscoEnvMonFanStatusIndex + tag: fan_status_index # stackport specific info - every physical stackport has an entry in ifTable - MIB: CISCO-STACKWISE-MIB @@ -186,7 +191,7 @@ metrics: - OID: 1.3.6.1.4.1.9.9.388.1.2.2.1.3 name: cvsChassisUpTime metric_tags: - - column: + - column: OID: 1.3.6.1.4.1.9.9.388.1.2.2.1.1 name: cvsChassisSwitchID tag: chassis_switch_id diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml index 8821a4f4328bf..59aee48964ed7 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml @@ -17,14 +17,11 @@ metrics: OID: 1.3.6.1.2.1.25.4.2.1.7 table: hrSWRunTable tag: status - - - MIB: HOST-RESOURCES-MIB - table: - name: hrSWRunTable - OID: 1.3.6.1.2.1.25.4.2 - symbols: - - name: hrSWRunStatus - OID: 1.3.6.1.2.1.25.4.2.1.7 + - column: + name: hrSWRunIndex + OID: 1.3.6.1.2.1.25.4.2.1.1 + table: hrSWRunTable + tag: run_index - MIB: CISCO-CVP-MIB table: @@ -43,6 +40,12 @@ metrics: OID: 1.3.6.1.4.1.9.9.590.1.6.1.1.1 - name: ccvpSipRtTotalCallLegs OID: 1.3.6.1.4.1.9.9.590.1.6.1.1.2 + metric_tags: + - column: + name: ccvpServiceIndex + OID: 1.3.6.1.4.1.9.9.590.1.5.1.1.1 + table: ccvpServiceTable + tag: service_index - MIB: CISCO-CVP-MIB symbol: @@ -79,6 +82,12 @@ metrics: OID: 1.3.6.1.4.1.9.9.63.1.3.8.5.1.1 - name: cvCallVolMediaOutgoingCalls OID: 1.3.6.1.4.1.9.9.63.1.3.8.5.1.2 + metric_tags: + - column: + OID: 1.3.6.1.2.1.31.1.1.1.1 + name: ifName + table: ifXTable + tag: interface - MIB: CISCO-VOICE-DIAL-CONTROL-MIB table: @@ -89,6 +98,12 @@ metrics: OID: 1.3.6.1.4.1.9.9.63.1.3.8.4.1.1 - name: cvCallVolPeerOutgoingCalls OID: 1.3.6.1.4.1.9.9.63.1.3.8.4.1.2 + metric_tags: + - column: + OID: 1.3.6.1.4.1.9.9.63.1.2.1.1.1 + name: cvPeerCfgIndex + table: cvPeerCfgTable + tag: peer_index - MIB: DIAL-CONTROL-MIB forced_type: monotonic_count @@ -104,7 +119,12 @@ metrics: OID: 1.3.6.1.2.1.10.21.1.2.2.1.6 - name: dialCtlPeerStatsSuccessCalls OID: 1.3.6.1.2.1.10.21.1.2.2.1.3 - + metric_tags: + - column: + OID: 1.3.6.1.2.1.31.1.1.1.1 + name: ifName + table: ifXTable + tag: interface - MIB: CISCO-CONTACT-CENTER-APPS-MIB table: @@ -131,10 +151,16 @@ metrics: table: name: cccaRouterTable OID: 1.3.6.1.4.1.9.9.473.1.3.1 - symbols: + symbols: - name: cccaRouterAgentsLoggedOn OID: 1.3.6.1.4.1.9.9.473.1.3.1.1.3 - name: cccaRouterCallsInProgress OID: 1.3.6.1.4.1.9.9.473.1.3.1.1.4 - name: cccaRouterCallsInQueue OID: 1.3.6.1.4.1.9.9.473.1.3.1.1.8 + metric_tags: + - column: + OID: 1.3.6.1.4.1.9.9.473.1.2.1.1.1 + name: cccaInstanceNumber + table: cccaInstanceTable + tag: instance_number diff --git a/snmp/datadog_checks/snmp/data/profiles/apc_ups.yaml b/snmp/datadog_checks/snmp/data/profiles/apc_ups.yaml index c417ddf3b19db..5609a8f3b8554 100644 --- a/snmp/datadog_checks/snmp/data/profiles/apc_ups.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/apc_ups.yaml @@ -55,15 +55,15 @@ metrics: OID: 1.3.6.1.4.1.318.1.1.1.7.2.3 name: upsAdvTestDiagnosticsResults - MIB: PowerNet-MIB - table: + table: OID: 1.3.6.1.4.1.318.1.1.1.12.1.2 name: upsOutletGroupStatusTable - symbols: + symbols: - OID: 1.3.6.1.4.1.318.1.1.1.12.1.2.1.3 name: upsOutletGroupStatusGroupState - metric_tags: + metric_tags: - tag: outlet_group_name - column: + column: OID: 1.3.6.1.4.1.318.1.1.1.12.1.2.1.2 name: upsOutletGroupStatusName diff --git a/snmp/datadog_checks/snmp/data/profiles/cisco-csr1000v.yaml b/snmp/datadog_checks/snmp/data/profiles/cisco-csr1000v.yaml index 9b5e936d6f8e5..220fa5b22ef35 100644 --- a/snmp/datadog_checks/snmp/data/profiles/cisco-csr1000v.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/cisco-csr1000v.yaml @@ -1,5 +1,5 @@ extends: - _base_cisco.yaml - _generic-router-ip.yaml - + sysobjectid: 1.3.6.1.4.1.9.1.1537 diff --git a/snmp/datadog_checks/snmp/data/profiles/isilon.yaml b/snmp/datadog_checks/snmp/data/profiles/isilon.yaml index de4c784516c3f..fd4ad088a2100 100644 --- a/snmp/datadog_checks/snmp/data/profiles/isilon.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/isilon.yaml @@ -31,7 +31,7 @@ metrics: OID: 1.3.6.1.4.1.12124.1.1.2 name: clusterHealth - MIB: ISILON-MIB - symbol: + symbol: OID: 1.3.6.1.4.1.12124.1.2.1.1 name: clusterIfsInBytes - MIB: ISILON-MIB diff --git a/snmp/datadog_checks/snmp/data/profiles/palo-alto.yaml b/snmp/datadog_checks/snmp/data/profiles/palo-alto.yaml index 904ce69e15054..1e47c65977ea7 100644 --- a/snmp/datadog_checks/snmp/data/profiles/palo-alto.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/palo-alto.yaml @@ -81,7 +81,14 @@ metrics: name: panEntryFRUModulePowerUsed - OID: 1.3.6.1.4.1.25461.1.1.7.1.2.1.1.2 name: panEntryFRUModuleNumPorts - + metric_tags: + - MIB: ENTITY-MIB + column: + OID: 1.3.6.1.2.1.47.1.1.1.1.2 + name: entPhysicalDescr + table: entPhysicalTable + tag: ent_descr + - MIB: PAN-ENTITY-EXT-MIB table: OID: 1.3.6.1.4.1.25461.1.1.7.1.3.1 diff --git a/snmp/metadata.csv b/snmp/metadata.csv index 1a6ade5f47aa7..7588c00c87513 100644 --- a/snmp/metadata.csv +++ b/snmp/metadata.csv @@ -393,7 +393,6 @@ snmp.cfwHardwareStatusValue,gauge,,,,[Cisco ASA 5525] This object contains the c snmp.cvsChassisUpTime,gauge,,time,,[Cisco ASA 5525] The time (in hundredths of a second) since the chassis device was last re-initialized.,0,snmp, snmp.hrSWRunPerfMem,gauge,,,,[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The total amount of real system memory allocated to this process.,0,snmp, snmp.hrSWRunPerfCPU,gauge,,,,[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The number of centi-seconds of the total system's CPU resources consumed by this process.,0,snmp, -snmp.hrSWRunStatus,gauge,,,,[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The status of this running piece of software.,0,snmp, snmp.ccvpSipIntAvgLatency1,gauge,,,,"[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The average period of time elapsed between the arrival of a CONNECT message from ICM and when the call is actually answered, on the first transfer request for the calls",0,snmp, snmp.ccvpSipIntAvgLatency2,gauge,,,,"[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The average period of time between the arrival of a CONNECT message from ICM and when the call is actually answered, on the second and subsequent transfer request for the call.",0,snmp, snmp.ccvpSipIntConnectsRcv,gauge,,,,"[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The number of CONNECT messages received by the SIP service in order to perform a Customer Voice Portal transfer, since system start.",0,snmp, From 4e93d3e97d8aabbe6daed9995c8a4cb9448efaf8 Mon Sep 17 00:00:00 2001 From: Sarah Witt Date: Wed, 27 May 2020 17:12:37 -0400 Subject: [PATCH 2/8] Update tests and tags --- .../snmp/data/profiles/_base_cisco_voice.yaml | 6 +++++- snmp/tests/test_profiles.py | 20 ++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml index 59aee48964ed7..081febc2aa45b 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml @@ -22,7 +22,11 @@ metrics: OID: 1.3.6.1.2.1.25.4.2.1.1 table: hrSWRunTable tag: run_index - + - column: + name: hrSWRunName + OID: 1.3.6.1.2.1.25.4.2.1.2 + table: hrSWRunTable + tag: run_name - MIB: CISCO-CVP-MIB table: name: ccvpSipTable diff --git a/snmp/tests/test_profiles.py b/snmp/tests/test_profiles.py index 90944de277946..a4a93a495f92e 100644 --- a/snmp/tests/test_profiles.py +++ b/snmp/tests/test_profiles.py @@ -77,7 +77,7 @@ def test_cisco_voice(aggregator): tags = ['snmp_profile:cisco_icm', 'snmp_host:test'] + common.CHECK_TAGS - resources = ["hrSWRunPerfMem", "hrSWRunPerfCPU", "hrSWRunStatus"] + resources = ["hrSWRunPerfMem", "hrSWRunPerfCPU"] for resource in resources: aggregator.assert_metric('snmp.{}'.format(resource), metric_type=aggregator.GAUGE, tags=tags) @@ -622,9 +622,12 @@ def test_cisco_nexus(aggregator): 'snmp.ciscoEnvMonSupplyState', metric_type=aggregator.GAUGE, tags=['power_source:1'] + common_tags, ) - aggregator.assert_metric( - 'snmp.ciscoEnvMonFanState', metric_type=aggregator.GAUGE, tags=common_tags, - ) + fan_indices = [4, 6, 7, 16, 21, 22, 25, 27] + for index in fan_indices: + tags = ['fan_status_index:{}'.format(index)] + common_tags + aggregator.assert_metric( + 'snmp.ciscoEnvMonFanState', metric_type=aggregator.GAUGE, tags=tags, + ) aggregator.assert_metric('snmp.cswStackPortOperStatus', metric_type=aggregator.GAUGE) aggregator.assert_metric( @@ -1134,9 +1137,12 @@ def test_cisco_asa_5525(aggregator): 'snmp.ciscoEnvMonSupplyState', metric_type=aggregator.GAUGE, tags=['power_source:1'] + common_tags, ) - aggregator.assert_metric( - 'snmp.ciscoEnvMonFanState', metric_type=aggregator.GAUGE, tags=common_tags, - ) + fan_indices = [4, 6, 7, 16, 21, 22, 25, 27] + for index in fan_indices: + tags = ['fan_status_index:{}'.format(index)] + common_tags + aggregator.assert_metric( + 'snmp.ciscoEnvMonFanState', metric_type=aggregator.GAUGE, tags=tags, + ) aggregator.assert_metric('snmp.cswStackPortOperStatus', metric_type=aggregator.GAUGE) aggregator.assert_metric( From 777405618d02b497c5992ac806b1b0c2f83a5f51 Mon Sep 17 00:00:00 2001 From: Sarah Witt Date: Thu, 28 May 2020 11:50:47 -0400 Subject: [PATCH 3/8] Add back status --- .../snmp/data/profiles/_base_cisco_voice.yaml | 21 +++++++++++-------- snmp/tests/test_profiles.py | 5 +++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml index 081febc2aa45b..471e5c146978e 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml @@ -12,21 +12,24 @@ metrics: - name: hrSWRunPerfCPU OID: 1.3.6.1.2.1.25.5.1.1.1 metric_tags: - - column: - name: hrSWRunStatus - OID: 1.3.6.1.2.1.25.4.2.1.7 - table: hrSWRunTable - tag: status - column: name: hrSWRunIndex OID: 1.3.6.1.2.1.25.4.2.1.1 table: hrSWRunTable tag: run_index + - MIB: HOST-RESOURCES-MIB + table: + name: hrSWRunTable + OID: 1.3.6.1.2.1.25.4.2 + symbols: + - name: hrSWRunStatus + OID: 1.3.6.1.2.1.25.4.2.1.7 + metric_tags: - column: - name: hrSWRunName - OID: 1.3.6.1.2.1.25.4.2.1.2 - table: hrSWRunTable - tag: run_name + name: hrSWRunIndex + OID: 1.3.6.1.2.1.25.4.2.1.1 + table: hrSWRunTable + tag: run_index - MIB: CISCO-CVP-MIB table: name: ccvpSipTable diff --git a/snmp/tests/test_profiles.py b/snmp/tests/test_profiles.py index a4a93a495f92e..d3e00eac45771 100644 --- a/snmp/tests/test_profiles.py +++ b/snmp/tests/test_profiles.py @@ -82,6 +82,11 @@ def test_cisco_voice(aggregator): for resource in resources: aggregator.assert_metric('snmp.{}'.format(resource), metric_type=aggregator.GAUGE, tags=tags) + run_indices = [4, 7, 8, 9, 10, 18, 24, 29, 30] + for index in run_indices: + status_tags = tags + ['run_index:{}'.format(index)] + aggregator.assert_metric('snmp.hrSWRunStatus', metric_type=aggregator.GAUGE, tags=status_tags) + cvp_gauges = [ "ccvpSipIntAvgLatency1", "ccvpSipIntAvgLatency2", From 289fb83eeb4c54ef5a3323f12831c1075390e020 Mon Sep 17 00:00:00 2001 From: Sarah Witt Date: Thu, 28 May 2020 11:54:57 -0400 Subject: [PATCH 4/8] Update metadata --- snmp/metadata.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/snmp/metadata.csv b/snmp/metadata.csv index 7588c00c87513..1a6ade5f47aa7 100644 --- a/snmp/metadata.csv +++ b/snmp/metadata.csv @@ -393,6 +393,7 @@ snmp.cfwHardwareStatusValue,gauge,,,,[Cisco ASA 5525] This object contains the c snmp.cvsChassisUpTime,gauge,,time,,[Cisco ASA 5525] The time (in hundredths of a second) since the chassis device was last re-initialized.,0,snmp, snmp.hrSWRunPerfMem,gauge,,,,[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The total amount of real system memory allocated to this process.,0,snmp, snmp.hrSWRunPerfCPU,gauge,,,,[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The number of centi-seconds of the total system's CPU resources consumed by this process.,0,snmp, +snmp.hrSWRunStatus,gauge,,,,[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The status of this running piece of software.,0,snmp, snmp.ccvpSipIntAvgLatency1,gauge,,,,"[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The average period of time elapsed between the arrival of a CONNECT message from ICM and when the call is actually answered, on the first transfer request for the calls",0,snmp, snmp.ccvpSipIntAvgLatency2,gauge,,,,"[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The average period of time between the arrival of a CONNECT message from ICM and when the call is actually answered, on the second and subsequent transfer request for the call.",0,snmp, snmp.ccvpSipIntConnectsRcv,gauge,,,,"[Cisco UC Virtual Machine] [Cisco ICM] [Cisco ISR 4431] The number of CONNECT messages received by the SIP service in order to perform a Customer Voice Portal transfer, since system start.",0,snmp, From 8decfd38271134fdf142c7845047dc4a90858d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Thu, 28 May 2020 18:18:40 +0200 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Sarah Witt --- .../snmp/data/profiles/_base_cisco_voice.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml index 471e5c146978e..4364453febca1 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml @@ -90,8 +90,9 @@ metrics: - name: cvCallVolMediaOutgoingCalls OID: 1.3.6.1.4.1.9.9.63.1.3.8.5.1.2 metric_tags: - - column: - OID: 1.3.6.1.2.1.31.1.1.1.1 + - MIB: IF-MIB + column: + OID: 1.3.6.1.2.1.31.1.1.1.1 name: ifName table: ifXTable tag: interface @@ -127,8 +128,9 @@ metrics: - name: dialCtlPeerStatsSuccessCalls OID: 1.3.6.1.2.1.10.21.1.2.2.1.3 metric_tags: - - column: - OID: 1.3.6.1.2.1.31.1.1.1.1 + - MIB: IF-MIB + column: + OID: 1.3.6.1.2.1.31.1.1.1.1 name: ifName table: ifXTable tag: interface From 6616ffb33397ea39f3a7f97273533ae8afc0e546 Mon Sep 17 00:00:00 2001 From: Sarah Witt Date: Thu, 28 May 2020 12:31:54 -0400 Subject: [PATCH 6/8] Fix yaml format --- .../snmp/data/profiles/_base_cisco_voice.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml index 4364453febca1..130e4199a02db 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml @@ -92,9 +92,9 @@ metrics: metric_tags: - MIB: IF-MIB column: - OID: 1.3.6.1.2.1.31.1.1.1.1 + OID: 1.3.6.1.2.1.31.1.1.1.1 name: ifName - table: ifXTable + table: ifXTable tag: interface - MIB: CISCO-VOICE-DIAL-CONTROL-MIB @@ -130,9 +130,9 @@ metrics: metric_tags: - MIB: IF-MIB column: - OID: 1.3.6.1.2.1.31.1.1.1.1 + OID: 1.3.6.1.2.1.31.1.1.1.1 name: ifName - table: ifXTable + table: ifXTable tag: interface - MIB: CISCO-CONTACT-CENTER-APPS-MIB From 77870f6fd586ee8bfeb2ce26d87f6a5c834876a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Thu, 28 May 2020 22:26:42 +0200 Subject: [PATCH 7/8] Fix tagging based on real walk data --- .../snmp/data/profiles/_base_cisco_voice.yaml | 13 +++---------- snmp/tests/test_profiles.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml index 130e4199a02db..7b31a84874ee1 100644 --- a/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml +++ b/snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml @@ -107,10 +107,7 @@ metrics: - name: cvCallVolPeerOutgoingCalls OID: 1.3.6.1.4.1.9.9.63.1.3.8.4.1.2 metric_tags: - - column: - OID: 1.3.6.1.4.1.9.9.63.1.2.1.1.1 - name: cvPeerCfgIndex - table: cvPeerCfgTable + - index: 1 tag: peer_index - MIB: DIAL-CONTROL-MIB @@ -128,12 +125,8 @@ metrics: - name: dialCtlPeerStatsSuccessCalls OID: 1.3.6.1.2.1.10.21.1.2.2.1.3 metric_tags: - - MIB: IF-MIB - column: - OID: 1.3.6.1.2.1.31.1.1.1.1 - name: ifName - table: ifXTable - tag: interface + - index: 1 + tag: peer_index - MIB: CISCO-CONTACT-CENTER-APPS-MIB table: diff --git a/snmp/tests/test_profiles.py b/snmp/tests/test_profiles.py index d3e00eac45771..ebd4cd882a275 100644 --- a/snmp/tests/test_profiles.py +++ b/snmp/tests/test_profiles.py @@ -114,6 +114,15 @@ def test_cisco_voice(aggregator): calls = [ "cvCallVolPeerIncomingCalls", "cvCallVolPeerOutgoingCalls", + ] + + peers = [4, 13, 14, 17, 18, 22, 25, 30, 31] + for call in calls: + for peer in peers: + peer_tags = tags + ["peer_index:{}".format(peer)] + aggregator.assert_metric('snmp.{}'.format(call), metric_type=aggregator.GAUGE, tags=peer_tags) + + calls = [ "cvCallVolMediaIncomingCalls", "cvCallVolMediaOutgoingCalls", ] @@ -129,7 +138,7 @@ def test_cisco_voice(aggregator): ] for ctl in dial_controls: - aggregator.assert_metric('snmp.{}'.format(ctl), metric_type=aggregator.MONOTONIC_COUNT, tags=tags) + aggregator.assert_metric('snmp.{}'.format(ctl), metric_type=aggregator.MONOTONIC_COUNT, tags=["peer_index:7"] + tags) pim_tags = tags + ['pim_host:test', 'pim_name:name', 'pim_num:2'] aggregator.assert_metric('snmp.{}'.format("cccaPimStatus"), metric_type=aggregator.GAUGE, tags=pim_tags) From 8b0590840f569c01f0d39648b3096f411de4b866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Sun, 31 May 2020 10:55:46 +0200 Subject: [PATCH 8/8] Style --- snmp/tests/test_profiles.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/snmp/tests/test_profiles.py b/snmp/tests/test_profiles.py index ebd4cd882a275..ffcc700751325 100644 --- a/snmp/tests/test_profiles.py +++ b/snmp/tests/test_profiles.py @@ -138,7 +138,9 @@ def test_cisco_voice(aggregator): ] for ctl in dial_controls: - aggregator.assert_metric('snmp.{}'.format(ctl), metric_type=aggregator.MONOTONIC_COUNT, tags=["peer_index:7"] + tags) + aggregator.assert_metric( + 'snmp.{}'.format(ctl), metric_type=aggregator.MONOTONIC_COUNT, tags=["peer_index:7"] + tags + ) pim_tags = tags + ['pim_host:test', 'pim_name:name', 'pim_num:2'] aggregator.assert_metric('snmp.{}'.format("cccaPimStatus"), metric_type=aggregator.GAUGE, tags=pim_tags)