2026-02-10 14:04:06 +01:00
|
|
|
## confdroid_nagios::client::target.pp
|
|
|
|
|
# Module name: confdroid_nagios
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
2026-02-13 19:29:23 +01:00
|
|
|
# @summary Class manages client target configuration for the confdroid_nagios module.
|
2026-02-10 14:04:06 +01:00
|
|
|
###############################################################################
|
|
|
|
|
class confdroid_nagios::client::target (
|
|
|
|
|
|
|
|
|
|
) inherits confdroid_nagios::params {
|
2026-03-01 16:38:22 +01:00
|
|
|
if $ng_nagios_server == $fqdn {
|
|
|
|
|
if $ng_include_nrpe == true {
|
2026-03-01 16:40:46 +01:00
|
|
|
require confdroid_nrpe
|
2026-03-01 16:38:22 +01:00
|
|
|
|
|
|
|
|
@@nagios_host { $fqdn:
|
|
|
|
|
ensure => $ng_ping_ensure,
|
|
|
|
|
alias => $fqdn,
|
|
|
|
|
address => $fqdn,
|
|
|
|
|
use => 'linux-server',
|
|
|
|
|
target => $ng_target_host,
|
|
|
|
|
hostgroups => 'linux-servers',
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
max_check_attempts => $ng_max_check_attempts,
|
|
|
|
|
notification_period => '24x7',
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}",
|
|
|
|
|
notify => Service[$ng_nagios_service],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@nagios_service { "root_partition_${fqdn}":
|
|
|
|
|
ensure => $ng_disk_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_disk!${ng_disk_warn}!${ng_disk_crit}!/",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $fqdn,
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${fqdn}_root_partition",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if $ng_enable_swap_check == true {
|
|
|
|
|
@@nagios_service { "Swap_Usage_${fqdn}":
|
|
|
|
|
ensure => $ng_swap_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $fqdn,
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${fqdn}_swap_usage",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@nagios_service { "Local_Users_${fqdn}":
|
|
|
|
|
ensure => $ng_users_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_users!${ng_users_warn}!${ng_users_crit}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $fqdn,
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${fqdn}_local_users",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@nagios_service { "Total Processes_${fqdn}":
|
|
|
|
|
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,
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${fqdn}_total_processes",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@nagios_service { "Zombie Processes_${fqdn}":
|
|
|
|
|
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,
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${fqdn}_zombie_processes",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@nagios_service { "Current_Load_${fqdn}":
|
|
|
|
|
ensure => $ng_load_ensure,
|
|
|
|
|
check_command => "check_nrpe!check_load!${ng_load_warn}!${ng_load_crit}",
|
|
|
|
|
use => 'generic-service',
|
|
|
|
|
host_name => $fqdn,
|
2026-03-01 16:42:44 +01:00
|
|
|
contacts => $ng_contact_name,
|
2026-03-01 16:38:22 +01:00
|
|
|
notification_period => '24x7',
|
|
|
|
|
service_description => "${fqdn}_current_load",
|
|
|
|
|
servicegroups => 'linux-services',
|
|
|
|
|
target => $ng_target_service,
|
|
|
|
|
owner => 'nagios',
|
|
|
|
|
group => 'nagios',
|
|
|
|
|
mode => '0640',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-10 14:04:06 +01:00
|
|
|
}
|