On 12-02-03 10:54 AM, Peter Berghold wrote:
> I noticed an interesting problem with the nagios_* providers especially
> in Debian. Besides writing to the wrong file (I fixed that issue) I've
> noticed there is a umask issue where the config files end up being owned
> by root with perms 0640. This causes nagios to spit milk out of its
> nose because it cannot read the configuration files.
>
> I came up with a kludgey solution to the problem but I'm not happy with
> it. Anybody out there run into this and fixed it? I'm curious to see
> what others came up with to fix this.
>
> For those that are curious as to how I fixed the "wrong file" problem I
> came up a solution where in my site.pp file I have the following:
>
> if ( $operatingsystem == "Debian ) {
> Nagios_host { target => "/etc/nagios3/conf.d/puppet_hosts.pp" }
> --- etc ---
> }
yes, you do need to set the target on nagios resources. In order to let
different nagios servers be installed with different OSes (weird idea, I
know, but hey! anything's possible ;) ), you could set that target on
resource collection:
Nagios_command <||> {
target =>
"${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_command.cfg",
# ...
}
also, for the permissions, you could use a file resource with the same
path to set permissions (but not the contents).
check out this module for examples (have a look at manifests/base.pp):
https://labs.riseup.net/code/projects/shared-nagios
--
Gabriel Filion
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.