Saltstack Official Galera Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <LoadPlugin dbi>
  2. Globals false
  3. </LoadPlugin>
  4. <Plugin dbi>
  5. <Query "wsrep_ready">
  6. 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');"
  7. MinVersion 50000
  8. <Result>
  9. Type "gauge"
  10. InstancesFrom "metric"
  11. ValuesFrom "value"
  12. </Result>
  13. </Query>
  14. <Query "wsrep_cluster_status">
  15. 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';"
  16. MinVersion 50000
  17. <Result>
  18. Type "gauge"
  19. InstancesFrom "metric"
  20. ValuesFrom "value"
  21. </Result>
  22. </Query>
  23. <Query "wsrep_cluster">
  24. 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');"
  25. MinVersion 50000
  26. <Result>
  27. Type "gauge"
  28. InstancesFrom "metric"
  29. ValuesFrom "value"
  30. </Result>
  31. </Query>
  32. <Database "mysql_status">
  33. Driver "mysql"
  34. DriverOption "mysql_unix_socket" "{{ plugin.socket }}"
  35. DriverOption "username" "{{ plugin.username }}"
  36. DriverOption "password" "{{ plugin.password }}"
  37. DriverOption "dbname" "mysql"
  38. SelectDB "mysql"
  39. Query "wsrep_ready"
  40. Query "wsrep_cluster_status"
  41. Query "wsrep_cluster"
  42. </Database>
  43. </Plugin>