Created
September 22, 2015 05:27
-
-
Save d4rkstar/b9546f7a9101d091ae0c to your computer and use it in GitHub Desktop.
galera nodes icinga2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# INSTRUCTIONS | |
# 1) download the plugin from http://www.fromdual.com/galera-cluster-nagios-plugin-en | |
# 2) put the plugin inside your PluginDir (on ubuntu 14.04 lts is /usr/lib/nagios/plugins/) | |
# 3) add a user for checks if you need one: GRANT USAGE ON *.* TO 'check_db'@'[ip of your monitoring server]' IDENTIFIED BY '[password]'; | |
object CheckCommand "galera_nodes" { | |
import "plugin-check-command" | |
command = [ | |
PluginDir + "/check_galera_nodes.pl" | |
] | |
arguments = { | |
"-h" = { | |
value = "$galera_host$", | |
set_if = {{ return (macro("$galera_host$") != null) }} | |
} | |
"-p" = { | |
value = "$galera_password$", | |
set_if = {{ return macro("$galera_password$") != null }} | |
} | |
"-P" = { | |
value = "$galera_port$", | |
set_if = {{ return macro("$galera_port$") != null }} | |
} | |
"-S" = { | |
value = "$galera_socket$", | |
set_if = {{ return macro("$galera_socket$") != null }} | |
} | |
"-u" = { | |
value = "$galera_user$", | |
set_if = {{ return macro("$galera_user$") != null }} | |
} | |
"--nodes" = { | |
value = "$galera_nodes$", | |
set_if = {{ return macro("$galera_nodes$") != null }} | |
} | |
} | |
} | |
apply Service "galera-cluster" { | |
import "generic-service" | |
check_command = "galera_nodes" | |
vars.galera_host = "[ip of your cluster here]" | |
vars.galera_user = [username] | |
vars.galera_password = [password] | |
assign where host.name == NodeName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment