diff --git a/snmp/datadog_checks/snmp/data/default_profiles/_cisco-generic.yaml b/snmp/datadog_checks/snmp/data/default_profiles/_cisco-generic.yaml index df0f8141b0399..a037b3c765b98 100644 --- a/snmp/datadog_checks/snmp/data/default_profiles/_cisco-generic.yaml +++ b/snmp/datadog_checks/snmp/data/default_profiles/_cisco-generic.yaml @@ -128,6 +128,34 @@ metrics: name: ciscoEnvMonFanStatusIndex tag: fan_status_index + - MIB: CISCO-ENVMON-MIB + table: + OID: 1.3.6.1.4.1.9.9.13.1.4 + name: ciscoEnvMonFanStatusTable + symbols: + - name: ciscoEnvMonFanStatus + constant_value_one: true + metric_tags: + - column: + OID: 1.3.6.1.4.1.9.9.13.1.4.1.3 + name: ciscoEnvMonFanState + tag: fan_state + mapping: + 1: normal + 2: warning + 3: critical + 4: shutdown + 5: notPresent + 6: notFunctioning + - column: + OID: 1.3.6.1.4.1.9.9.13.1.4.1.2 + name: ciscoEnvMonFanStatusDescr + tag: fan_status_descr + - 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 table: @@ -175,6 +203,34 @@ metrics: - index: 1 tag: fru + - MIB: CISCO-ENTITY-FRU-CONTROL-MIB + table: + OID: 1.3.6.1.4.1.9.9.117.1.4.1 + name: cefcFanTrayStatusTable + symbols: + - name: cefcFanTrayStatus + constant_value_one: true + metric_tags: + - index: 1 + tag: fru + - column: + OID: 1.3.6.1.4.1.9.9.117.1.4.1.1.1 + name: cefcFanTrayOperStatus + tag: cefc_fan_tray_oper_status + mapping: + 1: unknown + 2: up + 3: down + 4: warning + - column: + OID: 1.3.6.1.4.1.9.9.117.1.4.1.1.2 + name: cefcFanTrayDirection + tag: cefc_fan_tray_direction + mapping: + 1: unknown + 2: frontToBack + 3: backToFront + - MIB: CISCO-MEMORY-POOL-MIB table: OID: 1.3.6.1.4.1.9.9.48.1.1 diff --git a/snmp/metadata.csv b/snmp/metadata.csv index c4cc25934bebe..e60df17f3b1ae 100644 --- a/snmp/metadata.csv +++ b/snmp/metadata.csv @@ -201,6 +201,7 @@ snmp.cefcFRUCurrent,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] Curren snmp.cefcFRUPowerAdminStatus,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] Administratively desired FRU power state.,0,snmp,, snmp.cefcFRUPowerOperStatus,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] Operational FRU power state.,0,snmp,, snmp.cefcFanTrayOperStatus,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] The operational state of the fan or fan tray.,0,snmp,, +snmp.cefcFanTrayStatus,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] cefcFanTrayStatusTable. Constant metric equal to 1,0,snmp,, snmp.cfInterconnectStatus,gauge,,,,"[NetApp] The current status of the interconnect (notPresent(1), down(2), partialFailure(3), up(4)).",0,snmp,, snmp.cfprEquipmentFan,gauge,,,,"[CISCO-FIREPOWER-EQUIPMENT-MIB] Cisco Firepower equipment:Fan managed object table (Make 'sum by {X}' queries to count elements with the tag X.)",0,snmp,, snmp.cfprEquipmentPsu,gauge,,,,"[CISCO-FIREPOWER-EQUIPMENT-MIB] Cisco Firepower equipment:Psu managed object table (Make 'sum by {X}' queries to count elements with the tag X.)",0,snmp,, @@ -218,6 +219,7 @@ snmp.cipSecGlobalActiveTunnels,gauge,,,,[Cisco ASA 5525] The total number of cur snmp.cipSecGlobalHcInOctets,count,,,,[Cisco ASA 5525] A high capacity count of the total number of octets received by all current and previous IPsec Phase-2 Tunnels.,0,snmp,, snmp.cipSecGlobalHcOutOctets,count,,,,[Cisco ASA 5525] A high capacity count of the total number of octets sent by all current and previous IPsec Phase-2 Tunnels.,0,snmp,, snmp.ciscoEnvMonFanState,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] The current state of the fan being instrumented.,0,snmp,, +snmp.ciscoEnvMonFanStatus,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] ciscoEnvMonFanStatusTable. Constant metric equal to 1,0,snmp,, snmp.ciscoEnvMonSupplyState,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] The current state of the power supply being instrumented.,0,snmp,, snmp.ciscoEnvMonSupplyStatus,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] Supply status table. Constant metric equal to 1.,0,snmp,, snmp.ciscoEnvMonTemperatureStatusValue,gauge,,,,[Cisco c3850] [Cisco Nexus] [Cisco ASA 5525] The current value of the testpoint being instrumented.,0,snmp,, diff --git a/snmp/tests/compose/data/cisco-access-point.snmprec b/snmp/tests/compose/data/cisco-access-point.snmprec index 51b4deb656940..716325cd08e5b 100644 --- a/snmp/tests/compose/data/cisco-access-point.snmprec +++ b/snmp/tests/compose/data/cisco-access-point.snmprec @@ -5,6 +5,8 @@ 1.3.6.1.2.1.31.1.1.1.1.21|4|eth12 1.3.6.1.2.1.31.1.1.1.1.23|4|eth0 1.3.6.1.2.1.31.1.1.1.1.30|4|eth1 +1.3.6.1.4.1.9.9.13.1.4.1.1.11|2|11 +1.3.6.1.4.1.9.9.13.1.4.1.3.11|2|6 1.3.6.1.4.1.9.9.109.1.1.1.1.12.712|66|353 1.3.6.1.4.1.9.9.273.1.1.1.0|4x|000000000000 1.3.6.1.4.1.9.9.273.1.1.2.1.1.23|66|2000 diff --git a/snmp/tests/compose/data/cisco-load-balancer.snmprec b/snmp/tests/compose/data/cisco-load-balancer.snmprec index beeeff751d285..6ae2212423341 100644 --- a/snmp/tests/compose/data/cisco-load-balancer.snmprec +++ b/snmp/tests/compose/data/cisco-load-balancer.snmprec @@ -1,6 +1,8 @@ 1.3.6.1.2.1.1.1.0|4|cisco-load-balancer Device Description 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.824 1.3.6.1.2.1.1.5.0|4|cisco-load-balancer.device.name +1.3.6.1.4.1.9.9.13.1.4.1.1.11|2|11 +1.3.6.1.4.1.9.9.13.1.4.1.3.11|2|6 1.3.6.1.4.1.9.9.109.1.1.1.1.12.712|66|353 1.3.6.1.4.1.9.9.161.1.1.1.1.1.11128|66|11128 1.3.6.1.4.1.9.9.161.1.1.1.1.1.52836|66|52836 diff --git a/snmp/tests/compose/data/cisco-wan-optimizer.snmprec b/snmp/tests/compose/data/cisco-wan-optimizer.snmprec index 58306972b52b8..98c69d2b9ecb3 100644 --- a/snmp/tests/compose/data/cisco-wan-optimizer.snmprec +++ b/snmp/tests/compose/data/cisco-wan-optimizer.snmprec @@ -16,6 +16,8 @@ 1.3.6.1.2.1.25.3.3.1.1.21|2|21 1.3.6.1.2.1.25.3.3.1.2.10|2|31 1.3.6.1.2.1.25.3.3.1.2.21|2|15 +1.3.6.1.4.1.9.9.13.1.4.1.1.11|2|11 +1.3.6.1.4.1.9.9.13.1.4.1.3.11|2|6 1.3.6.1.4.1.9.9.178.1.1.1.1.0|65|3129595330 1.3.6.1.4.1.9.9.178.1.1.1.2.0|65|1937924569 1.3.6.1.4.1.9.9.178.1.1.1.3.0|65|2909442301 diff --git a/snmp/tests/compose/data/cisco.snmprec b/snmp/tests/compose/data/cisco.snmprec index d8dc87680a17d..314c32ce124d3 100644 --- a/snmp/tests/compose/data/cisco.snmprec +++ b/snmp/tests/compose/data/cisco.snmprec @@ -7,5 +7,7 @@ 1.3.6.1.2.1.7.8.0|70|6116206687099577350 1.3.6.1.2.1.14.10.1.6.192.29.116.26.0|2|8 1.3.6.1.2.1.15.3.1.3.244.12.239.177|2|2 +1.3.6.1.4.1.9.9.13.1.4.1.1.11|2|11 +1.3.6.1.4.1.9.9.13.1.4.1.3.11|2|6 1.3.6.1.4.1.9.9.48.1.1.1.5.18|66|4078680985 1.3.6.1.4.1.9.9.109.1.1.1.1.7.712|66|20 diff --git a/snmp/tests/test_e2e_core.py b/snmp/tests/test_e2e_core.py index ae81558a6d4c4..57b58edf4d718 100644 --- a/snmp/tests/test_e2e_core.py +++ b/snmp/tests/test_e2e_core.py @@ -664,6 +664,27 @@ def test_e2e_cisco_nexus(dd_agent_check): 'snmp.cefcFanTrayOperStatus', metric_type=aggregator.GAUGE, tags=['fru:{}'.format(fru)] + common_tags ) + tag_rows = [ + ['fru:1', 'cefc_fan_tray_oper_status:down'], + ['fru:2', 'cefc_fan_tray_oper_status:unknown'], + ['fru:4', 'cefc_fan_tray_oper_status:unknown'], + ['fru:27', 'cefc_fan_tray_oper_status:unknown'], + ['fru:30', 'cefc_fan_tray_oper_status:warning'], + ['fru:31', 'cefc_fan_tray_oper_status:unknown'], + ] + for tag_row in tag_rows: + aggregator.assert_metric('snmp.cefcFanTrayStatus', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + + tag_rows = [ + ['fan_status_descr:fan_1', 'fan_state:critical', 'fan_status_index:4'], + ['fan_status_descr:fan_2', 'fan_state:notFunctioning', 'fan_status_index:6'], + ['fan_status_descr:fan_3', 'fan_state:critical', 'fan_status_index:7'], + ['fan_status_descr:fan_4', 'fan_state:notPresent', 'fan_status_index:16'], + ['fan_status_descr:fan_8', 'fan_state:normal', 'fan_status_index:30'], + ] + for tag_row in tag_rows: + aggregator.assert_metric('snmp.ciscoEnvMonFanStatus', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + cpu_ids = [6692, 3173, 54474, 63960, 11571, 38253, 30674, 52063] for cpu in cpu_ids: aggregator.assert_metric( diff --git a/snmp/tests/test_e2e_core_profiles/test_profile__cisco_generic.py b/snmp/tests/test_e2e_core_profiles/test_profile__cisco_generic.py index 242970ddd73a7..b20e718ea147d 100644 --- a/snmp/tests/test_e2e_core_profiles/test_profile__cisco_generic.py +++ b/snmp/tests/test_e2e_core_profiles/test_profile__cisco_generic.py @@ -121,6 +121,13 @@ def test_e2e_profile__cisco_generic(dd_agent_check): for tag_row in tag_rows: aggregator.assert_metric('snmp.ciscoEnvMonFanState', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + tag_rows = [ + ['fan_status_index:11', 'fan_state:notFunctioning', 'fan_status_descr:oxen their but kept forward kept'], + ['fan_status_index:16', 'fan_state:normal', 'fan_status_descr:acted'], + ] + for tag_row in tag_rows: + aggregator.assert_metric('snmp.ciscoEnvMonFanStatus', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + aggregator.assert_metric('snmp.cswStackPortOperStatus', metric_type=aggregator.GAUGE, tags=common_tags) tag_rows = [ @@ -142,6 +149,19 @@ def test_e2e_profile__cisco_generic(dd_agent_check): for tag_row in tag_rows: aggregator.assert_metric('snmp.cefcFanTrayOperStatus', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + tag_rows = [ + ['fru:21', 'cefc_fan_tray_oper_status:warning', 'cefc_fan_tray_direction:frontToBack'], + ['fru:23', 'cefc_fan_tray_oper_status:up', 'cefc_fan_tray_direction:frontToBack'], + ['fru:25', 'cefc_fan_tray_oper_status:unknown', 'cefc_fan_tray_direction:frontToBack'], + ['fru:27', 'cefc_fan_tray_oper_status:unknown', 'cefc_fan_tray_direction:unknown'], + ['fru:29', 'cefc_fan_tray_oper_status:unknown', 'cefc_fan_tray_direction:backToFront'], + ['fru:30', 'cefc_fan_tray_oper_status:up', 'cefc_fan_tray_direction:backToFront'], + ['fru:7', 'cefc_fan_tray_oper_status:up', 'cefc_fan_tray_direction:backToFront'], + ['fru:9', 'cefc_fan_tray_oper_status:warning', 'cefc_fan_tray_direction:unknown'], + ] + for tag_row in tag_rows: + aggregator.assert_metric('snmp.cefcFanTrayStatus', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) + tag_rows = [ ['mem_pool_name:but their kept quaintly driving'], ['mem_pool_name:zombies kept their oxen'], diff --git a/snmp/tests/test_e2e_core_profiles/test_profile_cisco.py b/snmp/tests/test_e2e_core_profiles/test_profile_cisco.py index 99d0454ead263..4b2da9975937d 100644 --- a/snmp/tests/test_e2e_core_profiles/test_profile_cisco.py +++ b/snmp/tests/test_e2e_core_profiles/test_profile_cisco.py @@ -11,6 +11,7 @@ from .utils import ( assert_common_metrics, assert_extend_cisco_cpu_memory, + assert_extend_cisco_generic, assert_extend_generic_bgp4, assert_extend_generic_if, assert_extend_generic_ip, @@ -45,6 +46,7 @@ def test_e2e_profile_cisco(dd_agent_check): assert_extend_generic_ospf(aggregator, common_tags) assert_extend_generic_bgp4(aggregator, common_tags) assert_extend_cisco_cpu_memory(aggregator, common_tags) + assert_extend_cisco_generic(aggregator, common_tags) aggregator.assert_all_metrics_covered() aggregator.assert_metrics_using_metadata(get_metadata_metrics()) diff --git a/snmp/tests/test_e2e_core_profiles/test_profile_cisco_access_point.py b/snmp/tests/test_e2e_core_profiles/test_profile_cisco_access_point.py index 8a2d22a809bb9..d20bde4101205 100644 --- a/snmp/tests/test_e2e_core_profiles/test_profile_cisco_access_point.py +++ b/snmp/tests/test_e2e_core_profiles/test_profile_cisco_access_point.py @@ -11,6 +11,7 @@ from .utils import ( assert_common_metrics, assert_extend_cisco, + assert_extend_cisco_generic, create_e2e_core_test_config, get_device_ip_from_config, ) @@ -32,6 +33,7 @@ def test_e2e_profile_cisco_access_point(dd_agent_check): # --- TEST EXTENDED METRICS --- assert_extend_cisco(aggregator, common_tags) + assert_extend_cisco_generic(aggregator, common_tags) # --- TEST METRICS --- assert_common_metrics(aggregator, common_tags) diff --git a/snmp/tests/test_e2e_core_profiles/test_profile_cisco_load_balancer.py b/snmp/tests/test_e2e_core_profiles/test_profile_cisco_load_balancer.py index 83075432098a3..c87d509646588 100644 --- a/snmp/tests/test_e2e_core_profiles/test_profile_cisco_load_balancer.py +++ b/snmp/tests/test_e2e_core_profiles/test_profile_cisco_load_balancer.py @@ -11,6 +11,7 @@ from .utils import ( assert_common_metrics, assert_extend_cisco, + assert_extend_cisco_generic, create_e2e_core_test_config, get_device_ip_from_config, ) @@ -33,6 +34,7 @@ def test_e2e_profile_cisco_load_balancer(dd_agent_check): # --- TEST EXTENDED METRICS --- # Examples: assert_extend_cisco(aggregator, common_tags) + assert_extend_cisco_generic(aggregator, common_tags) # --- TEST METRICS --- assert_common_metrics(aggregator, common_tags) diff --git a/snmp/tests/test_e2e_core_profiles/test_profile_cisco_wan_optimizer.py b/snmp/tests/test_e2e_core_profiles/test_profile_cisco_wan_optimizer.py index ff834dc205b00..d64bff068d50f 100644 --- a/snmp/tests/test_e2e_core_profiles/test_profile_cisco_wan_optimizer.py +++ b/snmp/tests/test_e2e_core_profiles/test_profile_cisco_wan_optimizer.py @@ -10,6 +10,7 @@ from ..test_e2e_core_metadata import assert_device_metadata from .utils import ( assert_common_metrics, + assert_extend_cisco_generic, assert_extend_generic_host_resources_base, create_e2e_core_test_config, get_device_ip_from_config, @@ -32,6 +33,7 @@ def test_e2e_profile_cisco_wan_optimizer(dd_agent_check): # --- TEST EXTENDED METRICS --- assert_extend_generic_host_resources_base(aggregator, common_tags) + assert_extend_cisco_generic(aggregator, common_tags) # --- TEST METRICS --- assert_common_metrics(aggregator, common_tags) diff --git a/snmp/tests/test_e2e_core_profiles/utils.py b/snmp/tests/test_e2e_core_profiles/utils.py index 8bba54a2b8d33..a9ca186961fd5 100644 --- a/snmp/tests/test_e2e_core_profiles/utils.py +++ b/snmp/tests/test_e2e_core_profiles/utils.py @@ -109,6 +109,23 @@ def assert_extend_cisco_cpu_memory(aggregator, common_tags): ) +def assert_extend_cisco_generic(aggregator, common_tags): + # fmt: off + """Add the following to the snmprec +1.3.6.1.4.1.9.9.13.1.4.1.1.11|2|11 +1.3.6.1.4.1.9.9.13.1.4.1.3.11|2|6 + """ + # fmt: on + aggregator.assert_metric( + 'snmp.ciscoEnvMonFanStatus', + metric_type=aggregator.GAUGE, + tags=common_tags + ['fan_state:notFunctioning', 'fan_status_index:11'], + ) + aggregator.assert_metric( + 'snmp.ciscoEnvMonFanState', metric_type=aggregator.GAUGE, tags=common_tags + ['fan_status_index:11'] + ) + + def assert_extend_generic_host_resources_base(aggregator, common_tags): # fmt: off """Add the following to the snmprec diff --git a/snmp/tests/test_e2e_core_vs_python.py b/snmp/tests/test_e2e_core_vs_python.py index 440bfbc8cf333..6bc90bb3bf644 100644 --- a/snmp/tests/test_e2e_core_vs_python.py +++ b/snmp/tests/test_e2e_core_vs_python.py @@ -45,6 +45,8 @@ 'snmp.upsOutletGroupStatus', # APC UPS constant metric 'snmp.cpiPduEas', # Chatsworth constant metric 'snmp.ciscoEnvMonSupplyStatus', # Cisco constant metric + 'snmp.ciscoEnvMonFanStatus', # Cisco constant metric + 'snmp.cefcFanTrayStatus', # Cisco constant metric 'snmp.cpqHeFltTolPowerSupply', # HP constant metric ] @@ -356,7 +358,14 @@ def test_e2e_profile_cisco_3850(dd_agent_check): config, expected_total_count=5108 + 5, metrics_to_skip=metrics_to_skip, - tags_to_skip=['neighbor_state', 'if_state', 'cisco_env_mon_supply_state'], # Ignore tags that have a mapping + tags_to_skip=[ + 'neighbor_state', + 'if_state', + 'cisco_env_mon_supply_state', + 'fan_state', + 'cefc_fan_tray_oper_status', + 'cefc_fan_tray_direction', + ], # Ignore tags that have mappings ) @@ -367,7 +376,12 @@ def test_e2e_profile_cisco_asa(dd_agent_check): dd_agent_check, config, metrics_to_skip=metrics_to_skip, - tags_to_skip=['cisco_env_mon_supply_state'], # Ignore tag that has a mapping + tags_to_skip=[ + 'cisco_env_mon_supply_state', + 'fan_state', + 'cefc_fan_tray_oper_status', + 'cefc_fan_tray_direction', + ], # Ignore tags that have mappings ) @@ -378,6 +392,12 @@ def test_e2e_profile_cisco_asa_5525(dd_agent_check): dd_agent_check, config, metrics_to_skip=metrics_to_skip, + tags_to_skip=[ + 'cisco_env_mon_supply_state', + 'fan_state', + 'cefc_fan_tray_oper_status', + 'cefc_fan_tray_direction', + ], # Ignore tags that have mappings ) @@ -400,7 +420,12 @@ def test_e2e_profile_cisco_nexus(dd_agent_check): dd_agent_check, config, metrics_to_skip=metrics_to_skip, - tags_to_skip=['cisco_env_mon_supply_state'], # Ignore tag that has a mapping + tags_to_skip=[ + 'cisco_env_mon_supply_state', + 'fan_state', + 'cefc_fan_tray_oper_status', + 'cefc_fan_tray_direction', + ], # Ignore tags that have mappings )