diff options
Diffstat (limited to 'manifests/service/mysql.pp')
-rw-r--r-- | manifests/service/mysql.pp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index d501f06..2fde402 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -20,7 +20,19 @@ define nagios::service::mysql( if ($check_host == 'absent') { fail("Please specify a hostname, ip address or socket to check a mysql instance.") } + + if $check_name != undef { + $real_check_name = "!--name $check_name" + } + if $check_warning != undef { + $real_check_warning = "!--warning $check_warning" + } + + if $check_critical != undef { + $real_check_critical = "!--critical $check_critical" + } + case $check_mode { 'tcp': { if ($check_host == 'localhost') { @@ -42,6 +54,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_name}${real_check_warning}${real_check_critical}", } } |