Difference between revisions of "Plugin:cURL-JSON/Cherokee"
(→Statistics from Webserver Cherokee: Markup.) |
m |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Example config|cURL-JSON}} | {{Example config|cURL-JSON}} | ||
− | == | + | == Cherokee webserver == |
− | + | The ''Cherokee'' webserver exposes its statistics as [[JSON]] format which make easy to grab the values with collectd using the {{Plugin|cURL-JSON}}.<br/> | |
− | This chapter will explain how to get information about traffic and connections | + | This chapter will explain how to get information about traffic and connections from ''Cherokee''. This is an extract of a small article I wrote on my [http://damnpeople.fr/articles/monitoring_cherokee_with_collectd.html website]. |
− | In my case I just monitor a limited set of values (traffic, numbers of connections and I/O cache), but there are a lot of information provided by this handler. | + | In my case I just monitor a limited set of values (traffic, numbers of connections and I/O cache), but there are a lot of information provided by this handler. ''<nowiki><hint>Feel free to expand the config below!</hint></nowiki>'' |
− | In Cherokee, you'll need | + | In ''Cherokee'', you need to enable the statistics interface. For that you'll need to activate the ''server info'' handler in a web directory; as this is beyond the scope of this example I suggest you to have a look at the [http://www.cherokee-project.com/doc/modules_handlers_server_info.html documentation] |
− | + | Add the following configuration to your ''collectd.conf''. | |
− | LoadPlugin curl_json | + | # collectd.conf |
+ | LoadPlugin "curl_json" | ||
… | … | ||
− | <Plugin curl_json> | + | <Plugin "curl_json"> |
<nowiki><URL "http://localhost/about/info/js"></nowiki> | <nowiki><URL "http://localhost/about/info/js"></nowiki> | ||
− | + | Instance "cherokee" | |
− | + | ||
− | + | <Key "traffic/tx"> | |
− | + | Type "httpd_bytes" | |
− | + | </Key> | |
− | + | ||
− | + | <Key "traffic/rx"> | |
− | + | Type "httpd_bytes" | |
− | + | </Key> | |
− | + | ||
− | + | <Key "connections/number"> | |
− | + | Type "httpd_connections" | |
− | + | </Key> | |
− | + | ||
− | + | <Key "iocache/hits"> | |
− | + | Type "percent" | |
− | </ | + | </Key> |
+ | </URL> | ||
</Plugin> | </Plugin> | ||
− | URL defines the URL used to retrieve the JSON | + | <code>URL</code> defines the URL used to retrieve the [[JSON]] data, so it is likely to change for you. |
− | + | You'll need to create a custom {{Manpage|types.db|5}} and add these [[type]]s: | |
+ | # types.db | ||
httpd_bytes count:COUNTER:0:134217728 | httpd_bytes count:COUNTER:0:134217728 | ||
httpd_connections count:GAUGE:0:65535 | httpd_connections count:GAUGE:0:65535 | ||
httpd_requests count:COUNTER:0:134217728 | httpd_requests count:COUNTER:0:134217728 | ||
− | + | Finally add the new ''types.db'' to the ''collectd'' configuration. Since this overrides the default, you need to explicitly configure the default ''types.db'', too: | |
− | TypesDB "/usr/share/collectd/types.db" "/etc/collectd/types.db.custom" | + | # collectd.conf |
+ | TypesDB "/usr/share/collectd/types.db" | ||
+ | TypesDB "/etc/collectd/types.db.custom" | ||
− | + | === References === | |
− | + | * Cheroke Webserver<br />http://www.cherokee-project.com/ | |
− | + | * Cherokee Server Info Handler<br />http://www.cherokee-project.com/doc/modules_handlers_server_info.html |
Latest revision as of 01:23, 12 March 2020
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.
Cherokee webserver
The Cherokee webserver exposes its statistics as JSON format which make easy to grab the values with collectd using the cURL-JSON plugin.
This chapter will explain how to get information about traffic and connections from Cherokee. This is an extract of a small article I wrote on my website.
In my case I just monitor a limited set of values (traffic, numbers of connections and I/O cache), but there are a lot of information provided by this handler. <hint>Feel free to expand the config below!</hint>
In Cherokee, you need to enable the statistics interface. For that you'll need to activate the server info handler in a web directory; as this is beyond the scope of this example I suggest you to have a look at the documentation
Add the following configuration to your collectd.conf.
# collectd.conf LoadPlugin "curl_json" … <Plugin "curl_json"> <URL "http://localhost/about/info/js"> Instance "cherokee" <Key "traffic/tx"> Type "httpd_bytes" </Key> <Key "traffic/rx"> Type "httpd_bytes" </Key> <Key "connections/number"> Type "httpd_connections" </Key> <Key "iocache/hits"> Type "percent" </Key> </URL> </Plugin>
URL
defines the URL used to retrieve the JSON data, so it is likely to change for you.
You'll need to create a custom types.db(5) and add these types:
# types.db httpd_bytes count:COUNTER:0:134217728 httpd_connections count:GAUGE:0:65535 httpd_requests count:COUNTER:0:134217728
Finally add the new types.db to the collectd configuration. Since this overrides the default, you need to explicitly configure the default types.db, too:
# collectd.conf TypesDB "/usr/share/collectd/types.db" TypesDB "/etc/collectd/types.db.custom"
References
- Cheroke Webserver
http://www.cherokee-project.com/ - Cherokee Server Info Handler
http://www.cherokee-project.com/doc/modules_handlers_server_info.html