An Ansible role that installs and configures the Librato Agent and plugins
None
None
The bare minimum required to get started is to set the email and token variables and include the role:
- hosts: all
roles:
- { role: AerisCloud.librato, librato_email: 'you@domain.com', 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']cpudfmemoryloaddiskswapapachenginxnginx_plusjvmmemcachedvarnishzookeeperdockerelasticsearchmongodbpostgresqlmysqlredishaproxyinterface
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/.
-
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.
-
librato_df_fstypeType: array
The FSType to use. Defaults to
["ext2", "ext3", "ext4", "xfs", "jfs", "btrfs", "reiserfs", "vboxsf", "tmpfs"]. -
librato_df_deviceType: array
The Device to use. Defaults to
'' -
librato_df_mountpointType: array
The MountPoint to use. Defaults to
''
-
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
2375
-
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.
-
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.
Interface has no configurable attributes.
-
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)' } ] } ]
-
librato_memcached_hostType: string
The memcached hostname. Defaults to
localhost. -
librato_memcached_portType: string
The memcached port. Defaults to
11211.
-
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.
-
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 } ]
-
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.
-
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.
-
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' } ]
-
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.
Varnish has no configurable attributes.
-
librato_zookeeper_hostType: string
The ZooKeeper hostname. Defaults to
localhost. -
librato_zookeeper_portType: string
The ZooKeeper port. Defaults to
2181.
-
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_logging_use_log_fileType: true/false
Write collectd logs to a file. Defaults to
true. -
librato_logging_use_syslogType: true/false
Write collectd logs to syslog. Defaults to
false. -
librato_logging_use_logstashType: true/false
Write collectd logs to a logstash-formatted file. Defaults to
false. -
librato_logging_log_file_log_levelType: string
The log level to use for
log_file. Defaults toinfo. -
librato_logging_log_file_filenameType: string
The filename to use for
log_file. Defaults to/opt/collectd/var/log/collectd.log. -
librato_logging_log_file_timestampType: true/false
Use timestamps in the log file or not. Defaults to
true. -
librato_logging_log_file_print_severityType: true/false
Include severity levels in the log file or not. Defaults to
true. -
librato_logging_syslog_log_levelType: string
The log level to use for
syslog. Defaults toinfo. -
librato_logging_logstash_log_levelType: string
The log level to use for
logstash. Defaults toinfo. -
librato_logging_logstash_filenameType: string
The file name to use for
logstash. Defaults to/opt/collectd/var/log/collectd.json.log -
librato_default_pluginsType: array
A list of default plugins to include. Defaults to:
cpu,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.
- 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
This role requires Ansible 2.2 or later.
Integration tests utilize kitchen-ansible and serverspec. To run the test suite:
- Run
bundle install - Run
kitchen test. To run an individual test, runkitchen test [platform name]. E.g.kitchen test centos-7.
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.
MIT
Mike Julian (@mjulian)