From c875ec61be38eb61c68af2ed1eb4ed6b25390862 Mon Sep 17 00:00:00 2001 From: jedupau <72938258+jedupau@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:29:49 +0100 Subject: [PATCH] [NDMII-3147] update Cisco IP SLA metrics (#19079) * update cisco ipsla metric tags and description * fix test cisco asa * switch oper sense to camel case * fix test cisco asa * fix test cisco asa * fix release note * fix test * fix test --- snmp/changelog.d/19079.added | 1 + .../data/default_profiles/_cisco-generic.yaml | 56 +++++++++++++++++++ snmp/metadata.csv | 6 +- .../tests/compose/data/_cisco-generic.snmprec | 8 +-- .../test_profile__cisco_generic.py | 36 ++++++++++-- snmp/tests/test_e2e_core_vs_python.py | 4 ++ snmp/tests/test_profiles.py | 14 ++++- 7 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 snmp/changelog.d/19079.added diff --git a/snmp/changelog.d/19079.added b/snmp/changelog.d/19079.added new file mode 100644 index 0000000000000..74814808c1f37 --- /dev/null +++ b/snmp/changelog.d/19079.added @@ -0,0 +1 @@ +[NDMII-3147] update Cisco IP SLA metric tags and description. 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 52f0dbf0f44c3..8f79e1c2f0469 100644 --- a/snmp/datadog_checks/snmp/data/default_profiles/_cisco-generic.yaml +++ b/snmp/datadog_checks/snmp/data/default_profiles/_cisco-generic.yaml @@ -445,6 +445,41 @@ metrics: 26: fabric_path_echo - index: 1 tag: rtt_index + - symbol: + OID: 1.3.6.1.4.1.9.9.42.1.2.2.1.6 + name: rttMonEchoAdminSourceAddress + format: ip_address + table: rttMonEchoAdminTable + tag: rtt_source_address + - symbol: + OID: 1.3.6.1.4.1.9.9.42.1.2.2.1.2 + name: rttMonEchoAdminTargetAddress + format: ip_address + table: rttMonEchoAdminTable + tag: rtt_target_address + - symbol: + OID: 1.3.6.1.4.1.9.9.42.1.2.10.1.2 + name: rttMonLatestRttOperSense + table: rttMonLatestRttOperTable + tag: rtt_sense + mapping: + 0: other + 1: ok + 2: disconnected + 3: over_threshold + 4: timeout + 5: busy + 6: not_connected + 7: dropped + 8: sequence_error + 9: verify_error + 10: application_specific + 11: dns_server_timeout + 12: tcp_connect_timeout + 13: http_transaction_timeout + 14: dns_query_error + 15: http_error + 16: error - MIB: CISCO-RTTMON-MIB table: @@ -500,3 +535,24 @@ metrics: 26: fabric_path_echo - index: 1 tag: rtt_index + - symbol: + OID: 1.3.6.1.4.1.9.9.42.1.2.2.1.6 + name: rttMonEchoAdminSourceAddress + format: ip_address + table: rttMonEchoAdminTable + tag: rtt_source_address + - symbol: + OID: 1.3.6.1.4.1.9.9.42.1.2.2.1.2 + name: rttMonEchoAdminTargetAddress + format: ip_address + table: rttMonEchoAdminTable + tag: rtt_target_address + - symbol: + OID: 1.3.6.1.4.1.9.9.42.1.2.9.1.6 + name: rttMonCtrlOperTimeoutOccurred + name: rttMonCtrlOperTable + tag: rtt_timeout + mapping: + 1: true + 2: false + diff --git a/snmp/metadata.csv b/snmp/metadata.csv index 3858c746ef8d2..d8d924476d837 100644 --- a/snmp/metadata.csv +++ b/snmp/metadata.csv @@ -1982,9 +1982,9 @@ snmp.rtpSenderPackets,gauge,,,,"[RTP-MIB] Count of RTP packets sent by this send snmp.rtpSessionByes,gauge,,,,"[RTP-MIB] A count of RTCP BYE (see RFC 1889, 'RTP: A Transport Protocol for Real-Time Applications,' sec. 6.6) messages received by this entity.",0,snmp,, snmp.rtpSessionReceiverJoins,gauge,,,,"[RTP-MIB] The number of receivers that have been been observed to have joined this session since this conceptual row was created (rtpSessionStartTime). A receiver 'joins' an RTP session by sending RTCP Receiver Reports to the session. Receivers that leave and then re-join following an RTCP BYE (see RFC 1889, 'RTP: A Transport Protocol for Real-Time Applications,' sec. 6.6) or session timeout ma...",0,snmp,, snmp.rtpSessionSenderJoins,gauge,,,,"[RTP-MIB] The number of senders that have been observed to have joined the session since this conceptual row was created (rtpSessionStartTime). A sender 'joins' an RTP session by sending to it. Senders that leave and then re-join following an RTCP BYE (see RFC 1889, 'RTP: A Transport Protocol for Real-Time Applications,' sec. 6.6) or session timeout may be counted twice. Every time a new RTP se...",0,snmp,, -snmp.rttMonCtrlOperTimeoutOccurred,gauge,,,,This object will change its value for all RttMonRttTypes.,0,snmp,, -snmp.rttMonLatestRttOperCompletionTime,gauge,,millisecond,,The completion time of the latest RTT operation successfully completed.,0,snmp,, -snmp.rttMonLatestRttOperSense,gauge,,,,A sense code for the completion status of the latest RTT operation.,0,snmp,, +snmp.rttMonCtrlOperTimeoutOccurred,gauge,,,,[CISCO-RTTMON-MIB] This value indicates whether a timeout has occurred during the Cisco IP SLA operation where 1 means true (timeout occurred) and 2 means false (no timeout).,0,snmp,, +snmp.rttMonLatestRttOperCompletionTime,gauge,,millisecond,,[CISCO-RTTMON-MIB] This value shows the time in milliseconds taken to complete the latest succesful Cisco IP SLA operation.,0,snmp,, +snmp.rttMonLatestRttOperSense,gauge,,,,[CISCO-RTTMON-MIB] This value indicates the result of the latest Cisco IP SLA operation where different integer values represent specific outcomes. Tagging the metric with rtt_sense will show the corresponding status.,0,snmp,, snmp.ruckusUnleashedSystemStatsAllNumSta,gauge,,,,"[RUCKUS-UNLEASHED-SYSTEM-MIB] Number of All client devices",0,snmp,, snmp.ruckusUnleashedSystemStatsNumAP,gauge,,,,"[RUCKUS-UNLEASHED-SYSTEM-MIB] Number of AP",0,snmp,, snmp.ruckusUnleashedSystemStatsNumRegisteredAP,gauge,,,,"[RUCKUS-UNLEASHED-SYSTEM-MIB] Number of registered AP",0,snmp,, diff --git a/snmp/tests/compose/data/_cisco-generic.snmprec b/snmp/tests/compose/data/_cisco-generic.snmprec index 4e36ae5b5dd56..80c436aa683c6 100644 --- a/snmp/tests/compose/data/_cisco-generic.snmprec +++ b/snmp/tests/compose/data/_cisco-generic.snmprec @@ -142,16 +142,16 @@ 1.3.6.1.4.1.9.9.42.1.2.1.1.12.30|4x|717561696e746c7920717561696e746c79207a6f6d62696573 1.3.6.1.4.1.9.9.42.1.2.2.1.1.27|2|25 1.3.6.1.4.1.9.9.42.1.2.2.1.1.31|2|4 -1.3.6.1.4.1.9.9.42.1.2.2.1.2.27|4x|717561696e746c79206b6570742064726976696e67 -1.3.6.1.4.1.9.9.42.1.2.2.1.2.31|4x|6f78656e207a6f6d6269657320746865697220717561696e746c79206b657074206163746564 +1.3.6.1.4.1.9.9.42.1.2.2.1.2.26|4x|be7260a9 +1.3.6.1.4.1.9.9.42.1.2.2.1.2.30|4x|00000000 1.3.6.1.4.1.9.9.42.1.2.2.1.3.27|2|19 1.3.6.1.4.1.9.9.42.1.2.2.1.3.31|2|24 1.3.6.1.4.1.9.9.42.1.2.2.1.4.27|2|30 1.3.6.1.4.1.9.9.42.1.2.2.1.4.31|2|6 1.3.6.1.4.1.9.9.42.1.2.2.1.5.27|2|15 1.3.6.1.4.1.9.9.42.1.2.2.1.5.31|2|10 -1.3.6.1.4.1.9.9.42.1.2.2.1.6.27|4x|6f78656e20627574207468656972206f78656e206f78656e204a61646564206163746564207a6f6d62696573206163746564 -1.3.6.1.4.1.9.9.42.1.2.2.1.6.31|4x|7a6f6d62696573206f78656e20666f727761726420666f7277617264206f78656e +1.3.6.1.4.1.9.9.42.1.2.2.1.6.26|4x|00000000 +1.3.6.1.4.1.9.9.42.1.2.2.1.6.30|4x|be7260a9 1.3.6.1.4.1.9.9.42.1.2.2.1.7.27|2|16 1.3.6.1.4.1.9.9.42.1.2.2.1.7.31|2|24 1.3.6.1.4.1.9.9.42.1.2.2.1.8.27|2|1 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 2951bc4ec0e3d..1f78594db88c9 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 @@ -244,8 +244,22 @@ def test_e2e_profile__cisco_generic(dd_agent_check): aggregator.assert_metric('snmp.cvsChassisUpTime', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) tag_rows = [ - ['rtt_index:26', 'rtt_state:inactive', 'rtt_type:tcp_connect'], - ['rtt_index:30', 'rtt_state:orderly_stop', 'rtt_type:script'], + [ + 'rtt_index:26', + 'rtt_state:inactive', + 'rtt_type:tcp_connect', + 'rtt_source_address:0.0.0.0', + 'rtt_target_address:190.114.96.169', + 'rtt_sense:other', + ], + [ + 'rtt_index:30', + 'rtt_state:orderly_stop', + 'rtt_type:script', + 'rtt_source_address:190.114.96.169', + 'rtt_target_address:0.0.0.0', + 'rtt_sense:timeout', + ], ] for tag_row in tag_rows: aggregator.assert_metric( @@ -256,8 +270,22 @@ def test_e2e_profile__cisco_generic(dd_agent_check): ) tag_rows = [ - ['rtt_index:26', 'rtt_state:inactive', 'rtt_type:tcp_connect'], - ['rtt_index:30', 'rtt_state:orderly_stop', 'rtt_type:script'], + [ + 'rtt_index:26', + 'rtt_state:inactive', + 'rtt_type:tcp_connect', + 'rtt_source_address:0.0.0.0', + 'rtt_target_address:190.114.96.169', + 'rtt_timeout:false', + ], + [ + 'rtt_index:30', + 'rtt_state:orderly_stop', + 'rtt_type:script', + 'rtt_source_address:190.114.96.169', + 'rtt_target_address:0.0.0.0', + 'rtt_timeout:true', + ], ] for tag_row in tag_rows: aggregator.assert_metric( diff --git a/snmp/tests/test_e2e_core_vs_python.py b/snmp/tests/test_e2e_core_vs_python.py index 758d0dc17e248..ed480e78b90b8 100644 --- a/snmp/tests/test_e2e_core_vs_python.py +++ b/snmp/tests/test_e2e_core_vs_python.py @@ -421,6 +421,8 @@ def test_e2e_profile_cisco_asa(dd_agent_check): 'temp_state', 'power_source', 'connection_type', + 'rtt_timeout', + 'rtt_sense', ], # Ignore tags that have mappings ) @@ -446,6 +448,8 @@ def test_e2e_profile_cisco_asa_5525(dd_agent_check): 'temp_state', 'power_source', 'connection_type', + 'rtt_timeout', + 'rtt_sense', ], # Ignore tags that have mappings ) diff --git a/snmp/tests/test_profiles.py b/snmp/tests/test_profiles.py index 0c8df1db09290..95a4b0c760e2b 100644 --- a/snmp/tests/test_profiles.py +++ b/snmp/tests/test_profiles.py @@ -2141,16 +2141,28 @@ def assert_cisco_asa(aggregator, profile): rtt_indexes = [1, 7, 10, 13, 15, 18, 20] rtt_types = [22, 21, 17, 6, 20, 8, 16] rtt_states = [3, 1, 6, 4, 6, 1, 6] - rtt_gauges = ['rttMonLatestRttOperCompletionTime', 'rttMonLatestRttOperSense', 'rttMonCtrlOperTimeoutOccurred'] + rtt_senses = [13, 30, 2, 21, 19, 20, 27] + rtt_timeouts = [1, 1, 2, 2, 1, 2, 1] + rtt_gauges = ['rttMonLatestRttOperCompletionTime', 'rttMonLatestRttOperSense'] for i in range(len(rtt_indexes)): tags = [ "rtt_index:{}".format(rtt_indexes[i]), "rtt_type:{}".format(rtt_types[i]), "rtt_state:{}".format(rtt_states[i]), + "rtt_sense:{}".format(rtt_senses[i]), ] + common_tags for rtt in rtt_gauges: aggregator.assert_metric('snmp.{}'.format(rtt), metric_type=aggregator.GAUGE, tags=tags) + for i in range(len(rtt_indexes)): + tags = [ + "rtt_index:{}".format(rtt_indexes[i]), + "rtt_type:{}".format(rtt_types[i]), + "rtt_state:{}".format(rtt_states[i]), + "rtt_timeout:{}".format(rtt_timeouts[i]), + ] + common_tags + aggregator.assert_metric('snmp.rttMonCtrlOperTimeoutOccurred', metric_type=aggregator.GAUGE, tags=tags) + aggregator.assert_all_metrics_covered() aggregator.assert_metrics_using_metadata(get_metadata_metrics(), check_submission_type=True)