Skip to content

Instantly share code, notes, and snippets.

@Jaff
Last active June 6, 2017 06:01
Show Gist options
  • Save Jaff/3a2024afaf44b9b5a448090f46a94fc8 to your computer and use it in GitHub Desktop.
Save Jaff/3a2024afaf44b9b5a448090f46a94fc8 to your computer and use it in GitHub Desktop.
telegraf configuration for mongodb monitoring
cat /etc/telegraf/telegraf.conf
############################# Generated by Chef #####################
[global_tags]
[agent]
## Default data collection interval for all inputs
interval = "30s"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
## Telegraf will cache metric_buffer_limit metrics for each output, and will
## flush this buffer on a successful write.
metric_buffer_limit = 1000
## Flush the buffer whenever full, regardless of flush_interval.
flush_buffer_when_full = true
## Collection jitter is used to jitter the collection by a random amount.
## Each plugin will sleep for a random time within jitter before collecting.
## This can be used to avoid many plugins querying things like sysfs at the
## same time, which can have a measurable effect on the system.
collection_jitter = "0s"
## Default flushing interval for all outputs. You shouldn't set this below
## interval. Maximum flush_interval will be flush_interval + flush_jitter
flush_interval = "10s"
## Jitter the flush interval by a random amount. This is primarily to avoid
## large write spikes for users running a large number of telegraf instances.
## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
flush_jitter = "0s"
## Run telegraf in debug mode
debug = false
## Run telegraf in non-quiet mode
quiet = true
## 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.graphite]]
servers = ["127.0.0.1:2003"]
-----------------
cat /etc/telegraf/telegraf.d/monitor_mongodb.conf
# Configuration for telegraf mongodb monitor
[[inputs.mongodb]]
## An array of URI to gather stats about. Specify an ip or hostname
## with optional port add password. ie,
## mongodb://user:[email protected]:27017,
## mongodb://10.10.3.33:18832,
## 10.0.0.1:10000, etc.
servers = ["mongodb://127.0.0.1:27017"]
gather_perdb_stats = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment