Skip to content
Browse files

Support nginx plugin

Add support for configuring the nginx plugin. Currently supports the
URL, user and password parameters only.
  • Loading branch information...
1 parent 9767a22 commit 878c50430d83fb9a2cecefbba6187158bef97021 @thsutton committed Jan 15, 2013
Showing with 21 additions and 8 deletions.
  1. +3 −0 manifests/configure.pp
  2. +7 −1 manifests/params.pp
  3. +11 −7 templates/collectd.conf.erb
View
3 manifests/configure.pp
@@ -14,6 +14,9 @@
$network_password = "",
$mysql_user = $collectd::params::mysql_user,
$mysql_password = $collectd::params::mysql_password,
+ $nginx_url = $collectd::params::nginx_url,
+ $nginx_user = $collectd::params::nginx_user,
+ $nginx_password = $collectd::params::nginx_password,
$types_dbs = []
) inherits collectd::params {
View
8 manifests/params.pp
@@ -6,11 +6,17 @@
# [*port*] - network port for client/server mode.
# [*mysql_user*] - username for mysql plugin.
# [*mysql_password*] - password for mysql plugin.
+# [*nginx_url*] - nginx status URL.
+# [*nginx_user*] - nginx status user.
+# [*nginx_password*] - nginx status password.
#
class collectd::params (
$port = 25826,
$mysql_user = 'collectd',
- $mysql_password = ''
+ $mysql_password = '',
+ $nginx_url = 'http://localhost/nginx_status',
+ $nginx_user = '',
+ $nginx_password = ''
) {
#
View
18 templates/collectd.conf.erb
@@ -158,7 +158,7 @@ LoadPlugin network
#LoadPlugin nfs
<% end -%>
<% if plugins.include? "nginx" -%>
-#LoadPlugin nginx
+LoadPlugin nginx
<% end -%>
<% if plugins.include? "notify_desktop" -%>
#LoadPlugin notify_desktop
@@ -711,15 +711,19 @@ LoadPlugin vmem
<% end -%>
<% if plugins.include? "nginx" -%>
-# TODO: support parameters here
-#<Plugin nginx>
-# URL "http://localhost/status?auto"
-# User "www-user"
-# Password "secret"
+<Plugin nginx>
+ URL "<%= nginx_url %>"
+<% if "" != nginx_user -%>
+ User "<%= nginx_user %>"
+<% end -%>
+<% if "" != nginx_password -%>
+ Password "<%= nginx_password %>"
+<% end -%>
+# TODO: support additional parameters
# VerifyPeer false
# VerifyHost false
# CACert "/etc/ssl/ca.crt"
-#</Plugin>
+</Plugin>
<% end -%>
<% if plugins.include? "notify_desktop" -%>

0 comments on commit 878c504

Please sign in to comment.
Something went wrong with that request. Please try again.