# Global tags can be specified here in key="value" format.
[global_tags]
  # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  # rack = "1a"
  ## Environment variables can be used as tags, and throughout the config file
  # user = "$USER"
  device_id = ""
  device_model = "G1"

# Configuration for telegraf agent
[agent]
  interval = "30s"
  ## Rounds collection interval to 'interval'
  ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  round_interval = true

  ## This controls the size of writes that Telegraf sends to output plugins.
  metric_batch_size = 1000

  ## This buffer only fills when writes fail to output plugin(s).
  metric_buffer_limit = 10000

  ## Collection jitter is used to jitter the collection by a random amount.
  collection_jitter = "2s"

  ## Default flushing interval for all outputs. Maximum flush_interval will be
  ## flush_interval + flush_jitter
  flush_interval = "30s"
  flush_jitter = "5s"

  ## By default or when set to "0s", precision will be set to the same
  precision = ""

  ## Logging configuration:
  debug = true
  ## Run telegraf in quiet mode (error log messages only).
  quiet = false
  ## Specify the log file name. The empty string means to log to stderr.
  logfile = ""

  ## Override default hostname, if empty use os.Hostname()
  hostname = ""
  ## If set to true, do no set the "host" tag in the telegraf agent.
  omit_hostname = true

[[outputs.influxdb_v2]]
  ## The URLs of the InfluxDB cluster nodes.
  urls = ["https://chiefnetdev.influx.codingtown.com"]
#  urls = ["https://chiefnet.influx.yavar.in"]

  ## Token for authentication.
  #Development
  token = "wnVm-1S5VVOLrnBSrSsC-pFJ_XxEE_5UzeQoeeyInk-KWldVCaE2t2yoL33qu6_LXpaZ9N3NoE68QXllqjliJg=="
  #token = "RO3-FPcFHQf7tIMb3T95juvFOz0mANK1R4JeZzIaECnAmTriGv8CrwdZ5YdIgOZO335xcjQNb4dOsYzBBYOd_g=="
  #Production
  #token = "oPHveP8vlfAhwLgM9O3SAfQU_Fwyqf2h5Mu3rv8kgaopnalqUeP54LUblC6hgPUdNknDoIdVWckPOHdO6HZIEA=="

  ## Organization is the name of the organization you wish to write to; must exist.
  organization = "Yavar"

  ## Destination bucket to write into.
  bucket = "CPEDevice"

[[inputs.cpu]]
  ## Whether to report per-cpu stats or not
  percpu = true
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## If true, collect raw CPU time metrics.
  collect_cpu_time = false
  ## If true, compute and report the sum of all non-idle CPU states.
  report_active = false

[[inputs.disk]]
  # By default stats will be gathered for all mount points.
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]

[[inputs.diskio]]
[[inputs.mem]]
[[inputs.net]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]
[[inputs.temp]]
  # no configuration

#[[inputs.syslog]]
  ## Specify an ip or hostname with port - eg., tcp://localhost:6514, tcp://10.0.0.1:6514
#  server = "tcp://localhost:6514"
# max_connections = 1024

[[inputs.exec]]
  commands = ["ip -s -json address show"]
  timeout = "5s"
  name_suffix = "_mycollector"
  data_format = "json"
  tag_keys = ["ifname"]
  json_string_fields = ["*"]

[[inputs.exec]]
  commands = ["/etc/telegraf/custom_scripts/iftop.py"]
  timeout = "120s"
  data_format = "influx"

[[inputs.exec]]
  commands = ["/etc/telegraf/custom_scripts/active_hosts.py"]
  timeout = "5s"
  data_format = "influx"


[[inputs.exec]]
  commands = ["/etc/telegraf/custom_scripts/interface_state.py"]
  timeout = "5s"
  name_suffix = "_interface_state"
  data_format = "json"
  tag_keys = ["interface"]
  json_string_fields = ["*"]

[[inputs.exec]]
   commands = ["/etc/telegraf/custom_scripts/ping.py"]
   timeout = "10s"
   name_suffix = "_ping_status"
   data_format = "json"
   tag_keys = ["interface"]
   json_string_fields = ["*"]

[[inputs.exec]]
  commands = ["ip -json route list table all"]
  timeout = "60s"
  name_suffix = "_static_route"
  data_format = "json"
  tag_keys = ["dev"]
  json_string_fields = ["*"]

[[outputs.kafka]]
  ## URLs of kafka brokers
 brokers = ["chiefnet-kafka.yavar.in:9092"]
  ## Kafka topic for producer messages
 topic = "telegraf"
 data_format = "json"
 sasl_username = "admin"
 sasl_password = "Yavar@123$"
 insecure_skip_verify = true
 sasl_mechanism = "SCRAM-SHA-512"
 #namepass = ["temp","cpu","exec_ping_status","disk","mem","net","iftop_traffic"]