diff --git a/nagios/files/commands.cfg b/nagios/files/commands.cfg index f2f3b97..4e42c13 100644 --- a/nagios/files/commands.cfg +++ b/nagios/files/commands.cfg @@ -155,6 +155,13 @@ define command{ } +# 'check_dig' command definition +define command{ + command_name check_dig + command_line $USER1$/check_dig -H $HOSTADDRESS$ -l $ARG1$ + } + + # 'check_dhcp' command definition define command{ command_name check_dhcp diff --git a/nagios/manifests/target.pp b/nagios/manifests/target.pp index 237e0c8..2da8861 100644 --- a/nagios/manifests/target.pp +++ b/nagios/manifests/target.pp @@ -40,6 +40,23 @@ class nagios::target($parent=undef) { } +# Configure dig service target. +# +# === Parameters +# +# $query: +# Address to query from DNS server. Defaults to localhost. +# +class nagios::target::dns ($query="localhost") inherits nagios::target { + + @@nagios::service { "${::homename}_dig": + command => "check_dig!${query}", + description => "DNS", + } + +} + + # Configure ssh service target. # class nagios::target::ssh inherits nagios::target {