From 410492dba715290b582f2562defe1a722f6a5ee4 Mon Sep 17 00:00:00 2001 From: Kameron Kenny <1267885+kkenny@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:57:21 -0400 Subject: [PATCH] add openweather config --- influxv2.env | 2 ++ telegraf/telegraf.conf | 73 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/influxv2.env b/influxv2.env index 952c367..6b2f7f1 100644 --- a/influxv2.env +++ b/influxv2.env @@ -4,3 +4,5 @@ DOCKER_INFLUXDB_INIT_PASSWORD=forty6and2 DOCKER_INFLUXDB_INIT_ORG=darkstar DOCKER_INFLUXDB_INIT_BUCKET=default_bucket DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=admintoken +INFLUX_TOKEN=CCF0xPlB2SE1c-SO8GMWQXQCE7DZPF3DbU0zNk_vu8Qtfij3hsKeAkBE4Os413ew3lZIhxLwAF3_SBnHIEiVuA== + diff --git a/telegraf/telegraf.conf b/telegraf/telegraf.conf index 3964b80..9d7555c 100644 --- a/telegraf/telegraf.conf +++ b/telegraf/telegraf.conf @@ -1,19 +1,66 @@ -# Output Configuration for telegraf agent +# Configuration for telegraf agent +[agent] + interval = "10s" + round_interval = true + metric_batch_size = 1000 + metric_buffer_limit = 10000 + collection_jitter = "0s" + flush_interval = "10s" + flush_jitter = "0s" + precision = "" + # quiet = false + # logtarget = "file" + # logfile = "" + # logfile_rotation_interval = "0d" + # logfile_rotation_max_size = "0MB" + # logfile_rotation_max_archives = 5 + # log_with_timezone = "" + hostname = "" + omit_hostname = false + [[outputs.influxdb_v2]] - ## The URLs of the InfluxDB cluster nodes. - ## - ## Multiple URLs can be specified for a single cluster, only ONE of the - ## urls will be written to each interval. - ## urls exp: http://127.0.0.1:8086 urls = ["http://influxdb.in.thelinuxpro.net:8086"] + token = "$INFLUX_TOKEN" + organization = "darkstar" + bucket = "openweather" + # bucket_tag = "" + # exclude_bucket_tag = false + # timeout = "5s" + # http_headers = {"X-Special-Header" = "Special-Value"} + # http_proxy = "http://corporate.proxy:3128" + # user_agent = "telegraf" + # content_encoding = "gzip" + # influx_uint_support = false + # tls_ca = "/etc/telegraf/ca.pem" + # tls_cert = "/etc/telegraf/cert.pem" + # tls_key = "/etc/telegraf/key.pem" + # insecure_skip_verify = false - ## Token for authentication. - token = "$DOCKER_INFLUXDB_INIT_ADMIN_TOKEN" +# Read flattened metrics from one or more JSON HTTP endpoints +[[inputs.httpjson]] + name = "OpenWeather" - ## Organization is the name of the organization you wish to write to; must exist. - organization = "$DOCKER_INFLUXDB_INIT_ORG" + servers = [ + "https://api.openweathermap.org/data/3.0/onecall?lat=39.918449474871075&lon=-85.92342403177487&appid=eff13820392937489d74a4560e9bff1e" + ] - ## Destination bucket to write into. - bucket = "$DOCKER_INFLUXDB_INIT_BUCKET" + response_timeout = "5s" + method = "GET" - insecure_skip_verify = true + # tag_keys = [ + # "my_tag_1", + # "my_tag_2" + # ] + + # tls_ca = "/etc/telegraf/ca.pem" + # tls_cert = "/etc/telegraf/cert.pem" + # tls_key = "/etc/telegraf/key.pem" + # insecure_skip_verify = false + + # [inputs.httpjson.parameters] + # event_type = "cpu_spike" + # threshold = "0.75" + + # [inputs.httpjson.headers] + # X-Auth-Token = "my-xauth-token" + # apiVersion = "v1"