示例#1
0
def test_df_extra_metrics_all():
    agent_config = f"""
        monitors:
          - type: collectd/df
            extraMetrics:
            - '*'
        """
    run_agent_verify_all_metrics(agent_config, METADATA)
示例#2
0
def test_cpu_all():
    run_agent_verify_all_metrics(
        """
        monitors:
        - type: cpu
          extraMetrics: ["*"]
        """,
        METADATA,
    )
示例#3
0
def test_interface_all():
    run_agent_verify_all_metrics(
        """
        monitors:
        - type: collectd/interface
          extraMetrics: ["*"]
        """,
        METADATA,
    )
示例#4
0
def test_expvar_enhanced():
    with run_expvar() as expvar_container_ip:
        run_agent_verify_all_metrics(
            f"""
            monitors:
            - type: expvar
              host: {expvar_container_ip}
              port: 8080
              enhancedMetrics: true
            """,
            METADATA,
        )
示例#5
0
def test_zookeeper_all():
    with run_zookeeper() as host:
        run_agent_verify_all_metrics(
            f"""
            monitors:
            - type: collectd/zookeeper
              host: {host}
              port: 2181
              extraMetrics: ["*"]
            """,
            METADATA,
        )
示例#6
0
def test_windowsiis_all():
    # Required to make sure a worker (w3wp process) has started for process metrics.
    assert http_status("http://localhost", [200]), "IIS should be running on localhost"

    run_agent_verify_all_metrics(
        """
        monitors:
        - type: windows-iis
          extraMetrics: ["*"]
        """,
        METADATA,
    )
示例#7
0
def test_processes_all():
    run_agent_verify_all_metrics(
        """
        procPath: /proc
        monitors:
          - type: collectd/processes
            collectContextSwitch: true
            processMatch:
              collectd: ".*collectd.*"
        """,
        METADATA,
    )
示例#8
0
def test_memcached_all(version):
    with run_container(version) as container:
        host = container_ip(container)
        run_agent_verify_all_metrics(
            f"""
            monitors:
            - type: collectd/memcached
              host: {host}
              port: 11211
              extraMetrics: ["*"]
            """,
            METADATA,
        )
示例#9
0
def test_docker_enhanced():
    with run_service(
        "elasticsearch/6.6.1"
    ):  # just get a container that does some block io running so we have some stats
        run_agent_verify_all_metrics(
            f"""
            monitors:
            - type: collectd/docker
              dockerURL: unix:///var/run/docker.sock
              collectNetworkStats: true
            """,
            METADATA,
        )
示例#10
0
def test_activemq_all():
    with run_activemq() as host:
        config = f"""
        monitors:
        - type: collectd/activemq
          host: {host}
          port: 1099
          serviceURL: service:jmx:rmi:///jndi/rmi://{host}:1099/jmxrmi
          username: {JMX_USERNAME}
          password: {JMX_PASSWORD}
          extraMetrics: ["*"]
        """

        run_agent_verify_all_metrics(config, METADATA)
示例#11
0
def test_cassandra_all():
    with run_service("cassandra") as cassandra_cont:
        host = container_ip(cassandra_cont)

        # Wait for the JMX port to be open in the container
        assert wait_for(p(tcp_socket_open, host, 7199)), "Cassandra JMX didn't start"
        run_agent_verify_all_metrics(
            f"""
            monitors:
              - type: collectd/cassandra
                host: {host}
                port: 7199
                username: cassandra
                password: cassandra
                extraMetrics: ["*"]
            """,
            METADATA,
        )
示例#12
0
def test_collectd_vmem_all():
    agent = run_agent_verify_all_metrics(
        """
        monitors:
        - type: collectd/vmem
          extraMetrics: ["*"]
        """,
        METADATA,
    )
    assert not has_log_message(agent.output.lower(), "error"), "error found in agent output!"
示例#13
0
def test_uptime():
    agent = run_agent_verify_all_metrics(
        """
        monitors:
        - type: collectd/uptime
        """,
        METADATA,
    )
    assert not has_log_message(agent.output.lower(),
                               "error"), "error found in agent output!"
示例#14
0
def test_cpu_all():
    agent = run_agent_verify_all_metrics(
        """
        monitors:
        - type: cpu
          extraMetrics: ["*"]
        """,
        METADATA,
    )

    assert has_datapoint(agent.fake_services, metric_name="cpu.utilization_per_core", dimensions={"cpu": "0"})
def test_windowslegacy_all():
    agent = run_agent_verify_all_metrics(
        """
        monitors:
        - type: windows-legacy
          extraMetrics: ["*"]
        """,
        METADATA,
    )
    assert not has_log_message(agent.output.lower(),
                               "error"), "error found in agent output!"
def test_protocols_all():
    """
    Test that we get all metrics
    """
    agent = run_agent_verify_all_metrics(
        """
        monitors:
        - type: collectd/protocols
          extraMetrics: ["*"]
        """,
        METADATA,
    )
    assert not has_log_message(agent.output.lower(), "error"), "error found in agent output!"