summaryrefslogtreecommitdiff
path: root/manifests/service/dns.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/service/dns.pp')
-rw-r--r--manifests/service/dns.pp19
1 files changed, 19 insertions, 0 deletions
diff --git a/manifests/service/dns.pp b/manifests/service/dns.pp
new file mode 100644
index 0000000..5ef6e3e
--- /dev/null
+++ b/manifests/service/dns.pp
@@ -0,0 +1,19 @@
+define nagios::service::dns(
+ $host_name = $::fqdn,
+ $comment = $name,
+ $check_domain = $name,
+ $ip
+){
+ if $name != $comment {
+ $check_name = "${comment}_${name}_${::hostname}"
+ } else {
+ $check_name = "${name}_${::hostname}"
+ }
+
+ nagios::service{
+ $check_name:
+ check_command => "check_dns2!${check_domain}!${ip}",
+ host_name => $host_name,
+ service_description => "check if ${::host_name} is resolving ${check_domain}";
+ }
+}