From a42cd0d304acf3e73c6a0d8b9c580fd503afe09a Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 23 Nov 2012 09:53:13 +0100 Subject: add new wrapper for dns hosts --- manifests/service/dns.pp | 9 +++++---- manifests/service/dns_host.pp | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 manifests/service/dns_host.pp (limited to 'manifests') diff --git a/manifests/service/dns.pp b/manifests/service/dns.pp index 715d9af..5ef6e3e 100644 --- a/manifests/service/dns.pp +++ b/manifests/service/dns.pp @@ -1,6 +1,7 @@ define nagios::service::dns( - $comment = $name, - $check_domain = $name, + $host_name = $::fqdn, + $comment = $name, + $check_domain = $name, $ip ){ if $name != $comment { @@ -12,7 +13,7 @@ define nagios::service::dns( nagios::service{ $check_name: check_command => "check_dns2!${check_domain}!${ip}", - host_name => $::fqdn, - service_description => "check if ${::fqdn} is resolving ${check_domain}"; + host_name => $host_name, + service_description => "check if ${::host_name} is resolving ${check_domain}"; } } diff --git a/manifests/service/dns_host.pp b/manifests/service/dns_host.pp new file mode 100644 index 0000000..b103350 --- /dev/null +++ b/manifests/service/dns_host.pp @@ -0,0 +1,19 @@ +define nagios::service::dns_host( + $host_alias, + $parent, + $ip +){ + nagios_host{$name: + address => $ip, + alias => $host_alias, + use => 'generic-host', + parents => $parent, + } + + nagios::service::dns{ + $host_name => $name, + $comment => 'public_ns', + $check_domain => 'glei.ch', + $ip => $ip, + } +} -- cgit v1.2.3