librato.librato
Ansible Role: Librato
An Ansible role that installs and configures the Librato Agent and plugins
Requirements
None
Dependencies
None
Quickstart
The bare minimum required to get started is to set the email and token variables and include the role:
- hosts: all
roles:
- { role: librato.librato, librato_email: '[email protected]', librato_token: 'your-token-here' }
By default, the following plugins are enabled: cpu, df, disk, swap, memory, load.
To include a plugin, set any variables you need for it, then add it to the librato_enabled_plugins variable:
- hosts: all
vars:
librato_apache_path: '/my-status-endpoint'
librato_enabled_plugins: ['apache']
Supported Plugins
cpudfmemoryloaddiskswapapachenginxnginx_plusjvmmemcachedvarnishzookeeperdockerelasticsearchmongodbpostgresqlmysqlredishaproxy
Usage
Using custom or upstream collectd plugins
To use your own custom or upstream collectd plugin, simply have another module drop the config into /opt/collectd/etc/collectd.conf.d/ and any custom plugins into /opt/collectd/share/collectd/.
Reference
Plugin: apache
librato_apache_protocolType: string
The protocol to use. Defaults to
http. Change this tohttpsif you require SSL.librato_apache_hostType: string
The hostname to use. Defaults to
localhost.librato.apache.pathType: string
The path to the status page. Defaults to
/server-status.?autois automatically appended, so no need to include it.librato_apache_userType: string
The username to use for password-protected status pages. Defaults to empty.
librato_apache_passwordType: string
The password to use for password-protected status pages. Defaults to empty.
Plugin: docker
librato_docker_protocolType: string
The protocol to use. Defaults to
http. Change this tohttpsif you require SSL.librato_docker_hostType: string
The Docker hostname. Defaults to
localhost.librato_docker_portType: string
The Docker port. Defaults to
2735
Plugin: elasticsearch
librato_elasticsearch_protocolType: string
The protocol to use. Defaults to
http. Change this tohttpsif you require SSL.librato_elasticsearch_hostType: string
The ElasticSearch hostname. Defaults to
localhost.librato_elasticsearch_port_Type: string
The ElasticSearch port. Defaults to
9200.librato_elasticsearch_cluster_nameType: string
The ElasticSearch cluster name, if set. Defaults to
nil.librato_elasticsearch_verboseType: true/false
Verbosity trigger of the plugin. Defaults to
true.
Plugin: haproxy
librato_haproxy_socket_fileType: string
The HAProxy socket file. Defaults to
/run/haproxy/admin.sock.librato_haproxy_proxiesType: array
The default proxies to collect. Defaults to
server,frontend,backend.
Plugin: jvm
librato_jvm_hostType: string
The JVM host. Defaults to
localhost.librato_jvm_service_urlType: string
The JVM service URL to query. Defaults to
service:jmx:rmi:///jndi/rmi://localhost:17264/jmxrmi.librato_jvm_mbeansType: mapping
Additional mbeans to collect. Defaults to empty.
Format of the mapping is:
librato_jvm_mbeans: [ { name: 'mbean name' object_name: 'object name' instance_prefix': 'instance prefix (optional)', instance_from': 'instance from (optional)', values: [ { type: 'value type', table: true|false, attribute: 'attribute' instance_prefix: 'instance prefix (optional)', instance_from: 'instance from (optional)' } ] } ]
Plugin: memcached
librato_memcached_hostType: string
The memcached hostname. Defaults to
localhost.librato_memcached_portType: string
The memcached port. Defaults to
11211.
Plugin: mongodb
librato_mongodb_hostType: string
The MongoDB hostname. Defaults to
localhost.librato_mongodb_portType: string
The MongoDB port. Defaults to
27017.librato_mongodb_userType: string
The MongoDB username to connect with. Defaults to
nil.librato_mongodb_passwordType: string
The MongoDB password to connect with. Defaults to
nil.librato_mongodb_databasesType: array
Databases to collect metrics for. Defaults to empty.
admindatabase is automatically included in the array.librato_mongodb_nameType: string
Set the name of the plugin instance. Defaults to
mongodb.
Plugin: mysql
librato_mysql_databasesType: mapping
Databases to collect metrics for. Defaults to empty.
Format of the hash is:
databases: [ { name: 'mydb' host: 'localhost' port: 3306 user: '' password: '' innodb_stats: true slave_stats: false } ]
Plugin: nginx
librato_nginx_protocolType: string
The protocol to use. Defaults to
http. Change this tohttpsif you require SSL.librato_nginx_hostType: string
The hostname to use. Defaults to
localhost.librato_nginx_pathType: string
The path to the status page. Defaults to
/basic_status.
Plugin: nginx_plus
librato_nginx_plus_protocolType: string
The protocol to use. Defaults to
http. Change this tohttpsif you require SSL.librato_nginx_plus_hostType: string
The hostname to use. Defaults to
localhost.librato_nginx_plus_pathType: string
The path to the status page. Defaults to
/status.librato_nginx_plus_verboseType: string
Verbosity on/off for the plugin. Defaults to
false.
Plugin: postgresql
librato_postgresql_socket_fileType: string
The PostgreSQL socket file. Defaults to
/var/run/postgresql.librato_postgresql_userType: string
The PostgreSQL user to connect as. Defaults to
postgresql.librato_postgresql_databasesType: mapping
The databases to collect metrics for. Defaults to empty.
The format of the hash is:
databases = [ { name: 'mydb' instance: 'baz' host: 'localhost' port: 5432 user: '' password: '' ssl_mode: 'prefer' } ]
Plugin: redis
librato_redis_hostType: string
The Redis hostname. Defaults to
localhost.librato_redis_portType: string
The Redis port. Defaults to
6379.librato_redis_timeoutType: string
The timeout for connecting to Redis in milliseconds. Defaults to
2000.
Plugin: varnish
Varnish has no configurable attributes.
Plugin: zookeeper
librato_zookeeper_hostType: string
The ZooKeeper hostname. Defaults to
localhost.librato_zookeeper_portType: string
The ZooKeeper port. Defaults to
2181.
Global Variables
librato_emailType: string
The email to use for sending metrics. Use in conjunction with
token. This attribute is required and defaults to empty.librato_tokenType: string
The API token to use for sending metrics. Use in conjunction with
email. This attribute is required and defaults to empty.librato_versionType: string
The version of the Librato Agent to install.
librato_repo_urlType: string
The base URL for the packages. Defaults to Librato's repo URL
https://packagecloud.io/librato/.librato_repo_baseType: string
The repo base to use. Defaults to Librato's repo collection
librato-collectd.librato_config_baseType: string
The base path for collectd's config files. Defaults to
/opt/collectd/etc.librato_plugin_config_pathType: string
The path for collectd's plugin configs. Defaults to
/opt/collectd/etc/collectd.conf.d.librato_hostnameType: string
The hostname to use for the node. Defaults to
nilin favor of usingFQDNLookup.librato_fqdn_lookupType: true/false
Perform an FQDN lookup for the hostname. Defaults to
true.librato_intervalType: integer
The global plugin polling interval in seconds. Defaults to
60.librato_use_log_fileType: true/false
Write collectd logs to a file. Defaults to
true.librato_use_syslogType: true/false
Write collectd logs to syslog. Defaults to
false.librato_use_logstashType: true/false
Write collectd logs to a logstash-formatted file. Defaults to
false.librato_log_file_log_levelType: string
The log level to use for
log_file. Defaults toinfo.librato_log_file_filenameType: string
The filename to use for
log_file. Defaults to/opt/collectd/var/log/collectd.log.librato_log_file_timestampType: true/false
Use timestamps in the log file or not. Defaults to
true.librato_log_file_print_severityType: true/false
Include severity levels in the log file or not. Defaults to
true.librato_syslog_log_levelType: string
The log level to use for
syslog. Defaults toinfo.librato_logstash_log_levelType: string
The log level to use for
logstash. Defaults toinfo.librato_logstash_filenameType: string
The file name to use for
logstash. Defaults to/opt/collectd/var/log/collectd.json.loglibrato_default_pluginsType: array
A list of default plugins to include. Defaults to:
cpu,df,disk,swap,memory,load.librato_enabled_pluginsType: array
A list of plugins to enable. This is separate from the default plugins and is used to include plugins aside from those. Defaults to empty.
Supported Platforms
- RHEL 6 / CentOS 6
- RHEL 7 / CentOS 7
- Fedora 23
- Amazon Linux 2016.03
- Ubuntu 12.04
- Ubuntu 14.04
- Ubuntu 15.04
- Ubuntu 15.10
- Ubuntu 16.04
- Debian 7
- Debian 8
Supported Ansible Versions
This role requires Ansible 2.2 or later.
Development
Testing
Integration tests utilize kitchen-ansible and serverspec. To run the test suite:
- Run
bundle install - Run
kitchen test
Testing Amazon Linux
Testing Amazon Linux through test-kitchen requires a bit more setup:
- Ensure
kitchen-ec2is installed:gem install kitchen-ec2 - Update
.kitchen.ymlto have the correct AWS key ID you're going to use - Set
security_group_idsin the driver section to include a security group accessible from your laptop. Not setting this will use thedefaultsecurity group. - Set
transport.ssh_keyto the path of your SSH key. It looks forid_rsaby default.
License
MIT
Authors & Contributors
Mike Julian (@mjulian)
ansible-galaxy install librato.librato