mysqld-exporter
Ansible Role: MySQL Exporter
An Ansible Role that installs MySQL Exporter on RedHat/CentOS or Debian/Ubuntu.
Requirements
MySQL User with the following privileges
CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT PROCESS, REPLICATION CLIENT,
SELECT ON *.* TO 'exporter'@'localhost' WITH MAX_USER_CONNECTIONS 3;
FLUSH PRIVILEGES;
NOTE: It is recommended to set a max connection limit for the user to avoid overloading the server with monitoring scrapes under heavy load.
Role Variables
Mandatory variables
User, password, host and port for mysql_exporter.
prometheus_mysqld_exporter_env: 'user:password@(hostname:port)/'
Optional variables: general settings
User-configurable defaults:
prometheus_user: prometheus
prometheus_group: prometheus
prometheus_mysqld_exporter_version: 0.9.0
gosu_version: '1.10'
prometheus_install_path: /opt/prometheus
prometheus_log_path: /var/log/prometheus
prometheus_pid_path: /var/run/prometheus
Dependencies
None.
Example Playbook
- hosts: all
become: True
roles:
- abednarik.mysqld-exporter
vars:
prometheus_mysqld_exporter_env: 'exporter:password@(localhost:3306)/'
License
Author Information
This role was created in 2016 by Alejandro Bednarik
Note
Thus role is based on William-Yeh great work with ansible/prometheus. See https://github.com/William-Yeh/ansible-prometheus for more information.
Install
ansible-galaxy install abednarik/ansible-role-mysqld-exporter
License
gpl-3.0
Downloads
473
Owner
Proactive and responsible DevOps / System Engineer and Technical Lead with over 10 years of experience in IT Systems and Open Source.