serverdensity_agent
Puppet module to install the Server Density monitoring agent and register servers automatically.
Version information
released Nov 26th 2015
This version is compatible with:
- RedHat, Ubuntu, Debian, CentOS
Start using this module
Add this module to your Puppetfile:
mod 'serverdensity-serverdensity_agent', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
serverdensity/serverdensity_agent — version 1.0.0 Nov 26th 2015
serverdensity_agent
Puppet Module for deploying the Server Density Agent and agent plugins
Platforms
- Ubuntu
- CentOS
Usage
This will create a new device, and then use the agent key provided automatically by the API to configure the agent on the node.
Create an API token by logging into your Server Density account, clicking your name top left, clicking Preferences then going to the Security tab.
class {
'serverdensity_agent':
sd_url => 'https://example.serverdensity.io',
api_token => 'APITOKENHERE',
}
Fixed key config
This will install the agent, with the basic configuration, using the key that is provided.
class {
'serverdensity_agent':
sd_url => 'https://example.serverdensity.io',
agent_key => '1234567890abcdef',
}
Installing an agent plugin
This will upload a plugin, and add custom config for it.
serverdensity_agent::plugin{ 'MyPlugin':
source => 'puppet:///mymodule/myplugin.py',
config => {
custom_key1 => 'foo',
}
}
NB - To access the value for custom_key1
from your plugin script, you can read it from the rawConfig dict, e.g:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = checksLogger
self.rawConfig = rawConfig
# Grab the custom key
self.key1 = self.rawConfig['MyPlugin']['custom_key1']
Optional Parameters
There are some optional parameters that can be used to configure other parts of the agent
$use_fqdn
- This will cause the class to use the facter Fully Qualified Domain Name rather than the detected hostname. Useful in times where the sd-agent and puppet disagree on what the hostname should be.$server_name
$server_group
- Sets the group for the server that is added$plugin_directory
- Sets the directory the agent looks for plugins, if left blank it is ignored$apache_status_url
- URL to get the Apache2 status page from (e.g.mod_status
), disabled if not set$apache_status_user
- Username to authenticate to the Apache2 status page, required ifapache_status_url
is set$apache_status_pass
- Password to authenticate to the Apache2 status page, required ifapache_status_url
is set$fpm_status_url
- URL to get the PHP-FPM status page from, disabled if not set$mongodb_server
- Server to get MongoDB status monitoring from, this takes a full MongoDB connection URI so you can set username/password etc. details here if needed, disabled if not set$mongodb_dbstats
- Enables MongoDB stats iftrue
andmongodb_server
is set, default:false
$mongodb_replset
- Enables MongoDB replset stats iftrue
andmongodb_server
is set, default:false
$mysql_server
- Server to get MySQL status monitoring from, disabled if not set$mysql_user
- Username to authenticate to MySQL, required ifmysql_server
is set$mysql_pass
- Password to authenticate to MySQL, required ifmysql_server
is set$nginx_status_url
- URL to get th Nginx status page from, disabled if not set$rabbitmq_status_url
- URL to get the RabbitMQ status from via HTTP management API, disabled if not set$rabbitmq_user
- Username to authenticate to the RabbitMQ management API, required ifrabbitmq_status_url
is set$rabbitmq_pass
- Password to authenticate to the RabbitMQ management API, required ifrabbitmq_status_url
is set$tmp_directory
- Override where the agent stores temporary files, system default tmp will be used if not set$pidfile_directory
- Override where the agent stores it's PID file, temp dir (above or system default) is used if not set$logging_level
- String. Logging level to use for agent. Defaults to INFO if not set.$logtail_paths
- String. Specify path match patterns to tail the files to post back. Comma separated: e.g./var/log/apache2/*.log,/var/log/*.log
. You must enable this in your account first.manage_services
- Allow puppet to manage the sd-agent service, default: true. Useful when using an alternative process manager, e.g supervisor
Dependencies
- puppetlabs/apt (>= 1.8.0)
- puppetlabs/stdlib (>= 3.0.0)
Simplified BSD License Copyright (c) 2014, Server Density <hello@serverdensity.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Boxed Ice nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.