From collectd Wiki
< Plugin:cURL-JSON
Revision as of 13:35, 14 September 2010 by Bmillemathias (talk | contribs) (Initial version of cookbook configuration (cherokee webserver))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page contains some example configurations for the cURL-JSON plugin. This page is meant as a cookbook, so if you have a configuration for an aspect not handled here or a daemon not present, please feel free to add anything that's useful for you.

http traffic statistics from Webserver Cherokee

This chapter will explain how to get information about traffic and connections for the Cherokee webserver.

Cherokee webserver exposes its statistics as JSON format which make easy to grab the values with collectd using Curl-JSON.

You'll need first to activate the "server info" handler to a Web directory; as this is beyond the scope of this example I suggest you to have a look to

  • Add the following configuration to collectd.
LoadPlugin curl_json
<Plugin curl_json>
     <URL "http://localhost/about/info/js">
     Instance "cherokee"

       <Key "traffic/tx">
       Type "httpd_bytes"

       <Key "traffic/rx">
         Type "httpd_bytes"

       <Key "connections/number">
           Type "httpd_connections"

  • You'll need to create a custom types.db and add it these definitions
httpd_bytes             count:COUNTER:0:134217728
httpd_connections       count:GAUGE:0:65535
httpd_requests          count:COUNTER:0:134217728
  • Finally add the new type Db to the configuration (and the standard one also else it won't be loaded)
TypesDB "/usr/share/collectd/types.db" "/etc/collectd/types.db.custom"