2026-02-28 16:16:59 +01:00
|
|
|
## confdroid_nagios::nagios::resources::resource.pp
|
|
|
|
|
# Module name: confdroid_nagios
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
|
|
|
# @summary Class manages the resource config file header.
|
|
|
|
|
# @example concat::fragment { "user_rule_plugins":
|
|
|
|
|
# ng_user_arg_name => "$user1$",
|
|
|
|
|
# ng_user_arg_value => '/usr/lib64/nagios/plugins',
|
|
|
|
|
# ng_user_arg_comment => "Sets $USER1$ to be the path to the plugins",
|
|
|
|
|
# }
|
|
|
|
|
#############################################################################
|
|
|
|
|
class confdroid_nagios::nagios::resources::resource (
|
|
|
|
|
|
|
|
|
|
) inherits confdroid_nagios::params {
|
2026-03-01 14:34:53 +01:00
|
|
|
if $ng_nagios_server == $fqdn {
|
2026-02-28 16:16:59 +01:00
|
|
|
concat { $ng_resource_file:
|
|
|
|
|
ensure => present,
|
|
|
|
|
owner => 'root',
|
2026-02-28 16:39:21 +01:00
|
|
|
group => 'nagios',
|
2026-02-28 16:16:59 +01:00
|
|
|
mode => '0640',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => nagios_etc_t,
|
|
|
|
|
seluser => system_u,
|
2026-03-01 18:40:19 +01:00
|
|
|
notify => Service[$ng_service],
|
2026-02-28 16:16:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
concat::fragment { 'header':
|
|
|
|
|
target => $ng_resource_file,
|
|
|
|
|
content => template($ng_resource_erb),
|
|
|
|
|
order => '000',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# plugins rule
|
|
|
|
|
|
|
|
|
|
confdroid_nagios::nagios::resources::resource_df { 'user_rule_plugins':
|
|
|
|
|
ng_user_arg_name => 'USER1',
|
|
|
|
|
ng_user_arg_value => '/usr/lib64/nagios/plugins/',
|
|
|
|
|
ng_user_arg_comment => 'Sets user1 to be the path to the plugins',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# eventhandlers rule
|
|
|
|
|
confdroid_nagios::nagios::resources::resource_df { 'user_rule_eventhandlers':
|
|
|
|
|
ng_user_arg_name => 'USER2',
|
|
|
|
|
ng_user_arg_value => '/usr/lib64/nagios/plugins/eventhandlers/',
|
|
|
|
|
ng_user_arg_comment => 'Sets user2 to be the path to the eventhandlers',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|