From ea01b374853202cdd43fc202702658fafddb758e Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Fri, 17 Jun 2016 13:19:52 +0300 Subject: [PATCH] nagios: Added support for MySQL service target. --- nagios/files/commands.cfg | 6 ++++++ nagios/manifests/target.pp | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/nagios/files/commands.cfg b/nagios/files/commands.cfg index d03f167..cf186fe 100644 --- a/nagios/files/commands.cfg +++ b/nagios/files/commands.cfg @@ -162,6 +162,12 @@ define command{ } +# 'check_mysql' command definition +define command{ + command_name check_mysql + command_line $USER1$/check_mysql -H $HOSTADDRESS$ -n + } + # 'check_smb' command definition define command{ command_name check_smb diff --git a/nagios/manifests/target.pp b/nagios/manifests/target.pp index 5a3c3ca..b552e3f 100644 --- a/nagios/manifests/target.pp +++ b/nagios/manifests/target.pp @@ -246,6 +246,18 @@ class nagios::target::munin inherits nagios::target { } +# Configure mysql service target. +# +class nagios::target::mysql inherits nagios::target { + + @@nagios::service { "${::homename}_mysql": + command => "check_mysql", + description => "MySQL", + } + +} + + # Configure pop3 service target. # class nagios::target::pop3s inherits nagios::target {