-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add NetScout PFS health SNMP profile for CPU and memory metrics #24283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mirzanurkic-dd
wants to merge
4
commits into
master
Choose a base branch
from
mirza.nurkic/add-netscout-switch-profile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+160
−0
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e7e2afa
Add NetScout switch SNMP profile for CPU and memory metrics.
mirzanurkic-dd 79096da
Fix netscout-switch profile validation by excluding OSPF mixin.
mirzanurkic-dd ad21e4a
Assert snmp.memory.usage in netscout-switch E2E test.
mirzanurkic-dd 57eda43
Rename changelog entry to PR number 24283.
mirzanurkic-dd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add NetScout switch SNMP profile for CPU and memory metrics. | ||
58 changes: 58 additions & 0 deletions
58
snmp/datadog_checks/snmp/data/default_profiles/netscout-switch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Same coverage as generic-device.yaml except _generic-ospf.yaml, which triggers | ||
| # DuplicateOIDValidator failures (constant_value_one symbols without OID). | ||
| extends: | ||
| - _base.yaml | ||
| - _generic-if.yaml | ||
| - _generic-ip.yaml | ||
| - _generic-tcp.yaml | ||
| - _generic-udp.yaml | ||
|
|
||
| sysobjectid: | ||
| - 1.3.6.1.4.1.21671 | ||
| - 1.3.6.1.4.1.21671.* | ||
|
|
||
| metadata: | ||
| device: | ||
| fields: | ||
| vendor: | ||
| value: "netscout" | ||
| type: | ||
| value: "switch" | ||
| model: | ||
| symbol: | ||
| MIB: NTCT-PFS-HEALTH-MIB | ||
| OID: 1.3.6.1.4.1.21671.3.2.1.1.5.0 | ||
| name: nphDeviceModelName | ||
| serial_number: | ||
| symbol: | ||
| MIB: NTCT-PFS-HEALTH-MIB | ||
| OID: 1.3.6.1.4.1.21671.3.2.1.1.4.0 | ||
| name: nphDeviceSerialNumber | ||
|
|
||
| metrics: | ||
| - MIB: NTCT-PFS-HEALTH-MIB | ||
| table: | ||
| OID: 1.3.6.1.4.1.21671.3.2.1.1.6 | ||
| name: nphMemoryTable | ||
| symbols: | ||
| - OID: 1.3.6.1.4.1.21671.3.2.1.1.6.1.2 | ||
| name: memory.total | ||
| scale_factor: 1024 | ||
| - OID: 1.3.6.1.4.1.21671.3.2.1.1.6.1.3 | ||
| name: memory.free | ||
| scale_factor: 1024 | ||
| metric_tags: | ||
| - index: 1 | ||
| tag: nph_mgmt_index | ||
|
|
||
| - MIB: NTCT-PFS-HEALTH-MIB | ||
| table: | ||
| OID: 1.3.6.1.4.1.21671.3.2.1.1.7 | ||
| name: nphCPUTable | ||
| symbols: | ||
| - OID: 1.3.6.1.4.1.21671.3.2.1.1.7.1.2 | ||
| name: cpu.usage | ||
| metric_type: gauge | ||
| metric_tags: | ||
| - index: 1 | ||
| tag: nph_mgmt_index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| 1.3.6.1.2.1.1.1.0|4|netscout-switch Device Description | ||
| 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.21671 | ||
| 1.3.6.1.2.1.1.5.0|4|netscout-switch.device.name | ||
| 1.3.6.1.2.1.2.1.0|2|4 | ||
| 1.3.6.1.2.1.4.31.1.1.4.1|70|310637142 | ||
| 1.3.6.1.2.1.6.5.0|65|4698 | ||
| 1.3.6.1.2.1.7.8.0|70|6116206687099577350 | ||
| 1.3.6.1.4.1.21671.3.2.1.1.4.0|4|PF3250196025 | ||
| 1.3.6.1.4.1.21671.3.2.1.1.5.0|4|PFS5010 | ||
| 1.3.6.1.4.1.21671.3.2.1.1.6.1.2.1|66|8144288 | ||
| 1.3.6.1.4.1.21671.3.2.1.1.6.1.3.1|66|6682660 | ||
| 1.3.6.1.4.1.21671.3.2.1.1.7.1.2.1|66|36 |
89 changes: 89 additions & 0 deletions
89
snmp/tests/test_e2e_core_profiles/test_profile_netscout_switch.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # (C) Datadog, Inc. 2026-present | ||
| # All rights reserved | ||
| # Licensed under a 3-clause BSD style license (see LICENSE) | ||
|
|
||
| import pytest | ||
|
|
||
| from datadog_checks.dev.utils import get_metadata_metrics | ||
|
|
||
| from .. import common | ||
| from ..test_e2e_core_metadata import assert_device_metadata | ||
| from .utils import ( | ||
| assert_all_profile_metrics_and_tags_covered, | ||
| assert_common_metrics, | ||
| assert_extend_generic_if, | ||
| assert_extend_generic_ip, | ||
| assert_extend_generic_tcp, | ||
| assert_extend_generic_udp, | ||
| create_e2e_core_test_config, | ||
| get_device_ip_from_config, | ||
| ) | ||
|
|
||
| pytestmark = [pytest.mark.e2e, common.py3_plus_only, common.snmp_integration_only] | ||
|
|
||
|
|
||
| def test_e2e_profile_netscout_switch(dd_agent_check): | ||
| profile = 'netscout-switch' | ||
| config = create_e2e_core_test_config(profile) | ||
| aggregator = common.dd_agent_check_wrapper(dd_agent_check, config, rate=True) | ||
|
|
||
| ip_address = get_device_ip_from_config(config) | ||
| common_tags = [ | ||
| 'snmp_profile:netscout-switch', | ||
| 'snmp_host:netscout-switch.device.name', | ||
| 'device_hostname:netscout-switch.device.name', | ||
| 'device_namespace:default', | ||
| 'snmp_device:' + ip_address, | ||
| 'device_ip:' + ip_address, | ||
| 'device_id:default:' + ip_address, | ||
| 'agent_host:' + common.get_agent_hostname(), | ||
| ] | ||
|
|
||
| # --- TEST EXTENDED METRICS --- | ||
| assert_extend_generic_if(aggregator, common_tags) | ||
| assert_extend_generic_ip(aggregator, common_tags) | ||
| assert_extend_generic_tcp(aggregator, common_tags) | ||
| assert_extend_generic_udp(aggregator, common_tags) | ||
|
|
||
| # --- TEST METRICS --- | ||
| assert_common_metrics(aggregator, common_tags) | ||
|
|
||
| tag_row = ['nph_mgmt_index:1'] | ||
| aggregator.assert_metric('snmp.cpu.usage', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) | ||
| aggregator.assert_metric( | ||
| 'snmp.memory.total', | ||
| metric_type=aggregator.GAUGE, | ||
| tags=common_tags + tag_row, | ||
| value=8144288 * 1024, | ||
| ) | ||
| aggregator.assert_metric( | ||
| 'snmp.memory.free', | ||
| metric_type=aggregator.GAUGE, | ||
| tags=common_tags + tag_row, | ||
| value=6682660 * 1024, | ||
| ) | ||
| aggregator.assert_metric('snmp.memory.usage', metric_type=aggregator.GAUGE, tags=common_tags + tag_row) | ||
|
|
||
| # --- TEST METADATA --- | ||
| device = { | ||
| 'description': 'netscout-switch Device Description', | ||
| 'id': 'default:' + ip_address, | ||
| 'id_tags': ['device_namespace:default', 'snmp_device:' + ip_address], | ||
| 'ip_address': '' + ip_address, | ||
| 'name': 'netscout-switch.device.name', | ||
| 'profile': 'netscout-switch', | ||
| 'status': 1, | ||
| 'sys_object_id': '1.3.6.1.4.1.21671', | ||
| 'vendor': 'netscout', | ||
| 'device_type': 'switch', | ||
| 'model': 'PFS5010', | ||
| 'serial_number': 'PF3250196025', | ||
| 'integration': 'snmp', | ||
| } | ||
| device['tags'] = common_tags | ||
| assert_device_metadata(aggregator, device) | ||
|
|
||
| # --- CHECK COVERAGE --- | ||
| assert_all_profile_metrics_and_tags_covered(profile, aggregator) | ||
| aggregator.assert_all_metrics_covered() | ||
| aggregator.assert_metrics_using_metadata(get_metadata_metrics()) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.