Skip to content

Instantly share code, notes, and snippets.

@dch

dch/json.conf Secret

Last active December 14, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dch/b31af6cae7cf5f525768 to your computer and use it in GitHub Desktop.
Save dch/b31af6cae7cf5f525768 to your computer and use it in GitHub Desktop.
collectd curl_json problem
Hostname "canary"
FQDNLookup false
Interval 5
LoadPlugin logfile
<Plugin logfile>
LogLevel "debug"
File "stdout"
Timestamp true
PrintSeverity true
</Plugin>
LoadPlugin csv
<Plugin csv>
DataDir "stdout"
StoreRates true
</Plugin>
LoadPlugin curl_json
LoadPlugin write_riemann
<Plugin curl_json>
<URL "https://qrng.anu.edu.au/API/jsonI.php?length=5&type=uint8">
#{
# "type": "uint8",
# "length": 5,
# "data": [ 20, 234, 108, 97, 13 ],
# "success": true
#}
Instance "random"
<Key "length">
Type "gauge"
</Key>
<Key "data/*">
Type "gauge"
</Key>
</URL>
<URL "http://www.cherokee-project.com/about/info/js">
#{
# "version": "Cherokee web server 1.2",
# "traffic": {
# "tx": 247971700722,
# "rx": 3793223698,
Instance "cherokee"
<Key "traffic/tx">
Type "gauge"
</Key>
</URL>
</Plugin>
$ collectd -C json.conf -T
option = ReadThreads; value = -1;
option = Hostname; value = canary;
option = FQDNLookup; value = false;
option = Interval; value = 5.000000;
Created new plugin context.
[2013-03-06 16:52:16] cf_dispatch: return (0)
[2013-03-06 16:52:16] type = logfile, key = Timestamp, value = true
[2013-03-06 16:52:16] cf_dispatch: return (0)
[2013-03-06 16:52:16] type = logfile, key = PrintSeverity, value = true
[2013-03-06 16:52:16] [debug] cf_dispatch: return (0)
[2013-03-06 16:52:16] [debug] type = csv, key = DataDir, value = stdout
[2013-03-06 16:52:16] [debug] cf_dispatch: return (0)
[2013-03-06 16:52:16] [debug] type = csv, key = StoreRates, value = true
[2013-03-06 16:52:16] [debug] cf_dispatch: return (0)
[2013-03-06 16:52:16] [debug] curl_json plugin: Registering new read callback: random
[2013-03-06 16:52:16] [debug] curl_json plugin: Registering new read callback: cherokee
[2013-03-06 16:52:16] [debug] Done parsing `/usr/local/share/collectd/types.db'
[2013-03-06 16:52:16] [debug] interval_g = 5.000;
[2013-03-06 16:52:16] [debug] timeout_g = 2;
[2013-03-06 16:52:16] [debug] hostname_g = canary;
[2013-03-06 16:52:18] [debug] Created new plugin context.
[2013-03-06 16:52:18] [debug] plugin_dispatch_values: time = 1362585138.613; interval = 5.000; host = canary; plugin = curl_json; plugin_instance = random; type = gauge; type_instance = length;
[2013-03-06 16:52:18] [debug] uc_insert: Added canary/curl_json-random/gauge-length to the cache.
[2013-03-06 16:52:18] [debug] plugin: plugin_write: Writing values via csv.
[2013-03-06 16:52:18] [debug] csv plugin: csv_write: filename = canary/curl_json-random/gauge-length;
[2013-03-06 16:52:18] [debug] curl_json plugin: cj_free (arg = 0x7fb318815e00);
PUTVAL canary/curl_json-random/gauge-length interval=5.000 1362585138.613:5.000000
[2013-03-06 16:52:18] [debug] Created new plugin context.
[2013-03-06 16:52:18] [debug] plugin_dispatch_values: time = 1362585138.693; interval = 5.000; host = canary; plugin = curl_json; plugin_instance = cherokee; type = gauge; type_instance = traffic-tx;
[2013-03-06 16:52:18] [error] curl_json plugin: yajl_parse failed: parse error: premature EOF
786845, "tx": 1634174
(right here) ------^
[2013-03-06 16:52:18] [debug] uc_insert: Added canary/curl_json-cherokee/gauge-traffic-tx to the cache.
[2013-03-06 16:52:18] [debug] plugin: plugin_write: Writing values via csv.
[2013-03-06 16:52:18] [debug] csv plugin: csv_write: filename = canary/curl_json-cherokee/gauge-traffic-tx;
PUTVAL canary/curl_json-cherokee/gauge-traffic-tx interval=5.000 1362585138.693:248008008202.000000
[2013-03-06 16:52:18] [error] curl_json plugin: curl_easy_perform failed with status 23: Failed writing body (0 != 1448) (http://www.cherokee-project.com/about/info/js)
[2013-03-06 16:52:18] [notice] read-function of plugin `curl_json-cherokee-http://www.cherokee-project.com/about/info/j' failed.
[2013-03-06 16:52:18] [debug] curl_json plugin: cj_free (arg = 0x7fb318823800);
[2013-03-06 16:52:18] [info] Exiting normally.
[2013-03-06 16:52:18] [info] collectd: Stopping 5 write threads.
[2013-03-06 16:52:18] [debug] plugin: stop_write_threads: Signalling `write_cond'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment