OP#436 edit localhost

This commit is contained in:
2026-03-02 01:48:05 +01:00
parent f19e6f3442
commit ddee243cef

View File

@@ -56,28 +56,11 @@ class confdroid_nagios::server::service (
contacts => $ng_contact_name, contacts => $ng_contact_name,
} }
@@nagios_host { $fqdn: @@nagios_service { 'root_partition_localhost':
ensure => $ng_ping_ensure,
alias => $hostname,
address => $fqdn,
use => 'linux-server',
target => $ng_target_host,
hostgroups => 'linux-servers',
contacts => $ng_contact_name,
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],
}
@@nagios_service { "root_partition_${hostname}":
ensure => $ng_disk_ensure, ensure => $ng_disk_ensure,
check_command => "check_nrpe!check_disk!${ng_disk_warn}!${ng_disk_crit}!/", check_command => "check_nrpe!check_disk!${ng_disk_warn}!${ng_disk_crit}!/",
use => 'generic-service', use => 'generic-service',
host_name => $fqdn, host_name => 'localhost',
contacts => $ng_contact_name, contacts => $ng_contact_name,
notification_period => '24x7', notification_period => '24x7',
service_description => "${hostname}_root_partition", service_description => "${hostname}_root_partition",
@@ -86,17 +69,18 @@ class confdroid_nagios::server::service (
owner => $ng_user, owner => $ng_user,
group => $ng_user, group => $ng_user,
mode => '0640', mode => '0640',
purge => $ng_purge_target,
} }
if $ng_enable_swap_check == true { if $ng_enable_swap_check == true {
@@nagios_service { "Swap_Usage_${hostname}": @@nagios_service { 'Swap_Usage_localhost':
ensure => $ng_swap_ensure, ensure => $ng_swap_ensure,
check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}", check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}",
use => 'generic-service', use => 'generic-service',
host_name => $fqdn, host_name => 'localhost',
contacts => $ng_contact_name, contacts => $ng_contact_name,
notification_period => '24x7', notification_period => '24x7',
service_description => "${hostname}_swap_usage", service_description => 'localhost_swap_usage',
servicegroups => 'linux-services', servicegroups => 'linux-services',
target => $ng_target_service, target => $ng_target_service,
owner => $ng_user, owner => $ng_user,
@@ -105,14 +89,14 @@ class confdroid_nagios::server::service (
} }
} }
@@nagios_service { "Local_Users_${hostname}": @@nagios_service { 'Local_Users_localhost':
ensure => $ng_users_ensure, ensure => $ng_users_ensure,
check_command => "check_nrpe!check_users!${ng_users_warn}!${ng_users_crit}", check_command => "check_nrpe!check_users!${ng_users_warn}!${ng_users_crit}",
use => 'generic-service', use => 'generic-service',
host_name => $fqdn, host_name => 'localhost',
contacts => $ng_contact_name, contacts => $ng_contact_name,
notification_period => '24x7', notification_period => '24x7',
service_description => "${hostname}_local_users", service_description => 'localhost_local_users',
servicegroups => 'linux-services', servicegroups => 'linux-services',
target => $ng_target_service, target => $ng_target_service,
owner => $ng_user, owner => $ng_user,
@@ -120,14 +104,14 @@ class confdroid_nagios::server::service (
mode => '0640', mode => '0640',
} }
@@nagios_service { "Total Processes_${hostname}": @@nagios_service { 'Total_Processes_localhost':
ensure => $ng_procs_tot_ens, ensure => $ng_procs_tot_ens,
check_command => "check_nrpe!check_procs!${ng_procs_tot_warn}!${ng_procs_tot_crit}!${ng_procs_tot_param}", check_command => "check_nrpe!check_procs!${ng_procs_tot_warn}!${ng_procs_tot_crit}!${ng_procs_tot_param}",
use => 'generic-service', use => 'generic-service',
host_name => $fqdn, host_name => 'localhost',
contacts => $ng_contact_name, contacts => $ng_contact_name,
notification_period => '24x7', notification_period => '24x7',
service_description => "${hostname}_total_processes", service_description => 'localhost_total_processes',
servicegroups => 'linux-services', servicegroups => 'linux-services',
target => $ng_target_service, target => $ng_target_service,
owner => $ng_user, owner => $ng_user,
@@ -135,14 +119,14 @@ class confdroid_nagios::server::service (
mode => '0640', mode => '0640',
} }
@@nagios_service { "Zombie Processes_${hostname}": @@nagios_service { 'Zombie_Processes_localhost':
ensure => $ng_procs_z_ensure, ensure => $ng_procs_z_ensure,
check_command => "check_nrpe!check_procs!${ng_procs_z_warn}!${ng_procs_z_crit}!${ng_procs_z_param}", check_command => "check_nrpe!check_procs!${ng_procs_z_warn}!${ng_procs_z_crit}!${ng_procs_z_param}",
use => 'generic-service', use => 'generic-service',
host_name => $fqdn, host_name => 'localhost',
contacts => $ng_contact_name, contacts => $ng_contact_name,
notification_period => '24x7', notification_period => '24x7',
service_description => "${hostname}_zombie_processes", service_description => 'localhost_zombie_processes',
servicegroups => 'linux-services', servicegroups => 'linux-services',
target => $ng_target_service, target => $ng_target_service,
owner => $ng_user, owner => $ng_user,
@@ -150,14 +134,14 @@ class confdroid_nagios::server::service (
mode => '0640', mode => '0640',
} }
@@nagios_service { "Current_Load_${hostname}": @@nagios_service { 'Current_Load_localhost':
ensure => $ng_load_ensure, ensure => $ng_load_ensure,
check_command => "check_nrpe!check_load!${ng_load_warn}!${ng_load_crit}", check_command => "check_nrpe!check_load!${ng_load_warn}!${ng_load_crit}",
use => 'generic-service', use => 'generic-service',
host_name => $fqdn, host_name => 'localhost',
contacts => $ng_contact_name, contacts => $ng_contact_name,
notification_period => '24x7', notification_period => '24x7',
service_description => "${hostname}_current_load", service_description => 'localhost_current_load',
servicegroups => 'linux-services', servicegroups => 'linux-services',
target => $ng_target_service, target => $ng_target_service,
owner => $ng_user, owner => $ng_user,