@@ -88,7 +88,11 @@ def test_e2e_user_profiles(dd_agent_check):
88
88
'ups_name:testIdentName' ,
89
89
'device_namespace:default' ,
90
90
]
91
- tags = profile_tags + ["snmp_device:{}" .format (device_ip )]
91
+ tags = profile_tags + [
92
+ "snmp_device:{}" .format (device_ip ),
93
+ "device_ip:{}" .format (device_ip ),
94
+ "device_id:default:{}" .format (device_ip ),
95
+ ]
92
96
93
97
aggregator .assert_metric ('snmp.upsAdvBatteryNumOfBattPacks' , metric_type = aggregator .GAUGE , tags = tags , count = 2 )
94
98
aggregator .assert_metric (
@@ -116,6 +120,8 @@ def test_e2e_user_profiles(dd_agent_check):
116
120
'sys_object_id' : '1.3.6.1.4.1.318.1.999' ,
117
121
'tags' : [
118
122
'device_namespace:default' ,
123
+ "device_id:default:" + device_ip ,
124
+ "device_ip:" + device_ip ,
119
125
'firmware_version:2.0.3-test' ,
120
126
'model:APC Smart-UPS 600' ,
121
127
'serial_num:test_serial' ,
@@ -146,7 +152,11 @@ def test_e2e_user_profiles_that_extend_profile_with_same_name(dd_agent_check):
146
152
'snmp_profile:palo-alto' ,
147
153
'device_namespace:default' ,
148
154
]
149
- tags = profile_tags + ["snmp_device:{}" .format (device_ip )]
155
+ tags = profile_tags + [
156
+ "snmp_device:{}" .format (device_ip ),
157
+ "device_ip:{}" .format (device_ip ),
158
+ "device_id:default:{}" .format (device_ip ),
159
+ ]
150
160
151
161
aggregator .assert_metric ('snmp.panSessionUtilization' , metric_type = aggregator .GAUGE , tags = tags , count = 2 )
152
162
aggregator .assert_metric ('snmp.panSessionUtilization_user' , metric_type = aggregator .GAUGE , tags = tags , count = 2 )
@@ -166,6 +176,8 @@ def test_e2e_user_profiles_that_extend_profile_with_same_name(dd_agent_check):
166
176
'sys_object_id' : '1.3.6.1.4.1.25461.2.3.18' ,
167
177
'tags' : [
168
178
'device_namespace:default' ,
179
+ "device_id:default:" + device_ip ,
180
+ "device_ip:" + device_ip ,
169
181
'snmp_device:' + device_ip ,
170
182
'snmp_profile:palo-alto' ,
171
183
],
@@ -190,7 +202,13 @@ def assert_apc_ups_metrics(dd_agent_check, config):
190
202
'device_vendor:apc' ,
191
203
'device_namespace:default' ,
192
204
]
193
- tags = profile_tags + ["snmp_device:{}" .format (instance ['ip_address' ])]
205
+ device_ip = instance ['ip_address' ]
206
+
207
+ tags = profile_tags + [
208
+ "snmp_device:{}" .format (device_ip ),
209
+ "device_ip:{}" .format (device_ip ),
210
+ "device_id:default:{}" .format (device_ip ),
211
+ ]
194
212
195
213
common .assert_common_metrics (aggregator , tags , is_e2e = True , loader = 'core' )
196
214
aggregator .assert_metric (
@@ -237,7 +255,13 @@ def test_e2e_memory_cpu_f5_big_ip(dd_agent_check):
237
255
'snmp_host:f5-big-ip-adc-good-byol-1-vm.c.datadog-integrations-lab.internal' ,
238
256
'snmp_profile:f5-big-ip' ,
239
257
]
240
- tags += ['snmp_device:{}' .format (instance ['ip_address' ])]
258
+ device_ip = instance ['ip_address' ]
259
+
260
+ tags += [
261
+ "snmp_device:{}" .format (device_ip ),
262
+ "device_ip:{}" .format (device_ip ),
263
+ "device_id:default:{}" .format (device_ip ),
264
+ ]
241
265
242
266
common .assert_common_metrics (aggregator , tags , is_e2e = True , loader = 'core' )
243
267
@@ -283,6 +307,8 @@ def test_e2e_core_discovery(dd_agent_check):
283
307
# autodiscovery
284
308
'autodiscovery_subnet:' + network ,
285
309
'snmp_device:' + ip_address ,
310
+ "device_ip:" + ip_address ,
311
+ "device_id:default:" + ip_address ,
286
312
]
287
313
288
314
tags_with_loader = tags + ['loader:core' ]
@@ -356,6 +382,7 @@ def test_e2e_regex_match(dd_agent_check):
356
382
]
357
383
config ['init_config' ]['loader' ] = 'core'
358
384
aggregator = common .dd_agent_check_wrapper (dd_agent_check , config , rate = True )
385
+ device_ip = instance ['ip_address' ]
359
386
360
387
# raw sysName: 41ba948911b9
361
388
aggregator .assert_metric (
@@ -366,7 +393,9 @@ def test_e2e_regex_match(dd_agent_check):
366
393
'letter1:4' ,
367
394
'letter2:1' ,
368
395
'loader:core' ,
369
- 'snmp_device:' + instance ['ip_address' ],
396
+ 'snmp_device:' + device_ip ,
397
+ 'device_ip:' + device_ip ,
398
+ 'device_id:default:' + device_ip ,
370
399
'device_namespace:default' ,
371
400
],
372
401
)
@@ -391,6 +420,8 @@ def test_e2e_meraki_cloud_controller(dd_agent_check):
391
420
'device_vendor:meraki' ,
392
421
'device_namespace:default' ,
393
422
'snmp_device:' + ip_address ,
423
+ "device_ip:" + ip_address ,
424
+ "device_id:default:" + ip_address ,
394
425
]
395
426
396
427
common .assert_common_metrics (aggregator , tags = common_tags , is_e2e = True , loader = 'core' )
@@ -485,8 +516,14 @@ def test_e2e_core_detect_metrics_using_apc_ups_metrics(dd_agent_check):
485
516
# metric_tags from _base.yaml
486
517
'snmp_host:APC_UPS_NAME' ,
487
518
]
519
+ device_ip = instance ['ip_address' ]
488
520
489
- tags = global_metric_tags + ['device_namespace:default' , "snmp_device:{}" .format (instance ['ip_address' ])]
521
+ tags = global_metric_tags + [
522
+ 'device_namespace:default' ,
523
+ "snmp_device:{}" .format (device_ip ),
524
+ "device_ip:{}" .format (device_ip ),
525
+ "device_id:default:{}" .format (device_ip ),
526
+ ]
490
527
491
528
common .assert_common_metrics (aggregator , tags , is_e2e = True , loader = 'core' )
492
529
@@ -534,12 +571,15 @@ def test_e2e_core_cisco_csr(dd_agent_check):
534
571
config ['init_config' ]['loader' ] = 'core'
535
572
instance = config ['instances' ][0 ]
536
573
aggregator = common .dd_agent_check_wrapper (dd_agent_check , config , rate = True )
574
+ device_ip = instance ['ip_address' ]
537
575
538
576
global_tags = [
539
577
'snmp_profile:cisco-csr1000v' ,
540
578
'device_vendor:cisco' ,
541
579
'device_namespace:default' ,
542
- "snmp_device:{}" .format (instance ['ip_address' ]),
580
+ "snmp_device:{}" .format (device_ip ),
581
+ "device_ip:{}" .format (device_ip ),
582
+ "device_id:default:{}" .format (device_ip ),
543
583
]
544
584
545
585
common .assert_common_metrics (aggregator , global_tags , is_e2e = True , loader = 'core' )
@@ -570,12 +610,15 @@ def test_e2e_cisco_nexus(dd_agent_check):
570
610
config ['init_config' ]['loader' ] = 'core'
571
611
instance = config ['instances' ][0 ]
572
612
aggregator = common .dd_agent_check_wrapper (dd_agent_check , config , rate = True )
613
+ device_ip = instance ['ip_address' ]
573
614
574
615
common_tags = [
575
616
'snmp_profile:cisco-nexus' ,
576
617
'device_vendor:cisco' ,
577
618
'device_namespace:default' ,
578
- "snmp_device:{}" .format (instance ['ip_address' ]),
619
+ "snmp_device:{}" .format (device_ip ),
620
+ "device_ip:{}" .format (device_ip ),
621
+ "device_id:default:{}" .format (device_ip ),
579
622
'snmp_host:Nexus-eu1.companyname.managed' ,
580
623
]
581
624
@@ -786,6 +829,8 @@ def test_e2e_cisco_legacy_wlc(dd_agent_check):
786
829
'device_vendor:cisco' ,
787
830
'snmp_host:DDOGWLC' ,
788
831
'snmp_device:' + ip_address ,
832
+ "device_ip:" + ip_address ,
833
+ "device_id:default:" + ip_address ,
789
834
]
790
835
common .assert_common_metrics (aggregator , tags , is_e2e = True , loader = 'core' )
791
836
0 commit comments