-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from pavel-shpilev/master
Fixing elasticsearch and redis plugins. Adding memcahed plugin.
- Loading branch information
Showing
10 changed files
with
123 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,7 @@ In chronological order: | |
* Hiera support | ||
* Windows support | ||
|
||
* Pav Shpilev <[email protected]> | ||
* Code restructure & bugfixes | ||
* Memcached plugin support | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
fail("No package defined for OS ${::operatingsystem}") | ||
} | ||
|
||
ensure_packages($pkg) | ||
ensure_packages([$pkg]) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 foldmethod=marker | ||
# | ||
# == Class: stackdriver::plugin::memcached | ||
# | ||
# Enable Memcached Agent Plugin for Stackdriver Agent | ||
# | ||
# === Parameters | ||
# --- | ||
# | ||
# [*conf*] | ||
# - Default - /opt/stackdriver/collectd/etc/collectd.d/memcached.conf | ||
# - Plugin configuration file | ||
# | ||
# [*host*] | ||
# - Default - localhost | ||
# - Target host | ||
# | ||
# [*port*] | ||
# - Default - 11211 | ||
# - Target port | ||
# | ||
# | ||
# === Usage | ||
# --- | ||
# | ||
# ==== Puppet Code | ||
# | ||
# Enable Memcached plugin via Puppet CODE: | ||
# | ||
# include '::stackdriver::plugin::memcached' | ||
# | ||
# ==== Hiera | ||
# | ||
# Enable Memcached plugin via Hiera: | ||
# | ||
# stackdriver::plugins: | ||
# - 'memcached' | ||
# | ||
class stackdriver::plugin::memcached( | ||
|
||
$config = '/opt/stackdriver/collectd/etc/collectd.d/memcached.conf', | ||
$host = 'localhost', | ||
$port = 11211, | ||
|
||
) { | ||
|
||
validate_string ( $config ) | ||
validate_string ( $host ) | ||
|
||
contain "${name}::config" | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 foldmethod=marker | ||
# | ||
# == Class: stackdriver::plugin::memcached::config | ||
# | ||
# Configures Memcached Agent Plugin for Stackdriver Agent | ||
# | ||
class stackdriver::plugin::memcached::config inherits stackdriver::plugin::memcached { | ||
|
||
file { $config: | ||
ensure => file, | ||
content => template("stackdriver/${::kernel}/${config}.erb"), | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0444', | ||
notify => Service[$::stackdriver::svc], | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
fail("No package defined for OS ${::operatingsystem}") | ||
} | ||
|
||
ensure_packages($pkg) | ||
ensure_packages([$pkg]) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
templates/Linux/opt/stackdriver/collectd/etc/collectd.d/memcached.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
LoadPlugin "memcached" | ||
<Plugin "memcached"> | ||
Host "<%= @host %>" | ||
Port "<%= @port %>" | ||
</Plugin> |