Example #1
0
def test_interface_included():
    run_agent_verify_included_metrics(
        """
        monitors:
        - type: collectd/interface
        """,
        METADATA,
    )
Example #2
0
def test_zookeeeper():
    with run_zookeeper() as host:
        run_agent_verify_included_metrics(
            f"""
            monitors:
            - type: collectd/zookeeper
              host: {host}
              port: 2181
            """,
            METADATA,
        )
Example #3
0
def test_mysql_included():
    with run_container("mysql:5.7", environment=ENV) as mysql:
        host_ip = container_ip(mysql)
        assert wait_for(p(tcp_socket_open, host_ip, 3306), 60), "service didn't start"

        create_db_activity(host_ip)

        run_agent_verify_included_metrics(
            f"""
            monitors:
            - type: collectd/mysql
              host: {host_ip}
              port: 3306
              username: {ENV["MYSQL_USER"]}
              password: {ENV["MYSQL_PASSWORD"]}
              databases:
                - name: {ENV["MYSQL_DATABASE"]}
            """,
            METADATA,
        )
Example #4
0
def test_protocols_included():
    """
    Test that we get all included metrics
    """
    agent = run_agent_verify_included_metrics(
        """
        monitors:
        - type: collectd/protocols
        """,
        METADATA,
    )
    assert not has_log_message(agent.output.lower(), "error"), "error found in agent output!"
Example #5
0
def test_df_included_metrics():
    agent_config = """
        monitors:
          - type: collectd/df
        """
    run_agent_verify_included_metrics(agent_config, METADATA)