diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2009-12-11 14:24:55 -0500 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2009-12-11 14:24:55 -0500 |
commit | 6ec1a7278b66826b2e64589ab5336243b27cffdb (patch) | |
tree | a3d93bb8dfea6a7da7e89443397af0b824966af4 /manifests/service | |
parent | bf56902bf1411611dcedec95dbc49c654a07f347 (diff) |
add mysql commands and service
Diffstat (limited to 'manifests/service')
-rw-r--r-- | manifests/service/mysql.pp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp new file mode 100644 index 0000000..d09f335 --- /dev/null +++ b/manifests/service/mysql.pp @@ -0,0 +1,35 @@ +define nagios::service::mysql( + $ensure = present, + $check_hostname = 'localhost', + $check_socket = 'absent', + $check_username = 'nagios', + $check_password = '', + $check_database = '', + $check_mode = 'absent' +){ + + $real_check_mode = $check_mode ? { + 'absent' => 'tcp', + default => 'socket', + } + + case $real_check_mode { + # Check MySQL using TCP + 'tcp': { + nagios::service { 'mysql_tcp': + ensure => $ensure, + check_command => "check_mysql_tcp!${check_hostname}!${check_username}!${check_password}!${check_database}", + } + } + # Check MySQL using local socket + 'socket': { + nagios::service { 'mysql_socket': + ensure => $ensure, + check_command => $check_socket ? { + 'absent' => "check_mysql!${check_username}!${check_password}!${check_database}", + default => "check_mysql_socket!${check_socket}!${check_username}!${check_password}!${check_database}", + }, + } + } + } +} |