[collectd] Collectd write_graphite plugin send NaN values every 20 seconds

Joel Serrano joel at gogii.net
Wed Jan 27 04:52:35 CET 2016


Hi,

I'm using collectd's tail plugin to read from a logfile and send metrics to
influxdb via write_graphite plugin.

The strange thing is that when there are no new events in the logfile,
collectd still send metrics with "nan" value, every 20 seconds.

This makes influxdb complain:

[graphite] 2016/01/26 19:43:47 unable to parse line:
stats.server.13cn37.tail.fs.gauge.metric1 nan 1453866221: field
"stats.server.13cn37.tail.fs.gauge.metric1" value: 'NaN" is unsupported


My settings are very very simple:

1) collectd.conf: Load tail and write_graphite plugins.


2) The config for the write_graphite plugin:

<Plugin "write_graphite">
 <Node "cpd1">
   Host "graphite.example.com
   Port "2003"
   Prefix "stats.server."
   #Postfix ""
   Protocol "tcp"
   LogSendErrors true
   EscapeCharacter "."
   SeparateInstances true
   StoreRates false
   AlwaysAppendDS false
 </Node>
</Plugin>


3) The config for the tail plugin:

<Plugin "tail">
  <File "/usr/local/app/log/application.log">
    Instance "fs"
    <Match>
      Regex "^.*metric_name: metric1, metric_value: (.*)$"
      DSType "GaugeLast"
      Type "gauge"
      Instance "metric1"
    </Match>

    <Match>
      Regex "^.*metric_name: metric2, metric_value: (.*)$"
      DSType "GaugeLast"
      Type "gauge"
      Instance "metric2"
    </Match>

    <Match>
      Regex "^.*metric_name: metric3, metric_value: (.*)$"
      DSType "GaugeLast"
      Type "gauge"
      Instance "metric3"
    </Match>

    <Match>
      Regex "^.*metric_name: metric4, metric_value: (.*)$"
      DSType "GaugeLast"
      Type "gauge"
      Instance "metric4"
    </Match>

  </File>
</Plugin>



If there are new events in the logfile and the regex match, the values are
sent correctly, if the values don't match or there are no new events, then
they are all sent with "nan".

Any idea what can be happening?

InfluxDB: v0.9.5
collectd: v5.4.1


Thanks in advance.

Best regards,
Joel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20160126/9d550894/attachment-0001.html>


More information about the collectd mailing list