OP#830 add nagios target

This commit is contained in:
2026-10-04 13:26:33 +02:00
parent 16597c16d5
commit 097956676e
3 changed files with 27 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ class confdroid_ntp::main::config (
) inherits confdroid_ntp::params {
include confdroid_ntp::main::service
# if $ay_manage_nagios == true {
# include confdroid_ntp::monitoring::target
# }
if $cy_manage_nagios == true {
include confdroid_ntp::monitoring::target
}
}

View File

@@ -6,4 +6,18 @@
class confdroid_ntp::monitoring::target (
) inherits confdroid_ntp::params {
if $cy_manage_nagios == true {
@@nagios_service { "check_chronyd_${fqdn}":
check_command => "check_nrpe!check_chronyd!${cy_procs_allowed}!chrony",
use => 'generic-service',
host_name => $fqdn,
notification_period => '24x7',
service_description => "${fqdn}_check_chronyd",
target => $cy_target_service,
owner => 'nagios',
group => 'nagios',
mode => '0640',
contacts => $cy_target_contacts,
}
}
}

View File

@@ -18,6 +18,10 @@
# @param [String] cy_loginfo Log information to record. Valid values are
# 'measurements', 'statistics', and 'tracking'.
# @param [Boolean] cy_use_lan_server Whether to use a local LAN server or external pool.
# @param [Boolean] cy_manage_nagios Whether to manage Nagios monitoring for the module.
# @param [String] cy_procs_allowed Number of allowed processes for the Nagios check.
# @param [String] cy_target_service Path to the Nagios service configuration file.
# @param [Array] cy_target_contacts List of Nagios contacts for notifications.
###############################################################################
class confdroid_ntp::params (
@@ -35,6 +39,12 @@ class confdroid_ntp::params (
String $cy_leapsectz = 'right/UTC',
String $cy_loginfo = 'measurements statistics tracking',
# monitoring
Boolean $cy_manage_nagios = false,
String $cy_procs_allowed = '1',
String $cy_target_service = '/etc/nagios/conf.d/chronyd_service.cfg',
Array $cy_target_contacts = ['admin'],
) {
# facts
$fqdn = $facts['networking']['fqdn']