Ejemplo n.º 1
0
def test_cisco(aggregator, session_mock):
    cisco_aci_check = CiscoACICheck(CHECK_NAME, {}, {})
    api = Api(ACI_URLS, USERNAME, PASSWORD, log=cisco_aci_check.log)
    api.sessions = [session_mock]
    api._refresh_sessions = False
    cisco_aci_check._api_cache[hash_mutable(CONFIG)] = api

    cisco_aci_check.check(CONFIG)
Ejemplo n.º 2
0
def test_cisco(aggregator, session_mock):
    cisco_aci_check = CiscoACICheck(conftest.CHECK_NAME, {}, {})
    api = Api(conftest.ACI_URLS, conftest.USERNAME,
              password=conftest.PASSWORD, log=cisco_aci_check.log, sessions=[session_mock])
    api._refresh_sessions = False
    cisco_aci_check._api_cache[hash_mutable(conftest.CONFIG)] = api

    cisco_aci_check.check(conftest.CONFIG)
Ejemplo n.º 3
0
def test_no_tenant(aggregator):
    api = ApiMock()
    check = CiscoACICheck(conftest.CHECK_NAME, {}, {})
    api._refresh_sessions = False
    check._api_cache[hash_mutable(hash_mutable({}))] = api
    tenant = Tenant(check, api, {}, None)
    tenant.collect()

    assert len(aggregator._metrics.items()) == 0
Ejemplo n.º 4
0
def test_cisco(aggregator):
    cisco_aci_check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = Api(common.ACI_URLS,
              cisco_aci_check.http,
              common.USERNAME,
              password=common.PASSWORD,
              log=cisco_aci_check.log)
    api.wrapper_factory = common.FakeSessionWrapper
    cisco_aci_check._api_cache[hash_mutable(common.CONFIG)] = api

    cisco_aci_check.check(common.CONFIG)
Ejemplo n.º 5
0
def test_get_eqpt_capacity(aggregator):
    check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = ApiMock()
    capacity = Capacity(
        api,
        instance={"tags": ["user_tag:1", "utag:2"]},
        check_tags=["check_tag:1", "ctag:2"],
        gauge=check.gauge,
        log=check.log,
    )
    capacity._get_eqpt_capacity()
    tags = ['fabric_pod_id:1', 'node_id:2', 'check_tag:1', 'ctag:2', 'user_tag:1', 'utag:2']
    hn = 'pod-1-node-2'
    aggregator.assert_metric('cisco_aci.capacity.leaf.policy_cam.utilized', value=8.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric('cisco_aci.capacity.leaf.vlan.limit', value=5.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric('cisco_aci.capacity.leaf.ipv6_endpoint.limit', value=2.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric('cisco_aci.capacity.leaf.policy_cam.limit', value=7.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric('cisco_aci.capacity.leaf.ipv4_endpoint.limit', value=1.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.ipv6_endpoint.utilized', value=4.0, tags=tags, hostname=hn, count=1
    )
    aggregator.assert_metric('cisco_aci.capacity.leaf.vlan.utilized', value=6.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric('cisco_aci.capacity.leaf.multicast.limit', value=9.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric('cisco_aci.capacity.leaf.multicast.utilized', value=10.0, tags=tags, hostname=hn, count=1)
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.ipv4_endpoint.utilized', value=3.0, tags=tags, hostname=hn, count=1
    )

    # Assert coverage for this check on this instance
    aggregator.assert_all_metrics_covered()
Ejemplo n.º 6
0
def test_get_apic_capacity_metrics(aggregator):
    check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = ApiMock()
    capacity = Capacity(
        api,
        instance={"tags": ["user_tag:1", "utag:2"]},
        check_tags=["check_tag:1", "ctag:2"],
        gauge=check.gauge,
        log=check.log,
    )
    capacity._get_apic_capacity_metrics()
    tags = ['check_tag:1', 'ctag:2', 'user_tag:1', 'utag:2']

    aggregator.assert_metric('cisco_aci.capacity.apic.endpoint.utilized', value=666.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.bridge_domain.utilized', value=666.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.tenant.utilized', value=666.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.private_network.utilized', value=666.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.endpoint_group.utilized', value=666.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.fabric_node.utilized', value=6.0, tags=tags, hostname='', count=1)

    # Assert coverage for this check on this instance
    aggregator.assert_all_metrics_covered()
Ejemplo n.º 7
0
def test_get_contexts(aggregator):
    check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = ApiMock()
    capacity = Capacity(
        api,
        instance={"tags": ["user_tag:1", "utag:2"]},
        check_tags=["check_tag:1", "ctag:2"],
        gauge=check.gauge,
        log=check.log,
    )
    capacity._get_contexts()
    tags = ['check_tag:1', 'ctag:2', 'user_tag:1', 'utag:2']

    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.utilized',
        value=666.0,
        tags=['fabric_pod_id:1', 'node_id:2'] + tags,
        hostname='pod-1-node-2',
        count=1,
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.utilized',
        value=666.0,
        tags=['fabric_pod_id:1', 'node_id:2'] + tags,
        hostname='pod-1-node-2',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:2'] + tags,
        hostname='pod-1-node-2',
        count=1,
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:2'] + tags,
        hostname='pod-1-node-2',
        count=1,
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.utilized',
        value=666.0,
        tags=['fabric_pod_id:1', 'node_id:2'] + tags,
        hostname='pod-1-node-2',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.limit',
        value=800.0,
        tags=['fabric_pod_id:1', 'node_id:2'] + tags,
        hostname='pod-1-node-2',
        count=1,
    )

    # Assert coverage for this check on this instance
    aggregator.assert_all_metrics_covered()
Ejemplo n.º 8
0
def test_config(aggregator, extra_config, expected_http_kwargs):
    instance = deepcopy(common.CONFIG_WITH_TAGS)
    instance.update(extra_config)
    check = CiscoACICheck(common.CHECK_NAME, {}, [instance])

    actual_options = {
        k: v
        for k, v in check.http.options.items() if k in expected_http_kwargs
    }
    assert expected_http_kwargs == actual_options
Ejemplo n.º 9
0
def test_get_apic_capacity_limits(aggregator):
    check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = ApiMock()
    capacity = Capacity(
        api,
        instance={"tags": ["user_tag:1", "utag:2"]},
        check_tags=["check_tag:1", "ctag:2"],
        gauge=check.gauge,
        log=check.log,
    )
    capacity._get_apic_capacity_limits()
    tags = ['check_tag:1', 'ctag:2', 'user_tag:1', 'utag:2']

    aggregator.assert_metric('cisco_aci.capacity.apic.tenant.limit', value=2.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric('cisco_aci.capacity.apic.service_graph.limit', value=8.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric('cisco_aci.capacity.apic.bridge_domain.limit', value=9.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.azure_domain.endpoint_group.limit', value=7.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.vmware_domain.endpoint_group.limit', value=11.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.fabric_node.limit', value=0.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric('cisco_aci.capacity.apic.contract.limit', value=1.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric('cisco_aci.capacity.apic.azure_domain.limit', value=4.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric('cisco_aci.capacity.apic.azure_domain.limit', value=6.0, tags=tags, hostname='', count=1)
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.endpoint_group.limit', value=10.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.private_network.limit', value=5.0, tags=tags, hostname='', count=1
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.endpoint.limit', value=3.0, tags=tags, hostname='', count=1)

    # Assert coverage for this check on this instance
    aggregator.assert_all_metrics_covered()
Ejemplo n.º 10
0
def test_tenant_end_to_end(aggregator, session_mock):
    check = CiscoACICheck(conftest.CHECK_NAME, {}, {})
    api = Api(conftest.ACI_URLS, conftest.USERNAME, conftest.PASSWORD, log=check.log, sessions=[session_mock])
    api._refresh_sessions = False
    check._api_cache[hash_mutable(conftest.CONFIG_WITH_TAGS)] = api

    check.check(conftest.CONFIG_WITH_TAGS)

    tags = ['project:cisco_aci', 'tenant:DataDog']
    # TODO pretty much everything is 0 and without hostname??
    metric_name = 'cisco_aci.tenant.ingress_bytes.multicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.multicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.multicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.health'
    aggregator.assert_metric(metric_name, value=99.0, tags=tags, hostname='')

    metric_name = 'cisco_aci.tenant.overall_health'
    aggregator.assert_metric(metric_name, value=99.0, tags=tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.unicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.unicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.application.fault_counter'
    aggregator.assert_metric(metric_name, value=0.0, tags=['application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.fault_counter'
    aggregator.assert_metric(metric_name, value=4.0, tags=tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.flood.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.unicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.unicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.multicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.flood.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.unicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.multicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.unicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.drop.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.capacity.apic.fabric_node.utilized'
    aggregator.assert_metric(metric_name, value=0.0, tags=['project:cisco_aci', 'cisco'], hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.multicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.multicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.drop.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.unicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.multicast.cum'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.unicast.rate'
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Pay',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-MiscAppVMs',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Inv',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ord',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Ecomm',
                                                           'application:DtDg-AP1-EcommerceApp'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti2',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jetty_Controller',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:DtDg-Jeti1',
                                                           'application:DtDg-AP2-Jeti'] + tags, hostname='')
    aggregator.assert_metric(metric_name, value=0.0, tags=['endpoint_group:Test-EPG',
                                                           'application:DtDg-test-AP'] + tags, hostname='')

    # Assert coverage for this check on this instance
    aggregator.assert_all_metrics_covered()
Ejemplo n.º 11
0
def test_capacity_mocked(aggregator):
    check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = Api(common.ACI_URLS,
              check.http,
              common.USERNAME,
              password=common.PASSWORD,
              log=check.log)
    api.wrapper_factory = common.FakeCapacitySessionWrapper
    check._api_cache[hash_mutable(common.CONFIG_WITH_TAGS)] = api

    check.check(common.CONFIG_WITH_TAGS)

    tags = ['cisco', 'project:cisco_aci']
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.utilized',
        value=44.0,
        tags=['fabric_pod_id:1', 'node_id:101'] + tags,
        hostname='pod-1-node-101',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.utilized',
        value=1.0,
        tags=['fabric_pod_id:1', 'node_id:201'] + tags,
        hostname='pod-1-node-201',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.utilized',
        value=1.0,
        tags=['fabric_pod_id:1', 'node_id:202'] + tags,
        hostname='pod-1-node-202',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.utilized',
        value=34.0,
        tags=['fabric_pod_id:1', 'node_id:102'] + tags,
        hostname='pod-1-node-102',
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.endpoint_group.utilized',
                             value=205.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.private_network.utilized',
        value=85.0,
        tags=tags,
        hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:101'] + tags,
        hostname='pod-1-node-101',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:201'] + tags,
        hostname='pod-1-node-201',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:202'] + tags,
        hostname='pod-1-node-202',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.bridge_domain.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:102'] + tags,
        hostname='pod-1-node-102',
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.tenant.utilized',
                             value=90.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.utilized',
        value=94.0,
        tags=['fabric_pod_id:1', 'node_id:101'] + tags,
        hostname='pod-1-node-101',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.utilized',
        value=0.0,
        tags=['fabric_pod_id:1', 'node_id:201'] + tags,
        hostname='pod-1-node-201',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.utilized',
        value=0.0,
        tags=['fabric_pod_id:1', 'node_id:202'] + tags,
        hostname='pod-1-node-202',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.utilized',
        value=78.0,
        tags=['fabric_pod_id:1', 'node_id:102'] + tags,
        hostname='pod-1-node-102',
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.endpoint_group.limit',
                             value=15000.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:101'] + tags,
        hostname='pod-1-node-101',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:201'] + tags,
        hostname='pod-1-node-201',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:202'] + tags,
        hostname='pod-1-node-202',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.endpoint_group.limit',
        value=3500.0,
        tags=['fabric_pod_id:1', 'node_id:102'] + tags,
        hostname='pod-1-node-102',
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.endpoint.limit',
                             value=180000.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.endpoint.utilized',
                             value=76.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.bridge_domain.utilized',
                             value=154.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.vmware_domain.limit',
                             value=5.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.private_network.limit',
                             value=3000.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.utilized',
        value=32.0,
        tags=['fabric_pod_id:1', 'node_id:101'] + tags,
        hostname='pod-1-node-101',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.utilized',
        value=4.0,
        tags=['fabric_pod_id:1', 'node_id:201'] + tags,
        hostname='pod-1-node-201',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.utilized',
        value=4.0,
        tags=['fabric_pod_id:1', 'node_id:202'] + tags,
        hostname='pod-1-node-202',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.utilized',
        value=27.0,
        tags=['fabric_pod_id:1', 'node_id:102'] + tags,
        hostname='pod-1-node-102',
    )
    aggregator.assert_metric('cisco_aci.capacity.apic.contract.limit',
                             value=1000.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.azure_domain.endpoint_group.limit',
        value=9000.0,
        tags=tags,
        hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.fabric_node.limit',
                             value=200.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.bridge_domain.limit',
                             value=15000.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.fabric_node.utilized',
                             value=2.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.tenant.limit',
                             value=3000.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.limit',
        value=800.0,
        tags=['fabric_pod_id:1', 'node_id:101'] + tags,
        hostname='pod-1-node-101',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.limit',
        value=800.0,
        tags=['fabric_pod_id:1', 'node_id:201'] + tags,
        hostname='pod-1-node-201',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.limit',
        value=800.0,
        tags=['fabric_pod_id:1', 'node_id:202'] + tags,
        hostname='pod-1-node-202',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.leaf.vrf.limit',
        value=800.0,
        tags=['fabric_pod_id:1', 'node_id:102'] + tags,
        hostname='pod-1-node-102',
    )
    aggregator.assert_metric(
        'cisco_aci.capacity.apic.vmware_domain.endpoint_group.limit',
        value=15000.0,
        tags=tags,
        hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.azure_domain.limit',
                             value=5.0,
                             tags=tags,
                             hostname='')
    aggregator.assert_metric('cisco_aci.capacity.apic.service_graph.limit',
                             value=600.0,
                             tags=tags,
                             hostname='')
Ejemplo n.º 12
0
def test_tenant_mocked(aggregator):
    check = CiscoACICheck(common.CHECK_NAME, {}, {})
    api = Api(common.ACI_URLS,
              check.http,
              common.USERNAME,
              password=common.PASSWORD,
              log=check.log)
    api.wrapper_factory = common.FakeTenantSessionWrapper
    check._api_cache[hash_mutable(common.CONFIG_WITH_TAGS)] = api

    check.check(common.CONFIG_WITH_TAGS)

    tags = ['project:cisco_aci', 'tenant:DataDog']
    metric_name = 'cisco_aci.tenant.ingress_bytes.multicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.multicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.multicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.health'
    aggregator.assert_metric(metric_name, value=99.0, tags=tags, hostname='')

    metric_name = 'cisco_aci.tenant.overall_health'
    aggregator.assert_metric(metric_name, value=99.0, tags=tags, hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.unicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.unicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.application.fault_counter'
    aggregator.assert_metric(metric_name,
                             value=0.0,
                             tags=['application:DtDg-AP1-EcommerceApp'] + tags,
                             hostname='')
    aggregator.assert_metric(metric_name,
                             value=0.0,
                             tags=['application:DtDg-AP2-Jeti'] + tags,
                             hostname='')
    aggregator.assert_metric(metric_name,
                             value=0.0,
                             tags=['application:DtDg-test-AP'] + tags,
                             hostname='')

    metric_name = 'cisco_aci.tenant.fault_counter'
    aggregator.assert_metric(metric_name, value=4.0, tags=tags, hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.flood.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.unicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.unicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.multicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.flood.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.unicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_bytes.multicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.unicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.drop.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.capacity.apic.fabric_node.utilized'
    aggregator.assert_metric(metric_name,
                             value=0.0,
                             tags=['project:cisco_aci', 'cisco'],
                             hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.multicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.egress_pkts.multicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.drop.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.unicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_bytes.multicast.cum'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    metric_name = 'cisco_aci.tenant.ingress_pkts.unicast.rate'
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Pay', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-MiscAppVMs',
            'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Inv', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Ord', 'application:DtDg-AP1-EcommerceApp'] +
        tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Ecomm', 'application:DtDg-AP1-EcommerceApp'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti2', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=[
            'endpoint_group:DtDg-Jetty_Controller', 'application:DtDg-AP2-Jeti'
        ] + tags,
        hostname='',
    )
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:DtDg-Jeti1', 'application:DtDg-AP2-Jeti'] + tags,
        hostname='')
    aggregator.assert_metric(
        metric_name,
        value=0.0,
        tags=['endpoint_group:Test-EPG', 'application:DtDg-test-AP'] + tags,
        hostname='')

    # Assert coverage for this check on this instance
    aggregator.assert_all_metrics_covered()