Define nagios targets using homename instead of fqdn

This commit is contained in:
Ossi Salmi 2012-12-04 11:21:39 +02:00
parent 756994efed
commit 5fb37a6050

View file

@ -2,7 +2,7 @@
# #
class nagios::target { class nagios::target {
@@nagios::host { $fqdn: @@nagios::host { $::homename:
group => $::domain, group => $::domain,
osname => $::operatingsystem, osname => $::operatingsystem,
osicon => $::osfamily ? { osicon => $::osfamily ? {
@ -12,7 +12,7 @@ class nagios::target {
} }
Nagios::Service { Nagios::Service {
host => $::fqdn, host => $::homename,
group => $::domain, group => $::domain,
} }
@ -23,7 +23,7 @@ class nagios::target {
# #
class nagios::target::ssh inherits nagios::target { class nagios::target::ssh inherits nagios::target {
@@nagios::service { "${fqdn}_ssh": @@nagios::service { "${::homename}_ssh":
command => "check_ssh", command => "check_ssh",
description => "SSH", description => "SSH",
} }
@ -35,7 +35,7 @@ class nagios::target::ssh inherits nagios::target {
# #
class nagios::target::http inherits nagios::target { class nagios::target::http inherits nagios::target {
@@nagios::service { "${fqdn}_http": @@nagios::service { "${::homename}_http":
command => "check_http", command => "check_http",
description => "HTTP", description => "HTTP",
} }
@ -47,7 +47,7 @@ class nagios::target::http inherits nagios::target {
# #
class nagios::target::https inherits nagios::target { class nagios::target::https inherits nagios::target {
@@nagios::service { "${fqdn}_https": @@nagios::service { "${::homename}_https":
command => "check_http!--ssl", command => "check_http!--ssl",
description => "HTTPS", description => "HTTPS",
} }
@ -59,7 +59,7 @@ class nagios::target::https inherits nagios::target {
# #
class nagios::target::smtp inherits nagios::target { class nagios::target::smtp inherits nagios::target {
@@nagios::service { "${fqdn}_smtp": @@nagios::service { "${::homename}_smtp":
command => "check_smtp", command => "check_smtp",
description => "SMTP", description => "SMTP",
} }
@ -137,7 +137,7 @@ class nagios::target::nrpe inherits nagios::target {
require => File["/etc/nrpe.d"], require => File["/etc/nrpe.d"],
notify => Service["nrpe"], notify => Service["nrpe"],
} }
@@nagios::service { "${fqdn}_disk": @@nagios::service { "${::homename}_disk":
command => "check_nrpe!check_disk", command => "check_nrpe!check_disk",
description => "Disk", description => "Disk",
} }
@ -151,7 +151,7 @@ class nagios::target::nrpe inherits nagios::target {
require => File["/etc/nrpe.d"], require => File["/etc/nrpe.d"],
notify => Service["nrpe"], notify => Service["nrpe"],
} }
@@nagios::service { "${fqdn}_load": @@nagios::service { "${::homename}_load":
command => "check_nrpe!check_load", command => "check_nrpe!check_load",
description => "Load", description => "Load",
} }
@ -165,17 +165,17 @@ class nagios::target::nrpe inherits nagios::target {
require => File["/etc/nrpe.d"], require => File["/etc/nrpe.d"],
notify => Service["nrpe"], notify => Service["nrpe"],
} }
@@nagios::service { "${fqdn}_swap": @@nagios::service { "${::homename}_swap":
command => "check_nrpe!check_swap", command => "check_nrpe!check_swap",
description => "Swap", description => "Swap",
} }
# @@nagios::service { "${fqdn}_users": # @@nagios::service { "${::homename}_users":
# command => "check_nrpe!check_users", # command => "check_nrpe!check_users",
# description => "Users", # description => "Users",
# } # }
# #
# @@nagios::service { "${fqdn}_procs": # @@nagios::service { "${::homename}_procs":
# command => "check_nrpe!check_total_procs", # command => "check_nrpe!check_total_procs",
# description => "Processes", # description => "Processes",
# } # }