github.com/influxdata/telegraf@v1.30.3/config/testdata/telegraf-agent.toml (about)

     1  # Telegraf configuration
     2  
     3  # Telegraf is entirely plugin driven. All metrics are gathered from the
     4  # declared inputs.
     5  
     6  # Even if a plugin has no configuration, it must be declared in here
     7  # to be active. Declaring a plugin means just specifying the name
     8  # as a section with no variables. To deactivate a plugin, comment
     9  # out the name and any variables.
    10  
    11  # Use 'telegraf -config telegraf.toml -test' to see what metrics a config
    12  # file would generate.
    13  
    14  # One rule that plugins conform to is wherever a connection string
    15  # can be passed, the values '' and 'localhost' are treated specially.
    16  # They indicate to the plugin to use their own builtin configuration to
    17  # connect to the local system.
    18  
    19  # NOTE: The configuration has a few required parameters. They are marked
    20  # with 'required'. Be sure to edit those to make this configuration work.
    21  
    22  # Tags can also be specified via a normal map, but only one form at a time:
    23  [global_tags]
    24    dc = "us-east-1"
    25  
    26  # Configuration for telegraf agent
    27  [agent]
    28    # Default data collection interval for all plugins
    29    interval = "10s"
    30  
    31    # run telegraf in debug mode
    32    debug = false
    33  
    34    # Override default hostname, if empty use os.Hostname()
    35    hostname = ""
    36  
    37  
    38  ###############################################################################
    39  #                                  OUTPUTS                                    #
    40  ###############################################################################
    41  
    42  # Configuration for influxdb server to send metrics to
    43  [[outputs.influxdb]]
    44    # The full HTTP endpoint URL for your InfluxDB instance
    45    # Multiple urls can be specified for InfluxDB cluster support. Server to
    46    # write to will be randomly chosen each interval.
    47    urls = ["http://localhost:8086"] # required.
    48  
    49    # The target database for metrics. This database must already exist
    50    database = "telegraf" # required.
    51  
    52  [[outputs.influxdb]]
    53    urls = ["udp://localhost:8089"]
    54    database = "udp-telegraf"
    55  
    56  # Configuration for the Kafka server to send metrics to
    57  [[outputs.kafka]]
    58    # URLs of kafka brokers
    59    brokers = ["localhost:9092"]
    60    # Kafka topic for producer messages
    61    topic = "telegraf"
    62    # Telegraf tag to use as a routing key
    63    #  ie, if this tag exists, its value will be used as the routing key
    64    routing_tag = "host"
    65  
    66  
    67  ###############################################################################
    68  #                                  PLUGINS                                    #
    69  ###############################################################################
    70  
    71  # Read Apache status information (mod_status)
    72  [[inputs.apache]]
    73    # An array of Apache status URI to gather stats.
    74    urls = ["http://localhost/server-status?auto"]
    75  
    76  # Read metrics about cpu usage
    77  [[inputs.cpu]]
    78    # Whether to report per-cpu stats or not
    79    percpu = true
    80    # Whether to report total system cpu stats or not
    81    totalcpu = true
    82    # Comment this line if you want the raw CPU time metrics
    83    fieldexclude = ["cpu_time"]
    84  
    85  # Read metrics about disk usage by mount point
    86  [[inputs.diskio]]
    87    # no configuration
    88  
    89  # Read metrics from one or many disque servers
    90  [[inputs.disque]]
    91    # An array of URI to gather stats about. Specify an ip or hostname
    92    # with optional port and password. ie disque://localhost, disque://10.10.3.33:18832,
    93    # 10.0.0.1:10000, etc.
    94    #
    95    # If no servers are specified, then localhost is used as the host.
    96    servers = ["localhost"]
    97  
    98  # Read stats from one or more Elasticsearch servers or clusters
    99  [[inputs.elasticsearch]]
   100    # specify a list of one or more Elasticsearch servers
   101    servers = ["http://localhost:9200"]
   102  
   103    # set local to false when you want to read the indices stats from all nodes
   104    # within the cluster
   105    local = true
   106  
   107  # Read flattened metrics from one or more commands that output JSON to stdout
   108  [[inputs.exec]]
   109    # the command to run
   110    command = "/usr/bin/mycollector --foo=bar"
   111    name_suffix = "_mycollector"
   112  
   113  # Read metrics of haproxy, via socket or csv stats page
   114  [[inputs.haproxy]]
   115    # An array of address to gather stats about. Specify an ip on hostname
   116    # with optional port. ie localhost, 10.10.3.33:1936, etc.
   117    #
   118    # If no servers are specified, then default to 127.0.0.1:1936
   119    servers = ["http://myhaproxy.com:1936", "http://anotherhaproxy.com:1936"]
   120    # Or you can also use local socket(not work yet)
   121    # servers = ["socket:/run/haproxy/admin.sock"]
   122  
   123  # Read flattened metrics from one or more JSON HTTP endpoints
   124  [[inputs.http]]
   125    # a name for the service being polled
   126    name_override = "webserver_stats"
   127  
   128    # URL of each server in the service's cluster
   129    urls = [
   130      "http://localhost:9999/stats/",
   131      "http://localhost:9998/stats/",
   132    ]
   133  
   134    # HTTP method to use (case-sensitive)
   135    # method = "GET"
   136  
   137    data_format = "json"
   138  
   139  # Read metrics about disk IO by device
   140  [[inputs.diskio]]
   141    # no configuration
   142  
   143  # read metrics from a Kafka 0.9+ topic
   144  [[inputs.kafka_consumer]]
   145    ## kafka brokers
   146    brokers = ["localhost:9092"]
   147    ## topic(s) to consume
   148    topics = ["telegraf"]
   149    ## the name of the consumer group
   150    consumer_group = "telegraf_metrics_consumers"
   151    ## Offset (must be either "oldest" or "newest")
   152    offset = "oldest"
   153  
   154  # Read metrics from a LeoFS Server via SNMP
   155  [[inputs.leofs]]
   156    # An array of URI to gather stats about LeoFS.
   157    # Specify an ip or hostname with port. ie 127.0.0.1:4020
   158    #
   159    # If no servers are specified, then 127.0.0.1 is used as the host and 4020 as the port.
   160    servers = ["127.0.0.1:4021"]
   161  
   162  # Read metrics about memory usage
   163  [[inputs.mem]]
   164    # no configuration
   165  
   166  # Read metrics from one or many memcached servers
   167  [[inputs.memcached]]
   168    # An array of address to gather stats about. Specify an ip on hostname
   169    # with optional port. ie localhost, 10.0.0.1:11211, etc.
   170    #
   171    # If no servers are specified, then localhost is used as the host.
   172    servers = ["localhost"]
   173  
   174  # Telegraf plugin for gathering metrics from N Mesos masters
   175  [[inputs.mesos]]
   176    # Timeout, in ms.
   177    timeout = 100
   178    # A list of Mesos masters, default value is localhost:5050.
   179    masters = ["localhost:5050"]
   180    # Metrics groups to be collected, by default, all enabled.
   181    master_collections = ["resources","master","system","slaves","frameworks","messages","evqueue","registrar"]
   182  
   183  # Read metrics from one or many MongoDB servers
   184  [[inputs.mongodb]]
   185    # An array of URI to gather stats about. Specify an ip or hostname
   186    # with optional port add password. ie mongodb://user:auth_key@10.10.3.30:27017,
   187    # mongodb://10.10.3.33:18832, 10.0.0.1:10000, etc.
   188    #
   189    # If no servers are specified, then 127.0.0.1 is used as the host and 27107 as the port.
   190    servers = ["127.0.0.1:27017"]
   191  
   192  # Read metrics from one or many mysql servers
   193  [[inputs.mysql]]
   194    # specify servers via a url matching:
   195    #  [username[:password]@][protocol[(address)]]/[?tls=[true|false|skip-verify]]
   196    #  e.g.
   197    #    servers = ["root:root@http://10.0.0.18/?tls=false"]
   198    #    servers = ["root:passwd@tcp(127.0.0.1:3306)/"]
   199    #
   200    # If no servers are specified, then localhost is used as the host.
   201    servers = ["localhost"]
   202  
   203  # Read metrics about network interface usage
   204  [[inputs.net]]
   205    # By default, telegraf gathers stats from any up interface (excluding loopback)
   206    # Setting interfaces will tell it to gather these explicit interfaces,
   207    # regardless of status.
   208    #
   209    # interfaces = ["eth0", ... ]
   210  
   211  # Read Nginx's basic status information (ngx_http_stub_status_module)
   212  [[inputs.nginx]]
   213    # An array of Nginx stub_status URI to gather stats.
   214    urls = ["http://localhost/status"]
   215  
   216  # Ping given url(s) and return statistics
   217  [[inputs.ping]]
   218    # urls to ping
   219    urls = ["www.google.com"] # required
   220    # number of pings to send (ping -c <COUNT>)
   221    count = 1 # required
   222    # interval, in s, at which to ping. 0 == default (ping -i <PING_INTERVAL>)
   223    ping_interval = 0.0
   224    # ping timeout, in s. 0 == no timeout (ping -t <TIMEOUT>)
   225    timeout = 0.0
   226    # interface to send ping from (ping -I <INTERFACE>)
   227    interface = ""
   228  
   229  # Read metrics from one or many postgresql servers
   230  [[inputs.postgresql]]
   231    # specify address via a url matching:
   232    #   postgres://[pqgotest[:password]]@localhost[/dbname]?sslmode=[disable|verify-ca|verify-full]
   233    # or a simple string:
   234    #   host=localhost user=pqgotest password=... sslmode=... dbname=app_production
   235    #
   236    # All connection parameters are optional. By default, the host is localhost
   237    # and the user is the currently running user. For localhost, we default
   238    # to sslmode=disable as well.
   239    #
   240    # Without the dbname parameter, the driver will default to a database
   241    # with the same name as the user. This dbname is just for instantiating a
   242    # connection with the server and doesn't restrict the databases we are trying
   243    # to grab metrics for.
   244    #
   245  
   246    address = "sslmode=disable"
   247  
   248    # A list of databases to pull metrics about. If not specified, metrics for all
   249    # databases are gathered.
   250  
   251    # databases = ["app_production", "blah_testing"]
   252  
   253    # [[postgresql.servers]]
   254    # address = "influx@remoteserver"
   255  
   256  # Read metrics from one or many prometheus clients
   257  [[inputs.prometheus]]
   258    # An array of urls to scrape metrics from.
   259    urls = ["http://localhost:9100/metrics"]
   260  
   261  # Read metrics from one or many RabbitMQ servers via the management API
   262  [[inputs.rabbitmq]]
   263    # Specify servers via an array of tables
   264    # name = "rmq-server-1" # optional tag
   265    # url = "http://localhost:15672"
   266    # username = "guest"
   267    # password = "guest"
   268  
   269    # A list of nodes to pull metrics about. If not specified, metrics for
   270    # all nodes are gathered.
   271    # nodes = ["rabbit@node1", "rabbit@node2"]
   272  
   273  # Read metrics from one or many redis servers
   274  [[inputs.redis]]
   275    # An array of URI to gather stats about. Specify an ip or hostname
   276    # with optional port add password. ie redis://localhost, redis://10.10.3.33:18832,
   277    # 10.0.0.1:10000, etc.
   278    #
   279    # If no servers are specified, then localhost is used as the host.
   280    servers = ["localhost"]
   281  
   282  # Read metrics from one or many RethinkDB servers
   283  [[inputs.rethinkdb]]
   284    # An array of URI to gather stats about. Specify an ip or hostname
   285    # with optional port add password. ie rethinkdb://user:auth_key@10.10.3.30:28105,
   286    # rethinkdb://10.10.3.33:18832, 10.0.0.1:10000, etc.
   287    #
   288    # If no servers are specified, then 127.0.0.1 is used as the host and 28015 as the port.
   289    servers = ["127.0.0.1:28015"]
   290  
   291  # Read metrics about swap memory usage
   292  [[inputs.swap]]
   293    # no configuration
   294  
   295  # Read metrics about system load & uptime
   296  [[inputs.system]]
   297    # no configuration