COLLECTD-THRESHOLD(5)
π collectd-threshold β COLLECTD-THRESHOLD(5) β the collectd manual π
Okay bestie, this is the page for the Threshold plugin, and itβs giving βyour metrics are cute but Iβm gonna judge themβ energy. β¨
π NAME π
collectd-threshold β documentation of collectdβs Threshold plugin, aka the plugin that looks at your values and has opinions.
β¨ SYNOPSIS β¨
Hereβs the quick vibe:
LoadPlugin "threshold"
<Plugin "threshold">
<Type "foo">
WarningMin 0.00
WarningMax 1000.00
FailureMin 0.00
FailureMax 1200.00
Invert false
Instance "bar"
</Type>
</Plugin>
π¦ DESCRIPTION π¦
Starting with version 4.3.0, collectd has support for monitoring. By that we mean that the values are not only stored or sent somewhere, but that they are judged and, if a problem is recognized, acted upon. The only action the Threshold plugin takes itself is to generate and dispatch a notification. Other plugins can register to receive notifications and perform appropriate further actions.
Since systems and what you expect them to do differ a lot, you can configure thresholds for your values freely. This gives you a lot of flexibility but also a lot of responsibility. flexibility and responsibility, iconic combo π
Every time a value is out of range, a notification is dispatched. This means that the idle percentage of your CPU needs to be less then the configured threshold only once for a notification to be generated. Thereβs no such thing as a moving average or similar β at least not now.
Also, all values that match a threshold are considered to be relevant or βinterestingβ. As a consequence collectd will issue a notification if they are not received for Timeout iterations. The Timeout configuration option is explained in section βGLOBAL OPTIONSβ in collectd.conf(5). If, for example, Timeout is set to 2 (the default) and some hosts sends its CPU statistics to the server every 60 seconds, a notification will be dispatched after about 120 seconds. It may take a little longer because the timeout is checked only once each Interval on the server.
When a value comes within range again or is received after it was missing, an βOKAY-notificationβ is dispatched. we love a comeback story π«Ά
π CONFIGURATION π
Here is a configuration example to get you started. Read below for more information.
LoadPlugin "threshold"
<Plugin "threshold">
<Type "foo">
WarningMin 0.00
WarningMax 1000.00
FailureMin 0.00
FailureMax 1200.00
Invert false
Instance "bar"
</Type>
<Plugin "interface">
Instance "eth0"
<Type "if_octets">
FailureMax 10000000
DataSource "rx"
</Type>
</Plugin>
<Host "hostname">
<Type "cpu">
Instance "idle"
FailureMin 10
</Type>
<Plugin "memory">
<Type "memory">
Instance "cached"
WarningMin 100000000
</Type>
</Plugin>
<Type "load">
DataSource "midterm"
FailureMax 4
Hits 3
Hysteresis 3
</Type>
</Host>
</Plugin>
There are basically two types of configuration statements: The βHostβ, βPluginβ, and βTypeβ blocks select the value for which a threshold should be configured. The βPluginβ and βTypeβ blocks may be specified further using the βInstanceβ option. You can combine the block by nesting the blocks, though they must be nested in the above order, i.e. βHostβ may contain either βPluginβ and βTypeβ blocks, βPluginβ may only contain βTypeβ blocks and βTypeβ may not contain other blocks. If multiple blocks apply to the same value the most specific block is used. most specific wins, no cap
The other statements specify the threshold to configure. They must be included in a βTypeβ block. Currently the following statements are recognized:
FailureMax Value,WarningMax Valueβ sets the upper bound of acceptable values. If unset defaults to positive infinity. If a value is greater thanFailureMaxaFAILUREnotification will be created. If the value is greater thanWarningMaxbut less than (or equal to)FailureMaxaWARNINGnotification will be created.FailureMin Value,WarningMin Valueβ sets the lower bound of acceptable values. If unset defaults to negative infinity. If a value is less thanFailureMinaFAILUREnotification will be created. If the value is less thanWarningMinbut greater than (or equal to)FailureMinaWARNINGnotification will be created.DataSource DSNameβ some data sets have more than one βdata sourceβ. Interesting examples are the βif_octetsβ data set, which has received (βrxβ) and sent (βtxβ) bytes and the βdisk_opsβ data set, which holds βreadβ and βwriteβ operations. The system load data set, βloadβ, even has three data sources: βshorttermβ, βmidtermβ, and βlongtermβ. Normally, all data sources are checked against a configured threshold. If this is undesirable, or if you want to specify different limits for each data source, you can use theDataSourceoption to have a threshold apply only to one data source.Invert true|falseβ if set to true the range of acceptable values is inverted, i.e. values betweenFailureMinandFailureMax(WarningMinandWarningMax) are not okay. Defaults to false.Persist true|falseβ sets how often notifications are generated. If set to true one notification will be generated for each value that is out of the acceptable range. If set to false (the default) then a notification is only generated if a value is out of range but the previous value was okay. This applies to missing values, too: If set to true a notification about a missing value is generated once everyIntervalseconds. If set to false only one such notification is generated until the value appears again.PersistOK true|falseβ sets how OKAY notifications act. If set to true one notification will be generated for each value that is in the acceptable range. If set to false (the default) then a notification is only generated if a value is in range but the previous value was not.Percentage true|falseβ if set to true, the minimum and maximum values given are interpreted as percentage value, relative to the other data sources. This is helpful for example for the βdfβ type, where you may want to issue a warning when less than 5 % of the total space is available. Defaults to false.Hits Valueβ sets the number of occurrences which the threshold must be raised before to dispatch any notification or, in other words, the number ofIntervalsthat the threshold must be match before dispatch any notification.Hysteresis Valueβ sets the hysteresis value for threshold. The hysteresis is a method to prevent flapping between states, until a new received value for a previously matched threshold down below the threshold condition (WarningMax,FailureMinor everything else) minus the hysteresis value, the failure (respectively warning) state will be keep.Interesting true|falseβ if set to true (the default), a notification with severity βFAILUREβ will be created when a matching value list is no longer updated and purged from the internal cache. When this happens depends on the interval of the value list and the globalTimeoutsetting. See theIntervalandTimeoutsettings incollectd.conf(5)for details. If set to false, this event will be ignored.
πΈ SEE ALSO πΈ
Go peek at collectd(1) and collectd.conf(5) for the full lore. π
π AUTHOR π
Florian Forster <octo at collectd.org> π
Okay bye bestie β this page is from version 5.12.0.348.g93f9bdcb, dated 2024-12-18. Mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms