Hi,
I have the following:
class nagios {
include nagios::params
file { [ "${nagios::params::nagios_confdir}",
"${nagios::params::nagios_confdir}/app_alerts",
"${nagios::params::nagios_confdir}/app_alerts/ssa",
"${nagios::params::nagios_confdir}/app_alerts/ssa/
services" ]:
ensure => directory,
owner => ''root'',
group => ''root'',
mode => 755,
}
define couchdb_check () {
$couchdb_bind_address = "localhost"
$couchdb_port = "5984"
$couchdb_baseurl = "http://${couchdb_bind_address}:$
{couchdb_port}"
$couchdb_url = "${couchdb_baseurl}/nagios_alerts/${name}"
nagios_service { "ssa_${name}":
target => "${nagios::params::nagios_confdir}/app_alerts/ssa/
services/${name}.cfg",
use => "pnp4nagios-service",
service_description => couchdblookup($couchdb_url, "desc"),
require => File["${nagios::params::nagios_confdir}/app_alerts/
ssa/services"]
}
}
}
class ssa::nagios {
include nagios
nagios::couchdb_check { ["check1", "check2" ]: }
}
So there is ssa::nagios that includes nagios class
but I get error
err: Could not run Puppet configuration client: Could not find
dependency File[/etc/nagios/conf.d/app_alerts/ssa/services] for
Nagios_service[check1] at /etc/puppet/modules/nagios/manifests/init.pp:
32
Changed "include nagios" to "require nagios" - same error.
Of course nagios::params::nagios_confdir=/etc/nagios/conf.d
And nagios class is supposed to be evaluated before ssa::nagios - so
how come it does not find the File dependency declared in the nagios
class?
Thanks
Alex
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
That''s strange but I had to rename nagios class to nagios-server and
include it instead to fix the problem.
Maybe it''s related to that I have similar problem
class nagios-client {
include nagios::params, nagios::nrpe, nagios::plugins
}
class ssa::nagios-client {
# include nagios-client
include nagios::params, nagios::nrpe, nagios::plugins
$nrpe_checks = [ cpu, uptime, mem, postfix ]
nagios::nrpe::nrpe_check { $nrpe_checks: }
}
Note that in ssa::nagios-client "include nagios-client" did not work
and I got similar error "Could not find
dependency ..." on another resource and had to use "include
nagios::params, nagios::nrpe, nagios::plugins" instead.
Any idea what''s going on here?
Thanks
On Aug 10, 9:04 pm, piavlo <lolitus...@gmail.com>
wrote:> Hi,
>
> I have the following:
>
> class nagios {
>
> include nagios::params
>
> file { [ "${nagios::params::nagios_confdir}",
> "${nagios::params::nagios_confdir}/app_alerts",
> "${nagios::params::nagios_confdir}/app_alerts/ssa",
> "${nagios::params::nagios_confdir}/app_alerts/ssa/
> services" ]:
> ensure => directory,
> owner => ''root'',
> group => ''root'',
> mode => 755,
> }
>
> define couchdb_check () {
>
> $couchdb_bind_address = "localhost"
> $couchdb_port = "5984"
> $couchdb_baseurl = "http://${couchdb_bind_address}:$
> {couchdb_port}"
> $couchdb_url = "${couchdb_baseurl}/nagios_alerts/${name}"
>
> nagios_service { "ssa_${name}":
> target => "${nagios::params::nagios_confdir}/app_alerts/ssa/
> services/${name}.cfg",
> use => "pnp4nagios-service",
> service_description => couchdblookup($couchdb_url,
"desc"),
> require =>
File["${nagios::params::nagios_confdir}/app_alerts/
> ssa/services"]
> }
>
> }
>
> }
>
> class ssa::nagios {
>
> include nagios
>
> nagios::couchdb_check { ["check1", "check2" ]: }
>
> }
>
> So there is ssa::nagios that includes nagios class
> but I get error
>
> err: Could not run Puppet configuration client: Could not find
> dependency File[/etc/nagios/conf.d/app_alerts/ssa/services] for
> Nagios_service[check1] at /etc/puppet/modules/nagios/manifests/init.pp:
> 32
>
> Changed "include nagios" to "require nagios" - same
error.
> Of course nagios::params::nagios_confdir=/etc/nagios/conf.d
> And nagios class is supposed to be evaluated before ssa::nagios - so
> how come it does not find the File dependency declared in the nagios
> class?
>
> Thanks
> Alex
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
After changing nagios-client to nagios::client and nagios-server(formely just nagios) to nagios::server All strange dependency have seem to gone away Does anyone have clear logical explanation why nagios::client & nagios::server have no dep problems but nagios-client & nagios-server does? Thanks On Aug 10, 10:38 pm, piavlo <lolitus...@gmail.com> wrote:> That''s strange but I had to rename nagios class to nagios-server and > include it instead to fix the problem. > > Maybe it''s related to that I have similar problem > > class nagios-client { > include nagios::params, nagios::nrpe, nagios::plugins > > } > > class ssa::nagios-client { > > # include nagios-client > include nagios::params, nagios::nrpe, nagios::plugins > > $nrpe_checks = [ cpu, uptime, mem, postfix ] > > nagios::nrpe::nrpe_check { $nrpe_checks: } > > } > > Note that in ssa::nagios-client "include nagios-client" did not work > and I got similar error "Could not find > dependency ..." on another resource and had to use "include > nagios::params, nagios::nrpe, nagios::plugins" instead. > > Any idea what''s going on here? > > Thanks > > On Aug 10, 9:04 pm, piavlo <lolitus...@gmail.com> wrote: > > > > > > > > > Hi, > > > I have the following: > > > class nagios { > > > include nagios::params > > > file { [ "${nagios::params::nagios_confdir}", > > "${nagios::params::nagios_confdir}/app_alerts", > > "${nagios::params::nagios_confdir}/app_alerts/ssa", > > "${nagios::params::nagios_confdir}/app_alerts/ssa/ > > services" ]: > > ensure => directory, > > owner => ''root'', > > group => ''root'', > > mode => 755, > > } > > > define couchdb_check () { > > > $couchdb_bind_address = "localhost" > > $couchdb_port = "5984" > > $couchdb_baseurl = "http://${couchdb_bind_address}:$ > > {couchdb_port}" > > $couchdb_url = "${couchdb_baseurl}/nagios_alerts/${name}" > > > nagios_service { "ssa_${name}": > > target => "${nagios::params::nagios_confdir}/app_alerts/ssa/ > > services/${name}.cfg", > > use => "pnp4nagios-service", > > service_description => couchdblookup($couchdb_url, "desc"), > > require => File["${nagios::params::nagios_confdir}/app_alerts/ > > ssa/services"] > > } > > > } > > > } > > > class ssa::nagios { > > > include nagios > > > nagios::couchdb_check { ["check1", "check2" ]: } > > > } > > > So there is ssa::nagios that includes nagios class > > but I get error > > > err: Could not run Puppet configuration client: Could not find > > dependency File[/etc/nagios/conf.d/app_alerts/ssa/services] for > > Nagios_service[check1] at /etc/puppet/modules/nagios/manifests/init.pp: > > 32 > > > Changed "include nagios" to "require nagios" - same error. > > Of course nagios::params::nagios_confdir=/etc/nagios/conf.d > > And nagios class is supposed to be evaluated before ssa::nagios - so > > how come it does not find the File dependency declared in the nagios > > class? > > > Thanks > > Alex-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Christian Kauhaus
2011-Aug-11 07:42 UTC
Re: [Puppet Users] Re: Strange Could not find dependency error
Am 10.08.2011 22:24, schrieb piavlo:> Does anyone have clear logical explanation why nagios::client & > nagios::server > have no dep problems but nagios-client & nagios-server does?"-" is no legal character in identifier names. Unfortunately, the error messages are not very helpful in such a case. Regards Christian -- Dipl.-Inf. Christian Kauhaus <>< · kc@gocept.com · systems administration gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 11 · fax +49 345 1229889 1 Zope and Plone consulting and development -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Christian
Strangely then I had "-" in manifest like this
class nagios-client {
include nagios::params, nagios::nrpe, nagios::plugins
}
but was not including nagios-client any where - the puppet master/
agent did not give any errors - or this is since nagios-client was
never compiled on the master and so was not send to the agent as
well ?
Also if you look at my original mail at first I had nagios and not
nagios::server - and had same problem
of "Could not find dependency" - does it mean that in this case I had
some nasty magic puppet dependency problem - and renaming nagios to
nagios::server solved it - seems to me like some puppet bug, wdyt?
Thanks
Alex
On Aug 11, 10:42 am, Christian Kauhaus <k...@gocept.com>
wrote:> Am 10.08.2011 22:24, schrieb piavlo:
>
> > Does anyone have clear logical explanation why nagios::client &
> > nagios::server
> > have no dep problems but nagios-client & nagios-server does?
>
> "-" is no legal character in identifier names. Unfortunately, the
error
> messages are not very helpful in such a case.
>
> Regards
>
> Christian
>
> --
> Dipl.-Inf. Christian Kauhaus <>< k...@gocept.com systems
administration
> gocept gmbh & co. kg forsterstra e 29 06112 halle (saale)
germanyhttp://gocept.comtel +49 345 1229889 11 fax +49 345 1229889 1
> Zope and Plone consulting and development
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.