[collectd] mapping read plugin outputs onto thresholds

Dave Cottlehuber dch at skunkwerks.at
Thu Jan 19 08:10:20 CET 2017


Ahoy

I have this working for load, cpu and these sorts of things already
since quite a few years, but can't quite find the incantation for curl. 

I'm trying to trigger a threshold & subsequent notification on result
from a curl plugin response code - basically < 300 is ok, 300+ is fail.
I have a large number of these curl results from a bunch of APIs.

I don't understand what values Type & DataSource should take, and how
they related to e.g. Plugin, Page, & response_time/response_code or
other matched values from collectd's read plugins in general. Any tips?

This is the value I get from the curl plugin (via csv/log output)

PUTVAL continuity.skunkwerks.at/curl-frontend/response_code
interval=1.000 1484777513.551:200.000000

here's my collectd.conf snippet:

##############################################################################
# Threshold configuration
<Plugin "curl">
  <Page "frontend">
    URL "https://wintermute.skunkwerks.at/"
    Timeout 2000
    MeasureResponseTime false
    MeasureResponseCode true
  </Page>
</Plugin>

<Plugin "threshold">
 <Plugin "curl">
  <Type "curl-frontend">
    DataSource "response_code"
    WarningMax 299
    Persist         true
    PersistOK       true
    Interesting     true
  </Type>
 </Type>
</Plugin>

collectd 5.6.0 FreeBSD amd64 11.0Rp7 with a few extra plugins enabled

A+
Dave



More information about the collectd mailing list