|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <LoadPlugin dbi>
- Globals false
- </LoadPlugin>
-
- <Plugin dbi>
- <Query "wsrep_ready">
- Statement "select replace(lower(VARIABLE_NAME), 'wsrep_', 'cluster.') as metric, replace(replace(VARIABLE_VALUE, 'ON', 1), 'OFF', 0) as value from information_schema.GLOBAL_STATUS where VARIABLE_NAME IN ('wsrep_ready', 'wsrep_connected');"
- MinVersion 50000
- <Result>
- Type "gauge"
- InstancesFrom "metric"
- ValuesFrom "value"
- </Result>
- </Query>
- <Query "wsrep_cluster_status">
- Statement "select replace(replace(lower(VARIABLE_NAME), 'wsrep_', ''), '_', '.') as metric, replace(replace(replace(VARIABLE_VALUE, 'Primary', 1), 'Non-Primary', 2), 'Disconnected', 3) as value from information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'wsrep_cluster_status';"
- MinVersion 50000
- <Result>
- Type "gauge"
- InstancesFrom "metric"
- ValuesFrom "value"
- </Result>
- </Query>
- <Query "wsrep_cluster">
- Statement "select replace(replace(lower(VARIABLE_NAME), 'wsrep_', 'cluster.'), 'cluster_size', 'size') as metric, VARIABLE_VALUE as value from information_schema.GLOBAL_STATUS where VARIABLE_NAME IN ('wsrep_cluster_size', 'wsrep_replicated', 'wsrep_replicated_bytes', 'wsrep_received_bytes', 'wsrep_received', 'wsrep_local_commits', 'wsrep_local_cert_failures', 'wsrep_local_send_queue', 'Slow_queries');"
- MinVersion 50000
- <Result>
- Type "gauge"
- InstancesFrom "metric"
- ValuesFrom "value"
- </Result>
- </Query>
- <Database "mysql_status">
- Driver "mysql"
- DriverOption "mysql_unix_socket" "{{ plugin.socket }}"
- DriverOption "username" "{{ plugin.username }}"
- DriverOption "password" "{{ plugin.password }}"
- DriverOption "dbname" "mysql"
- SelectDB "mysql"
- Query "wsrep_ready"
- Query "wsrep_cluster_status"
- Query "wsrep_cluster"
- </Database>
- </Plugin>
|