# Telegraf Configuration # # Telegraf is entirely plugin driven. All metrics are gathered from the # declared inputs, and sent to the declared outputs. # # Plugins must be declared in here to be active. # To deactivate a plugin, comment out the name and any variables. # # Use 'telegraf -config telegraf.conf -test' to see what metrics a config # file would generate. # # Environment variables can be used anywhere in this config file, simply prepend # them with $. For strings the variable must be within quotes (ie, "$STR_VAR"), # for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR) # 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" # Configuration for telegraf agent [agent] ## Default data collection interval for all inputs interval = "60s" ## Rounds collection interval to 'interval' ## ie, if interval="10s" then always collect on :00, :10, :20, etc. round_interval = true ## Telegraf will send metrics to outputs in batches of at most ## metric_batch_size metrics. ## This controls the size of writes that Telegraf sends to output plugins. metric_batch_size = 500 ## For failed writes, telegraf will cache metric_buffer_limit metrics for each ## output, and will flush this buffer on a successful write. Oldest metrics ## are dropped first when this buffer fills. ## This buffer only fills when writes fail to output plugin(s). metric_buffer_limit = 100 ## 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" ## By default or when set to "0s", precision will be set to the same ## timestamp order as the collection interval, with the maximum being 1s. ## ie, when interval = "10s", precision will be "1s" ## when interval = "250ms", precision will be "1ms" ## Precision will NOT be used for service inputs. It is up to each individual ## service input to set the timestamp at the appropriate precision. ## Valid time units are "ns", "us" (or "µs"), "ms", "s". precision = "" ## Logging configuration: ## Run telegraf with debug log messages. debug = false ## 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 = false ############################################################################### # OUTPUT PLUGINS # ############################################################################### [[outputs.dynatrace]] ## Dynatrace environment URL. url = "https://REPLACE-WITH-YOUR-ID.live.dynatrace.com/api/v2/metrics/ingest" # Dynatrace API token, needs metric v2 ingest scope activated api_token = "REPLACE-WITH-YOUR-API-TOKEN" prefix = "telegraf." ############################################################################### # INPUT PLUGINS # ############################################################################### [[inputs.snmp]] agents = [ "192.168.0.110:161" ] version = 2 community = "public" # System name (hostname) [[inputs.snmp.field]] is_tag = true name = "sysName" oid = "RFC1213-MIB::sysName.0" [[inputs.snmp.field]] is_tag = true name = "modelName" oid = "SYNOLOGY-SYSTEM-MIB::modelName.0" # model name of the Synology device [[inputs.snmp.field]] is_tag = true name = "serialNumber" oid = "SYNOLOGY-SYSTEM-MIB::serialNumber.0" # serial number of Synology device [[inputs.snmp.field]] is_tag = true name = "version" oid = "SYNOLOGY-SYSTEM-MIB::version.0" # DSM version that Synology is using # System interface table (network) [[inputs.snmp.table]] oid = "IF-MIB::ifTable" inherit_tags = ["sysName", "modelName", "serialNumber", "version"] [[inputs.snmp.table.field]] is_tag = true oid = "IF-MIB::ifDescr" # # Generic volume, CPU and memory telemetry # [[inputs.snmp.table]] oid = "HOST-RESOURCES-MIB::hrStorageTable" inherit_tags = ["sysName", "modelName", "serialNumber", "version"] [[inputs.snmp.table.field]] is_tag = true oid = "HOST-RESOURCES-MIB::hrStorageDescr" # System volume table [[inputs.snmp.field]] name = "ssCpuUser" oid = ".1.3.6.1.4.1.2021.11.9.0" # % of time Synology CPU is spending processing user code [[inputs.snmp.field]] name = "ssCpuSystem" oid = ".1.3.6.1.4.1.2021.11.10.0" # % of time Synology CPU is spent processing system-level code [[inputs.snmp.field]] name = "ssCpuIdle" oid = ".1.3.6.1.4.1.2021.11.11.0" # % of time Synology CPU is idle [[inputs.snmp.table]] oid = "UCD-SNMP-MIB::laTable" inherit_tags = ["sysName", "modelName", "serialNumber", "version"] [[inputs.snmp.table.field]] is_tag = true oid = "UCD-SNMP-MIB::laNames" # System load table [[inputs.snmp.field]] name = "memTotalSwap" oid = "UCD-SNMP-MIB::memTotalSwap.0" # Synology total swap memory [[inputs.snmp.field]] name = "memAvailSwap" oid = "UCD-SNMP-MIB::memAvailSwap.0" # Synology available swap memory [[inputs.snmp.field]] name = "memTotalReal" oid = "UCD-SNMP-MIB::memTotalReal.0" # Synology total real memory [[inputs.snmp.field]] name = "memAvailReal" oid = "UCD-SNMP-MIB::memAvailReal.0" # Synology available real memory [[inputs.snmp.field]] name = "memTotalFree" oid = "UCD-SNMP-MIB::memTotalFree.0" # Synology total free memory # # Synology NAS services # [[inputs.snmp.table.field]] name = "serviceUsersCIFS" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "1" # CIFS users table (i.e. # of users connected via CIFS) [[inputs.snmp.table.field]] name = "serviceUsersAFP" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "2" # AFP users table (i.e. # of users connected via AFP) [[inputs.snmp.table.field]] name = "serviceUsersNFS" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "3" # NFS users table (i.e. # of users connected via AFP) [[inputs.snmp.table.field]] name = "serviceUsersFTP" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "4" # FTP users table (i.e. # of users connected via FTP) [[inputs.snmp.table.field]] name = "serviceUsersSFTP" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "5" # SFTP users table (i.e. # of users connected via SFTP) [[inputs.snmp.table.field]] name = "serviceUsersHTTP" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "6" # HTTP users table (i.e. # of users connected via HTTP) [[inputs.snmp.table.field]] name = "serviceUsersTELNET" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "7" # Telnet users table (i.e. # of users connected via Telnet) [[inputs.snmp.table.field]] name = "serviceUsersSSH" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "8" # SSH users table (i.e. # of users connected via SSH) [[inputs.snmp.table.field]] name = "serviceUsersOTHER" oid = "SYNOLOGY-SERVICES-MIB::serviceUsers" oid_index_suffix = "9" # Other users table (i.e. users connected to a service not listed above) # # Synology-specific system telemetry # [[inputs.snmp.field]] name = "systemStatus" oid = "SYNOLOGY-SYSTEM-MIB::systemStatus.0" # Overall system status [[inputs.snmp.field]] name = "temperature" oid = "SYNOLOGY-SYSTEM-MIB::temperature.0" # Synology unit tempurature (drive temps are in SYNOLOGY-DISK-MIB) [[inputs.snmp.field]] name = "powerStatus" oid = "SYNOLOGY-SYSTEM-MIB::powerStatus.0" # Synology power status [[inputs.snmp.field]] name = "systemFanStatus" oid = "SYNOLOGY-SYSTEM-MIB::systemFanStatus.0" # Synology fan status [[inputs.snmp.field]] name = "cpuFanStatus" oid = "SYNOLOGY-SYSTEM-MIB::cpuFanStatus.0" # status of Synology's system fan [[inputs.snmp.field]] name = "modelName" oid = "SYNOLOGY-SYSTEM-MIB::modelName.0" # model name of the Synology device [[inputs.snmp.field]] name = "serialNumber" oid = "SYNOLOGY-SYSTEM-MIB::serialNumber.0" # serial number of Synology device [[inputs.snmp.field]] name = "version" oid = "SYNOLOGY-SYSTEM-MIB::version.0" # DSM version that Synology is using [[inputs.snmp.field]] name = "upgradeAvailable" oid = "SYNOLOGY-SYSTEM-MIB::upgradeAvailable.0" # Indicates if a new version of DSM is savailable to install