Skip to content

Commit

Permalink
Add missing tags to profiles tables (#6765)
Browse files Browse the repository at this point in the history
Some tables were missing tags, this won't work when tables have multiple
rows.

* Update tests and tags

* Add back status

* Update metadata

* Apply suggestions from code review

* Fix yaml  format

* Fix tagging based on real walk data

* Style

Co-authored-by: Sarah Witt <sarah.witt@datadoghq.com>
  • Loading branch information
therve and sarah-witt authored Jun 2, 2020
1 parent 19b4c39 commit 792a108
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 24 deletions.
7 changes: 6 additions & 1 deletion snmp/datadog_checks/snmp/data/profiles/_base_cisco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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
Expand Down Expand Up @@ -187,7 +192,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
44 changes: 36 additions & 8 deletions snmp/datadog_checks/snmp/data/profiles/_base_cisco_voice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@ metrics:
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

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: 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
Expand All @@ -43,6 +47,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:
Expand Down Expand Up @@ -79,6 +89,13 @@ 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:
- MIB: IF-MIB
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:
Expand All @@ -89,6 +106,9 @@ 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:
- index: 1
tag: peer_index

- MIB: DIAL-CONTROL-MIB
forced_type: monotonic_count
Expand All @@ -104,7 +124,9 @@ 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:
- index: 1
tag: peer_index

- MIB: CISCO-CONTACT-CENTER-APPS-MIB
table:
Expand All @@ -131,10 +153,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
8 changes: 4 additions & 4 deletions snmp/datadog_checks/snmp/data/profiles/apc_ups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion snmp/datadog_checks/snmp/data/profiles/cisco-csr1000v.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends:
- _base_cisco.yaml
- _generic-router-ip.yaml

sysobjectid: 1.3.6.1.4.1.9.1.1537
2 changes: 1 addition & 1 deletion snmp/datadog_checks/snmp/data/profiles/isilon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion snmp/datadog_checks/snmp/data/profiles/palo-alto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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
Expand Down
38 changes: 30 additions & 8 deletions snmp/tests/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ 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)

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",
Expand Down Expand Up @@ -109,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",
]
Expand All @@ -124,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=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)
Expand Down Expand Up @@ -632,9 +648,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(
Expand Down Expand Up @@ -1157,9 +1176,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(
Expand Down

0 comments on commit 792a108

Please sign in to comment.