2017-07-20 14:47:24 +01:00
|
|
|
## cd_nagios::client::target.pp
|
|
|
|
|
# Module name: nagios
|
|
|
|
|
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
|
|
|
|
# @summary CLass manages Nagios targets for cd_nagios.
|
|
|
|
|
###############################################################################
|
|
|
|
|
class cd_nagios::client::target (
|
|
|
|
|
|
|
|
|
|
) inherits cd_nagios::params {
|
|
|
|
|
if $::fqdn != $ng_nagios_server {
|
2017-07-28 13:49:05 +01:00
|
|
|
if $ng_include_nrpe == true {
|
2025-05-12 15:56:17 +02:00
|
|
|
require cd_nagios::main::user
|
|
|
|
|
require cd_nrpe
|
2017-07-28 13:16:40 +01:00
|
|
|
|
2017-07-28 13:49:05 +01:00
|
|
|
@@nagios_host { $::fqdn:
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => $ng_ping_ensure,
|
|
|
|
|
alias => $::hostname,
|
|
|
|
|
address => $::fqdn,
|
|
|
|
|
use => 'linux-server',
|
|
|
|
|
target => $ng_target_host,
|
|
|
|
|
hostgroups => 'linux-servers',
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
max_check_attempts => $ng_max_check_attempts,
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
|
|
|
|
check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}",
|
|
|
|
|
notify => Service[$ng_user],
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2017-07-28 13:49:05 +01:00
|
|
|
@@nagios_service { "root_partition_${::hostname}":
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => $ng_disk_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_disk!${ng_disk_warn}!${ng_disk_crit}!/",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $::fqdn,
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${::hostname}_root_partition",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2017-07-31 17:26:23 +01:00
|
|
|
if $ng_enable_swap_check == true {
|
2025-05-12 15:56:17 +02:00
|
|
|
@@nagios_service { "Swap_Usage_${::hostname}":
|
|
|
|
|
ensure => $ng_swap_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $::fqdn,
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${::hostname}_swap_usage",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2017-07-28 13:49:05 +01:00
|
|
|
@@nagios_service { "Local_Users_${::hostname}":
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => $ng_users_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_users!${ng_users_warn}!${ng_users_crit}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $::fqdn,
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${::hostname}_local_users",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2017-07-28 13:49:05 +01:00
|
|
|
@@nagios_service { "Total Processes_${::hostname}":
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => $ng_procs_tot_ens,
|
|
|
|
|
check_command => "check_nrpe!check_procs!${ng_procs_tot_warn}!${ng_procs_tot_crit}!${ng_procs_tot_param}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $::fqdn,
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${::hostname}_total_processes",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2017-07-28 13:49:05 +01:00
|
|
|
@@nagios_service { "Zombie Processes_${::hostname}":
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => $ng_procs_z_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_procs!${ng_procs_z_warn}!${ng_procs_z_crit}!${ng_procs_z_param}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $::fqdn,
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${::hostname}_zombie_processes",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2017-07-28 13:49:05 +01:00
|
|
|
@@nagios_service { "Current_Load_${::hostname}":
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => $ng_load_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_load!${ng_load_warn}!${ng_load_crit}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $::fqdn,
|
|
|
|
|
contacts => 'ops',
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${::hostname}_current_load",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
2017-07-28 13:49:05 +01:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|