Re: [Puppet Users] Nagios default files being overwritten

2014-02-11 Thread Jason Antman
Agreed with what Matthias said. Puppet's naginator stuff doesn't play 
very well with non-Puppet nagios configurations. Essentially, you have 
to pick one of:
- remove the default template from that file, and create it with Puppet 
elsewhere

- put all of the contents of that file in Puppet
- totally remove all of the default object configuration, and have 
Puppet do everything (what I do)


On the other hand, I don't use templates in Nagios anymore, I find them 
to be redundant. I use a combination of defines and parameterized 
classes (hiera would be good here too, though I don't use it) and have 
Puppet write out complete definitions for hosts/services/etc without any 
templates. I find that makes it much more clear to look at one resource 
in Puppet and know what it does, and reduces the likelihood that a 
template will get modified and have unintended consequences for objects 
that use it.


-Jason

On 02/11/2014 11:14 AM, Matthias Saou wrote:

On Tue, 11 Feb 2014 06:53:42 -0800 (PST)
druide.st...@gmail.com wrote:


I have a strange problem here. Most of my Nagios configuration are
from file {} directive, but I also need to modify a couple of Nagios'
default configuration. To do this, I use classes like this:

class nagios::gabarits {

nagios_host { 'linux-server':
  use => 'generic-host',

[...]

  target => '/etc/nagios/objects/templates.cfg',
  ensure => present,
}

  }

Problem is: it replace the content
of /etc/nagios/objects/templates.cfg with the new host definition,
but everything else in the file is gone!

I think that's the expected behaviour.
The proper fix is to also declare the other nagios resources you want
to see in that file.

That's more or less how I solved it in my own module :
https://github.com/thias/puppet-nagios/blob/master/manifests/server.pp#L550
(feel free to copy/paste those lines!)

Though I did "move" all of the resources to their default files and
stopped using the objects/templates.cfg file.

HTH,
Matthias



--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52FAA665.8080703%40jasonantman.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Nagios default files being overwritten

2014-02-11 Thread Matthias Saou
On Tue, 11 Feb 2014 06:53:42 -0800 (PST)
druide.st...@gmail.com wrote:

> I have a strange problem here. Most of my Nagios configuration are
> from file {} directive, but I also need to modify a couple of Nagios'
> default configuration. To do this, I use classes like this:
> 
> class nagios::gabarits { 
> 
>nagios_host { 'linux-server': 
>  use => 'generic-host',
[...]
>  target => '/etc/nagios/objects/templates.cfg', 
>  ensure => present, 
>}
> 
>  }
> 
> Problem is: it replace the content
> of /etc/nagios/objects/templates.cfg with the new host definition,
> but everything else in the file is gone! 

I think that's the expected behaviour.
The proper fix is to also declare the other nagios resources you want
to see in that file.

That's more or less how I solved it in my own module :
https://github.com/thias/puppet-nagios/blob/master/manifests/server.pp#L550
(feel free to copy/paste those lines!)

Though I did "move" all of the resources to their default files and
stopped using the objects/templates.cfg file.

HTH,
Matthias

-- 
Matthias Saou  ██  ██
 ██  ██
Web: http://matthias.saou.eu/  ██
Mail/XMPP:  matth...@saou.eu   ██  
   ██
GPG: 4096R/E755CC63██  ██  ██
 8D91 7E2E F048 9C9C 46AF  ██  ██  ██  ██
 21A9 7A51 7B82 E755 CC63  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140211171444.45ff5eac%40r2d2.marmotte.net.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Nagios & Puppet

2013-10-17 Thread Sans
Hi steve,

So, you have all the "services" defined statically on the Nagios server? 
That setup only works, I think, if you install your Nagios server at the 
very end of your deployment process and all the clients are up and ready 
before the server. If you do a parallel deployment, then there is a very 
good chance that Nagios will refuse to start at the first run. Cheers!! 


On Friday, June 28, 2013 3:57:09 PM UTC+1, Steve J wrote:
>
> In my experience, exporting nagios_command resources doesn't work so well. 
> What I've found works best, is to define nagios_command{}'s directly on the 
> server, rather than exporting and collecting them there later.
>
> In my setup, the only resource that export is the nagios_host. I define 
> commands and services on the server, and assign the services to hostgroups. 
> Hosts then get service checks assigned to them based on which hostgroups I 
> put them in (usually done via the hosts role definition). I find that this 
> works well, since it doesn't leave me with multiple exported nagios_service 
> resources for every single host, that will eventually need to get cleaned 
> out of PuppetDB when the host is no longer in service.
>
> -Steve
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] nagios collector only finding some resources

2013-09-20 Thread Ken Barber
> What I do know from querying the database is that all the exported resources
> are present in the puppetdb database (in catalog_resources).

Did you query via the REST interface, or the database directly. The
REST interface might be more clear, as this is pretty much what the
puppetdb terminus uses of course.

http://docs.puppetlabs.com/puppetdb/1.4/api/query/v2/resources.html

> Has anyone else run into this, or any hints how to proceed?

Haven't seen or heard about this specifically. Umm ... can you prove
the problem without Nagios? Ie. have you tried using a different
resource to see if it occurs as well? Perhaps working around the edges
of the problem might prove what it is _not_ which is a start.

ken.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] nagios collector only finding some resources

2013-09-20 Thread David Thompson

On 9/20/13 10:20 AM, Ken Barber wrote:

What I do know from querying the database is that all the exported resources
are present in the puppetdb database (in catalog_resources).


Did you query via the REST interface, or the database directly. The
REST interface might be more clear, as this is pretty much what the
puppetdb terminus uses of course.

http://docs.puppetlabs.com/puppetdb/1.4/api/query/v2/resources.html


Interesting.  The REST interface agrees with the resulting nagios 
configuration when I query things like 
'http://localhost:8080/v2/resources/Nagios_service'.


But like I say, I see all the Nagios_* resources present in the actual 
database.  What gives?



Has anyone else run into this, or any hints how to proceed?


Haven't seen or heard about this specifically. Umm ... can you prove
the problem without Nagios? Ie. have you tried using a different
resource to see if it occurs as well? Perhaps working around the edges
of the problem might prove what it is _not_ which is a start.


Other resources (Package, File) seem to be present for all nodes using 
the query@ method described in 
http://docs.puppetlabs.com/puppetdb/1.4/api/query/tutorial.html.


--
David Thompson
Waisman Center Brain Imaging and Behavior Lab
1500 Highland Ave. Room T133
Madison, WI  53705-2280
(608) 265-6608
dthompson (at) waisman (dot) wisc (dot) edu

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Nagios server automating

2013-09-01 Thread Gabriel Filion
Hi there,

On 30/08/13 05:34 PM, mike wrote:
> [..]
> Error: Could not find any host matching 'node1.example.com' (config file
> '/etc/nagios/resource.d/host_node1.example.com.cfg', starting on line 4)
> Error: Could not expand hostgroups and/or hosts specified in service
> (config file '/etc/nagios/resource.d/host_node5.example.com.cfg',
> starting on line 4)
> [..]

those errors indicate that the host definitions are either absent or not
in a place where nagios is looking for (e.g. not loaded via include or
include_dir).

also:

> class nagios::export {
> 
>   @@nagios_host { $::fqdn:
> ensure  => present,
> alias   => $::hostname,
> address => $::ipaddress,
> use => "linux-server",
> notify  => Service["nagios"],
>   }

in the above snippet, you're not specifying any target for hosts, so
unless you do it while collecting resources[1], the host definitions
will be written in /etc/nagios/nagios_host.cfg

see: https://docs.puppetlabs.com/references/stable/type.html#nagioshost

you could add in the above:

[...]
  target => "/etc/nagios/resource.d/host_${::fqdn}.cfg",
}

[1]: the target can be specified during collection on the nagios server
if you want to send all resources of the same type in one file. for example:

Nagios_host <<||>>
Nagios_host <||> {
  target => '/etc/nagios3/conf.d/nagios_hosts.cfg',
}

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Nagios service not restarting when removing a host from the database

2013-08-06 Thread puppetlist
On Tue, Aug 06, 2013 at 06:20:09AM -0700, jcbollinger wrote:
> 
> Because there is a difference between unmanaged resources and resources 
> that are managed 'absent'.  Only resources that are actually declared for 
> the target node are managed, whether declared directly or via collection of 
> virtual or exported resources.  Declaring that unmanaged resources of a 
> given type should be purged does not make the affected resources managed.

Your explanation just solved my problem. For the record using notify in
the resource purge doesn't work as attested in several google searches
(and confirmed here) with errors like:

warning: /Nagios_service[check_ssh_test1]: Service[nagios] still depends on me 
-- not purging

However, provided you do the following:

1) name your services like "servicename_${::hostname}"
2) name your hosts as "$::fqdn"
3) Make sure every @@nagios_* resource has "ensure=>'present'"

then the following does work to both remove the resources from the
nagios_*.cfg files __and__ restart nagios:

Get resource ids:
select id,title from resources where title like '%_' or 
title='yourfqdn';

Update present to absent for all service checks and the host check.
update param_values set value='absent' where value='present' and (resource_id=1 
or resource_id=2);

Since there may be a use case to turn off a single service instead of
blowing away all the service and host checks for a given node, I'll
probably populate a checklist form. Granted, that will require that the
host doesn't redefine it again (different problem).

Anyway, thanks so much for the unmanaged vs managed comment. That was
totally slipping by me while I pounded my head into my desk trying to
figure out why the files were changing but the service wasn't being
notified.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios service not restarting when removing a host from the database

2013-08-06 Thread jcbollinger


On Monday, August 5, 2013 3:33:11 PM UTC-5, John Santana wrote:
>
> On Mon, Aug 05, 2013 at 04:22:41PM -0400, Gabriel Filion wrote: 
> > 
> > you need to export the resource with ensure => absent and run puppet on 
> > the host, then on the nagios server so that everything runs fine. 
>
> Dozens of VMs are routinely destroyed on a weekly basis and in an 
> automated fashion based on load. The nagios_*.cfg files are 
> automatically changed, why is the notify not triggering? 
>
>

Because there is a difference between unmanaged resources and resources 
that are managed 'absent'.  Only resources that are actually declared for 
the target node are managed, whether declared directly or via collection of 
virtual or exported resources.  Declaring that unmanaged resources of a 
given type should be purged does not make the affected resources managed.

You declare that Service['nagios'] must be notified when a *managed*Nagios_host 
or Nagios_service is modified (including from being absent to 
being present, or vise versa), but that's not what happens when you remove 
the [exported] resource declaration altogether.

 

> > however in your example, you seem not to be redefining the "target" when 
> > collecting, so you might consider using purge => true. to achieve what 
> > you want with the workflow you mentioned above (e.g. without the need to 
> > export with ensure => absent) 
>
> I am purging unless you are referring to a different resource stanza. 
> From my OP: 
>
> resources { [ "nagios_host", "nagios_service" ]: 
>   purge => true, 
> } 
>
>
>

By definition, that causes *un*managed resources of the specified types to 
be removed from the system.  Because they are unmanaged, their removal does 
not cause nagios to be notified.

You could try having that Resources resource notify Service['nagios'] 
itself:

resources { [ "nagios_host", "nagios_service" ]:
  purge => true,
  notify => Service['nagios']
}

I don't actually know whether that would work, but it seems right.  Be sure 
to check both that it causes nagios to be notified when hosts or services 
are purged, and that it doesn't do so otherwise.  And please let us know 
what happens. I'm very curious.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios service not restarting when removing a host from the database

2013-08-05 Thread Gabriel Filion
On 05/08/13 04:33 PM, puppetl...@downhomelinux.com wrote:
> On Mon, Aug 05, 2013 at 04:22:41PM -0400, Gabriel Filion wrote:
>>
>> you need to export the resource with ensure => absent and run puppet on
>> the host, then on the nagios server so that everything runs fine.
> 
> Dozens of VMs are routinely destroyed on a weekly basis and in an
> automated fashion based on load. The nagios_*.cfg files are
> automatically changed, why is the notify not triggering?
> 
>> however in your example, you seem not to be redefining the "target" when
>> collecting, so you might consider using purge => true. to achieve what
>> you want with the workflow you mentioned above (e.g. without the need to
>> export with ensure => absent)
> 
> I am purging unless you are referring to a different resource stanza.
> From my OP:

ah, so that's why the config is updated automatically then..

I can't use purging in my environment because of the annoying limitation
with the "target" argument, so the best I can do now is to pull one
suggestion out of my hat:

if you try and add the notify here, maybe it'll catch removals too?

> resources { [ "nagios_host", "nagios_service" ]:
>   purge => true,
notify => Service['nagios'],
> }

it might complain about the notify lines in the collection.. not
entirely sure. if so, try to remove the line at the collection point.

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Nagios service not restarting when removing a host from the database

2013-08-05 Thread puppetlist
On Mon, Aug 05, 2013 at 04:22:41PM -0400, Gabriel Filion wrote:
> 
> you need to export the resource with ensure => absent and run puppet on
> the host, then on the nagios server so that everything runs fine.

Dozens of VMs are routinely destroyed on a weekly basis and in an
automated fashion based on load. The nagios_*.cfg files are
automatically changed, why is the notify not triggering?

> however in your example, you seem not to be redefining the "target" when
> collecting, so you might consider using purge => true. to achieve what
> you want with the workflow you mentioned above (e.g. without the need to
> export with ensure => absent)

I am purging unless you are referring to a different resource stanza.
>From my OP:

resources { [ "nagios_host", "nagios_service" ]:
  purge => true,
}


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios service not restarting when removing a host from the database

2013-08-05 Thread Gabriel Filion
Hi there,

On 05/08/13 10:51 AM, John Santana wrote:
> When I remove the host from the database via
> 
> delete from fact_values where host_id='N';
> delete from resources where host_id='N';
> delete from hosts where id='N';

if you remove the host exported resource in the manifests and the DB,
then the nagios server is not collecting anything about it anymore:
that's why the service doesn't get notified.

you need to export the resource with ensure => absent and run puppet on
the host, then on the nagios server so that everything runs fine.


however in your example, you seem not to be redefining the "target" when
collecting, so you might consider using purge => true. to achieve what
you want with the workflow you mentioned above (e.g. without the need to
export with ensure => absent)

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Nagios & Puppet

2013-06-28 Thread Jakov Sosic

On 06/28/2013 04:57 PM, Stephen Jahl wrote:

In my experience, exporting nagios_command resources doesn't work so
well. What I've found works best, is to define nagios_command{}'s
directly on the server, rather than exporting and collecting them there
later.

In my setup, the only resource that export is the nagios_host. I define
commands and services on the server, and assign the services to
hostgroups. Hosts then get service checks assigned to them based on
which hostgroups I put them in (usually done via the hosts role
definition). I find that this works well, since it doesn't leave me with
multiple exported nagios_service resources for every single host, that
will eventually need to get cleaned out of PuppetDB when the host is no
longer in service.


Yeah, that approach seems better performance-wise. Tank you for sharing :)


--
Jakov Sosic
www.srce.unizg.hr

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios & Puppet

2013-06-28 Thread Stephen Jahl
In my experience, exporting nagios_command resources doesn't work so well.
What I've found works best, is to define nagios_command{}'s directly on the
server, rather than exporting and collecting them there later.

In my setup, the only resource that export is the nagios_host. I define
commands and services on the server, and assign the services to hostgroups.
Hosts then get service checks assigned to them based on which hostgroups I
put them in (usually done via the hosts role definition). I find that this
works well, since it doesn't leave me with multiple exported nagios_service
resources for every single host, that will eventually need to get cleaned
out of PuppetDB when the host is no longer in service.

-Steve



On Thu, Jun 27, 2013 at 12:07 PM, Christian Reiß
wrote:

> Hello folks,
>
> I am currently using Puppet to forge the nagios configuration files. Using
> exported ressources it really works well - to a point.
>
> The one thing I am banging my head against is the service definitions. The
> services use stuff like remote-nrpe-zombie-procs, which of course, is not
> defined anywhere:
>
> define service {
> ## --PUPPET_NAME-- (called '_naginator_name' in the
> manifest)check_zombie_procs_gaming
> useremote-nrpe-zombie-procs
> host_name  gaming.alpha-labs.net
> }
>
> So far I am letting puppet generate the three configs:
>
> nagios_host.cfg
> nagios_hostextinfo.cfg
> nagios_service.cfg
>
> Tho for this to work I would need a corresponding commands.cfg and all the
> Howtos out there do not seem to have my problem. The important snipplet
> from my config would be this:
>
>
>  Nagios_host <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>  Nagios_service <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>  Nagios_hostextinfo <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>  Nagios_command <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>
> After banging my head for 3 evenings on this I really need your help.
> Thanks for any pointers.
>
> -Chris.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios & Puppet

2013-06-27 Thread Pete Brown
Shameless plug.
I wrote a module to do pretty much what you are trying to achieve.
http://forge.puppetlabs.com/rendhalver/monitoring
It currently works on CentOS and Fedora. Debian/Ubuntu support is in progress.
I also have a couple of other modules for managing nrpe and icinga
Feel free to have a look at the code on github for inspiration even if
you don't install it.

Pete.

On 28 June 2013 02:07, Christian Reiß  wrote:
> Hello folks,
>
> I am currently using Puppet to forge the nagios configuration files. Using
> exported ressources it really works well - to a point.
>
> The one thing I am banging my head against is the service definitions. The
> services use stuff like remote-nrpe-zombie-procs, which of course, is not
> defined anywhere:
>
> define service {
> ## --PUPPET_NAME-- (called '_naginator_name' in the manifest)
> check_zombie_procs_gaming
> useremote-nrpe-zombie-procs
> host_name  gaming.alpha-labs.net
> }
>
> So far I am letting puppet generate the three configs:
>
> nagios_host.cfg
> nagios_hostextinfo.cfg
> nagios_service.cfg
>
> Tho for this to work I would need a corresponding commands.cfg and all the
> Howtos out there do not seem to have my problem. The important snipplet from
> my config would be this:
>
>
>  Nagios_host <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>  Nagios_service <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>  Nagios_hostextinfo <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>  Nagios_command <<||>> {
>  require => File[resource-d],
>  notify => Service[icinga],
>  }
>
>
> After banging my head for 3 evenings on this I really need your help.
> Thanks for any pointers.
>
> -Chris.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios Contacts(groups)

2013-02-12 Thread Felix Frank
Hi,

On 02/11/2013 02:12 PM, Jamie Cressey wrote:
> 
> Is there a way to create a list such as ;
> name1:username1:emailaddress1
> name2:username2:emailaddress2

classic use case for defined types.
http://docs.puppetlabs.com/guides/language_guide.html#defined-resource-types

Your type will look like this:

my_nagios_contact($email) {
  @@nagios_contact { $name: ... }
}

And used like
http://docs.puppetlabs.com/references/2.7.latest/function.html#createresources

create_resources(my_nagios_contact, $contacts)

where $contacts is a suitable hash.

Same structure for contactgroups. It may be hard to find one single
datastructure to hold both contacts and contactgroups, but that would
not lend itself to the problem at hand very well, anyway.

HTH,
Felix


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Nagios server howto for beginner ?

2012-10-15 Thread Matthias Saou
Hi,

Nagios servers tend to quickly become complex beasts :-) I know what
all of the advantages of managing them cleanly with puppet are, never
missing a single typical check from being added ever again being the
main one, but there are so many downsides that I'm still not entirely
convinced that it's a setup suitable for everyone. For instance, it's
quite hard to get things right in a heterogeneous environment, and
implementing simple custom checks becomes exponentially complicated.

Anyway, if you plan on trying out my module, feedback or pull requests
are very welcome. The httpd dependency on my own module can easily be
omitted with nagios::server { apache_httpd => false }, then using any
other httpd module of your choosing. Same with php => false if you
want to use your own module.
I always try to make my modules standalone, and when that's not
possible, at least leave people a way to disable dependencies on other
of my own modules so that they can use their own instead.

Good luck!
Matthias

On Mon, 15 Oct 2012 02:00:18 -0700 (PDT)
ftiff  wrote:

> Hi all,
> 
> I would like to install a nagios server without reinventing the wheel.
> 
> I know there's nagios (client?) functionality in core puppet, and a
> lot of modules in the forge. Unfortunately, the most promising one,
> thias/nagios uses thias/apache_httpd, and I would like to stick with
> puppetlabs/httpd to prevent fragmentation.
> 
> Has anyone successfully implemented it ? Is there any official 
> documentation besides the type reference ? Should I dig in
> thias/nagios ?
> 
> Thanks in advance,
> 
> Francois
> 
> 



-- 
Matthias Saou  ██  ██
 ██  ██
Web: http://matthias.saou.eu/  ██
Mail/XMPP:  matth...@saou.eu   ██  
   ██
GPG: 4096R/E755CC63██  ██  ██
 8D91 7E2E F048 9C9C 46AF  ██  ██  ██  ██
 21A9 7A51 7B82 E755 CC63  

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios

2012-10-12 Thread Gabriel Filion
On 2012-10-11 14:59, TFML wrote:
> I've got a Nagios setup with puppet to add nodes/contacts/command
> running at one datacenter, I'm trying to setup a second Nagios server
> using the same manifests, but I'm getting this error:
> 
> info: Retrieving plugin
> info: Loading facts in snmpd
> info: Loading facts in snmpd
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Exported resource Nagios_timeperiod[24x7] cannot override local resource
> on node nagios2.theflux.net 

your manifests are probably exporting the same resources twice.

you might want to verify either that one nagios server is exporting
these and the second is collecting them, or that both create them as
local resources and collect host/service definitions from other nodes.

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Nagios

2012-10-11 Thread Peter Brown
How are you setting up the nagios resources?

On 12 October 2012 04:59, TFML  wrote:
> I've got a Nagios setup with puppet to add nodes/contacts/command running at
> one datacenter, I'm trying to setup a second Nagios server using the same
> manifests, but I'm getting this error:
>
> info: Retrieving plugin
> info: Loading facts in snmpd
> info: Loading facts in snmpd
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Exported resource Nagios_timeperiod[24x7] cannot override local resource on
> node nagios2.theflux.net
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
> Time:
>  Last run: 1349977873
>
> Can someone give me some direction on why this is happening?  Thanks!
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem

2012-09-11 Thread Peter Brown
On 12 September 2012 01:24, Gabriel Filion  wrote:
> On 12-09-10 11:32 PM, Peter Brown wrote:
>>> hum, was the purge functionality ever fixed for nagios types? I've
>>> > wanted to use that for some time but fwir it was not implemented.
>> Purge generally works if you don't change the target for any of the
>> the nagios types and keep the names the same otherwise you will have
>> issues.
>
> ah, you're right the bug was with purge + changing target.
> (yes I do consider this as a bug even though in the code it says it's an
> architectural restriction -- but I won't bug puppetlabs with an issue
> about this since I can expect it to only get marked as "wontfix")

yeah especially since it's a known issue and listed in the documentation.


> --
> 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 puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem

2012-09-11 Thread Gabriel Filion
On 12-09-10 11:32 PM, Peter Brown wrote:
>> hum, was the purge functionality ever fixed for nagios types? I've
>> > wanted to use that for some time but fwir it was not implemented.
> Purge generally works if you don't change the target for any of the
> the nagios types and keep the names the same otherwise you will have
> issues.

ah, you're right the bug was with purge + changing target.
(yes I do consider this as a bug even though in the code it says it's an
architectural restriction -- but I won't bug puppetlabs with an issue
about this since I can expect it to only get marked as "wontfix")

-- 
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 puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem

2012-09-10 Thread Peter Brown
On 11 September 2012 12:51, Gabriel Filion  wrote:
> On 12-09-10 10:46 PM, Bruno Leon wrote:
>>   resources {  "nagios_service":
>> #notify => Service["nagios3"]
>> purge => true,
>>   }
>>
>>   resources {  "nagios_host":
>> #notify => Service["nagios3"]
>> purge => true,
>>   }
>>
>>
>>
>> And make Nagios service subrscribe to the file /etc/nagios (cheksum =>
>> mtime)
>
> hum, was the purge functionality ever fixed for nagios types? I've
> wanted to use that for some time but fwir it was not implemented.

Purge generally works if you don't change the target for any of the
the nagios types and keep the names the same otherwise you will have
issues.

>
> --
> 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 puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem

2012-09-10 Thread Gabriel Filion
On 12-09-10 10:46 PM, Bruno Leon wrote:
>   resources {  "nagios_service":
> #notify => Service["nagios3"]
> purge => true,
>   }
> 
>   resources {  "nagios_host":
> #notify => Service["nagios3"]
> purge => true,
>   }
> 
>  
> 
> And make Nagios service subrscribe to the file /etc/nagios (cheksum =>
> mtime)

hum, was the purge functionality ever fixed for nagios types? I've
wanted to use that for some time but fwir it was not implemented.

-- 
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 puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem

2012-09-10 Thread Bruno Leon
  resources {  "nagios_service":
#notify => Service["nagios3"] 
purge => true,
  }

  resources {  "nagios_host":
#notify => Service["nagios3"] 
purge => true,
  }

And make Nagios service  subrscribe to the file /etc/nagios (cheksum => mtime)

-- 
Bruno

On September 10, 2012 01:17:22 PM jlittle wrote:


I am using stored configs to manage my nagios host and services checks and I 
have run into a problem that I have been unable to solve.  When the stored 
configs are purged from puppet the nagios server correctly removes them from 
the services and hosts file but does not notify the nagios service and instead 
throws an error.  So the entries are still there and nagios still reports on 
them until it is restarted.

(/Nagios_service[check_ping_jasontest2.wishabi.net]) 
Whit[Completed_stage[main]],Whit[Completed_class[Nagios3_monitor]],Service[nagios3]
 
still depend on me -- not purging

The reason that I want this feature is that I have created several automation 
scripts so I can start a service through AWS giving it two tags a hostname and 
a puppetclass.  So when I decommission a server the puppetmaster recognizes 
this and does a puppet node clean $hostname which in turn is picked up by 
nagios on its next run and purged.  

This is the section of the nagios config that I am using to both populate and 
purge the items from the nagios files.

  # collect resources and populate /etc/nagios/nagios_*.cfg
  Nagios_host <<||>> { notify => Service["nagios3"] }
  Nagios_service  <<||>> { notify => Service["nagios3"] }

  resources {  "nagios_service":
notify => Service["nagios3"] 
purge => true,
  }

  resources {  "nagios_host":
notify => Service["nagios3"] 
purge => true,
  }

I can just run a cronjob to restart the nagios service periodically but that 
is a hacky way to do it and I would like to see if anyone has any ideas.

Jason



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/GW5zxJyl-yYJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-
users+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-
users?hl=en.



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios and www-data users.

2012-09-05 Thread Darin Perusich
There should be a "nagcmd" group which both nagios and your apache
user are members of. The nagios.cmd pipe should have permission of
0660 and ownership of nagios:nagcmd. If you were using check_mk
livestatus then the livestatus.cmd socket would have the same perms
and ownership.

Usually this is taken care of by the nagios packages.

--
Later,
Darin


On Wed, Sep 5, 2012 at 12:33 PM, Douglas Garstang
 wrote:
> I'm sure people have hit this problem before. In my nagios module, the
> nagios command pipe file at /var/lib/nagios3/rw/nagios.cmd is owned by
> the nagios user, but needs to be written to by the www-data user.
> Adding the www-user to the nagios group is one solution, but that
> requires that the nagios module potentially modify the www-data user,
> which seems bad.
>
> What's the best way to do this? I tried to explicitly define the
> www-data user in it's own class, and then create another nagios class
> that inherits from that so that I could do plusignment, but I
> obviously have the syntax wrong. Puppet doesn't like this.
>
> class nagios::users inherits users::www-data {
>  User['www-data'] { group +> ['nagios'] }
> }
>
> Doug
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios service check_https

2012-08-23 Thread Peter Brown
No worries.
Glad you got it working.

On 23 August 2012 14:35, Marc Lucke  wrote:
> I inherited the module so I'm not sure.  I did see some check_commands with ! 
> and was wondering; I didn't connect the dots.
>
> Thank you!! :)
>
> On 23/08/2012, at 2:18 PM, Peter Brown  wrote:
>
>> Hi,
>>
>> $ARG1 in a nagios check is what comes after the first ! in the check.
>> Which module are you using to generate your nagios setup?
>>
>> On 23 August 2012 13:44, Marc Lucke  wrote:
>>> I note that the check_https command that the puppet module generates is 
>>> check_http -H $HOSTNAME -S $ARG1
>>>
>>> I'd like to specify $ARG1 so that so that I can check return strings, check 
>>> SSL certificates et al. but I couldn't find any way to do it other than 
>>> nagios_command which seems pretty wasteful
>>>
>>> Is it possible to set $ARG1 ?
>>>
>>>
>>> Marc
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/puppet-users?hl=en.
>>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios service check_https

2012-08-22 Thread Marc Lucke
I inherited the module so I'm not sure.  I did see some check_commands with ! 
and was wondering; I didn't connect the dots.

Thank you!! :)

On 23/08/2012, at 2:18 PM, Peter Brown  wrote:

> Hi,
> 
> $ARG1 in a nagios check is what comes after the first ! in the check.
> Which module are you using to generate your nagios setup?
> 
> On 23 August 2012 13:44, Marc Lucke  wrote:
>> I note that the check_https command that the puppet module generates is 
>> check_http -H $HOSTNAME -S $ARG1
>> 
>> I'd like to specify $ARG1 so that so that I can check return strings, check 
>> SSL certificates et al. but I couldn't find any way to do it other than 
>> nagios_command which seems pretty wasteful
>> 
>> Is it possible to set $ARG1 ?
>> 
>> 
>> Marc
>> 
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>> 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios service check_https

2012-08-22 Thread Peter Brown
Hi,

$ARG1 in a nagios check is what comes after the first ! in the check.
Which module are you using to generate your nagios setup?

On 23 August 2012 13:44, Marc Lucke  wrote:
> I note that the check_https command that the puppet module generates is 
> check_http -H $HOSTNAME -S $ARG1
>
> I'd like to specify $ARG1 so that so that I can check return strings, check 
> SSL certificates et al. but I couldn't find any way to do it other than 
> nagios_command which seems pretty wasteful
>
> Is it possible to set $ARG1 ?
>
>
> Marc
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios hostgroup collation

2012-06-12 Thread Brian Gallew
As one who has previously used Puppet to drive Nagios configurations (and
attempted to contribute patches to Puppetlabs), allow me offer a somewhat
fabulous alternative: check_mk.  check_mk is a package that can be used to
generate your Nagios configuration in a programmatic fashion.  Here's how
it works for my site:

1) Puppet runs on every host export three files: ${hostname}.mk,
${hostname}.mk.wato, and ${hostname}.parents.mk as well as ensuring that
the check_mk agent is installed, along with our local extensions.
2) Those files are collected on the appropriate Nagios server using tags
and the spaceship operator in a no-replace operation.
3) If new files get written, an exec{} gets kicked off that runs the
check_mk inventory against the new hosts and regenerates the Nagios
configuration.

Step three is where most of the magic happens.  As an example, our check_mk
configuration files specify that hosts named with "c2h" are Resin
application servers.  check_mk will automatically assign the three
web-based checks (port 80 HTTP, port 443 HTTPS, and a /resin-status URL
that gets parsed for app server data).

The programmatic decision on checks makes lots of stuff easy.  Inventory
makes some of the stuff even better.  As an example, ever notice that every
time you use a different network configuration (1-2-3 NICs, bonding,
VLANs), you need to do separate checks and write extra rules?  The
inventory catches all of the current network configuration and watches
that, and any changes will show up as an appropriate notification (in our
case, we chose to mark those as UNKNOWN).  You can also choose to have
weighting on your disks, i.e. a 4GB disk alarms at ~75% utilization while a
30TB filesystem doesn't alarm until it hits ~98%.  The weighting is done
with a strict formula, and isn't always appropriate, but for our
environment it works very well.

On Tue, Jun 12, 2012 at 4:34 PM, Jared Ballou  wrote:

> Hi everyone,
>
> I am reconsidering how I am using the Puppet nagios functionality, at
> the moment I am creating one service for each check on each host. A
> lot of them are identical, and would be better tied to hostgroups to
> simplify my config. Namely, I have about 5,000 checks in there now
> which will go up to about 20K over the next month, and it's taking
> about 5-10 minutes for a Puppet agent run on the nagios server now.
> I've tried running through the spaceship operator to collect hostgroup
> members or assign groups to hosts at realization time, but I can't get
> it working. Does anyone have this sort of setup done for me to poke
> at, or am I stuck with making an object for each check?
>
> Thanks,
>
> -Jared
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios hostgroups

2011-08-16 Thread Jonathan Gazeley
Righto. The puppetmaster is 0.25.5-1.el5 on CentOS 5, while the puppet 
client is 0.25.5-1.el6 on CentOS 6. I'm aware this version is quite old 
now, but it looks like a significant amount of trouble to package a 
newer version for deployment via RPM along with its various dependencies.


I'm successfully using exported resources in several places, for Nagios 
and for other things. My @@nagios_host, @@nagios_service and 
@@nagios_hostgroup all work on any host and the entries show up in my 
storeconfigs database.


In the manifest that is applied to the nagios server, I am using the 
following lines to realise these resources:


  Nagios_host<<||>>
  Nagios_service<<||>>
  Nagios_hostextinfo<<||>>
  Nagios_servicedependency<<||>>
  Nagios_contact<<||>>
  Nagios_command<<||>>
  Nagios_servicegroup<<||>>
  Nagios_hostgroup<<||>>

There's nothing more than this. All of these realisations work, except 
Nagios_hostgroup. The other realisations write out 
/etc/nagios/nagios_host.cfg and similar files, while the 
Nagios_hostgroup one produces no output.


As I mentioned in my last email, no errors are reported in the puppet 
log on either the puppetmaster or the client, hence I'm a bit stuck 
debugging, with nothing to go on.


Thanks,
Jonathan


On 15/08/11 21:53, Denmat wrote:

Hi,

http://docs.puppetlabs.com/guides/exported_resources.html

You will need to include more detail for further help, like version of puppet 
and a snippet of how you are realizing them.

Do any other exported resources work in your manifest?

Cheers,
Den
On 16/08/2011, at 2:08, key...@gmail.com wrote:



Sent from my Verizon Wireless BlackBerry

-Original Message-
From: Jonathan Gazeley
Sender: puppet-users@googlegroups.com
Date: Mon, 15 Aug 2011 17:03:02
To: Puppet Users
Reply-To: puppet-users@googlegroups.com
Subject: [Puppet Users] Nagios hostgroups

Hi all,

I'm using various exported resources for Nagios, including
@@nagios_host, @@nagios_service and others.

Elsewhere in my manifest I am using all of these commands to realise the
resources on my Nagios server. All of these commands work fine except
for Nagios_hostgroup which does not produce the file, as expected.

 Nagios_host<<||>>
 Nagios_service<<||>>
 Nagios_hostextinfo<<||>>
 Nagios_servicedependency<<||>>
 Nagios_contact<<||>>
 Nagios_command<<||>>
 Nagios_servicegroup<<||>>
 Nagios_hostgroup<<||>>

There's nothing in the puppet log either on the puppetmaster or my
Nagios server. Any ideas why this realisation isn't working, or where I
should to debug it?

Thanks,
Jonathan

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.





--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios hostgroups

2011-08-15 Thread Denmat
Hi,

http://docs.puppetlabs.com/guides/exported_resources.html

You will need to include more detail for further help, like version of puppet 
and a snippet of how you are realizing them.

Do any other exported resources work in your manifest?

Cheers,
Den
On 16/08/2011, at 2:08, key...@gmail.com wrote:

> 
> Sent from my Verizon Wireless BlackBerry
> 
> -Original Message-
> From: Jonathan Gazeley 
> Sender: puppet-users@googlegroups.com
> Date: Mon, 15 Aug 2011 17:03:02 
> To: Puppet Users
> Reply-To: puppet-users@googlegroups.com
> Subject: [Puppet Users] Nagios hostgroups
> 
> Hi all,
> 
> I'm using various exported resources for Nagios, including 
> @@nagios_host, @@nagios_service and others.
> 
> Elsewhere in my manifest I am using all of these commands to realise the 
> resources on my Nagios server. All of these commands work fine except 
> for Nagios_hostgroup which does not produce the file, as expected.
> 
> Nagios_host <<||>>
> Nagios_service <<||>>
> Nagios_hostextinfo <<||>>
> Nagios_servicedependency <<||>>
> Nagios_contact <<||>>
> Nagios_command <<||>>
> Nagios_servicegroup <<||>>
> Nagios_hostgroup <<||>>
> 
> There's nothing in the puppet log either on the puppetmaster or my 
> Nagios server. Any ideas why this realisation isn't working, or where I 
> should to debug it?
> 
> Thanks,
> Jonathan
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios hostgroups

2011-08-15 Thread keymon

Sent from my Verizon Wireless BlackBerry

-Original Message-
From: Jonathan Gazeley 
Sender: puppet-users@googlegroups.com
Date: Mon, 15 Aug 2011 17:03:02 
To: Puppet Users
Reply-To: puppet-users@googlegroups.com
Subject: [Puppet Users] Nagios hostgroups

Hi all,

I'm using various exported resources for Nagios, including 
@@nagios_host, @@nagios_service and others.

Elsewhere in my manifest I am using all of these commands to realise the 
resources on my Nagios server. All of these commands work fine except 
for Nagios_hostgroup which does not produce the file, as expected.

 Nagios_host <<||>>
 Nagios_service <<||>>
 Nagios_hostextinfo <<||>>
 Nagios_servicedependency <<||>>
 Nagios_contact <<||>>
 Nagios_command <<||>>
 Nagios_servicegroup <<||>>
 Nagios_hostgroup <<||>>

There's nothing in the puppet log either on the puppetmaster or my 
Nagios server. Any ideas why this realisation isn't working, or where I 
should to debug it?

Thanks,
Jonathan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Martijn Grendelman
On 03-03-11 08:04, Gabriel Filion wrote:
> On 11-03-02 02:27 PM, Brian Gallew wrote:
>> I've found that Puppet/Naginator has the bad habit of occasionally
>> breaking the Nagios config.  Here's how I worked around this: 1) When
>> you collect your Nagios resource, store them all in a temporary
>> directory (in my case, ~nagios/var/tmp) 2) Purge that directory with
>> a cron job every night (so deleted resources disappear) 3) Create an
>> exec that creates a ~nagios/etc/nagios-tmp.cfg by running sed on
>> ~nagios/etc/nagios.cfg and changing directories appropriately. 4)
>> Create an exec that pre-flights Nagios using the nagios-tmp.cfg
>> (which checks the tmp dir) and, if successful, sync the files over
>> into the real Nagios config directory.
>> 
>> It's a little clunky, but Nagios doesn't ever break anymore.
>> Remember that your pre-flight exec should require all the Nagios
>> resources (so the files get updated first), and should always run if
>> the contents of the tmp dir vary at all from the real target (diff is
>> your friend here).  Otherwise, the preflight may fail once and then
>> never run again until the next time you make a substantive server
>> change.
> 
> hmm, that's an interesting approach. it sounds like it requires a lot
> of exec magic but it does cover for the config breakages and also for 
> purging resources. When I finally get some free time, I'll look into 
> implementing that. Thanks for the hint.

Nice! Currently, our Nagios config lives in a Git repository. Before
pulling changes to /etc/nagios3 and restarting Nagios, we pull them to a
temp dir, and with a nagios.conf with adapted paths, we test the config,
just like you describe. This is all pretty much automated, so it's
something I have been thinking about, how to implement that in Puppet.

Step 3 in your description is -in our setup- unnecessary, we just keep the
test-config in our repo as well.

Thanks.

Best regards,
Martijn.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Gabriel Filion
On 11-03-02 02:27 PM, Brian Gallew wrote:
> I've found that Puppet/Naginator has the bad habit of occasionally breaking 
> the Nagios config.  Here's how I worked around this:
> 1) When you collect your Nagios resource, store them all in a temporary 
> directory (in my case, ~nagios/var/tmp)
> 2) Purge that directory with a cron job every night (so deleted resources 
> disappear)
> 3) Create an exec that creates a ~nagios/etc/nagios-tmp.cfg by running sed on 
> ~nagios/etc/nagios.cfg and changing directories appropriately.
> 4) Create an exec that pre-flights Nagios using the nagios-tmp.cfg (which 
> checks the tmp dir) and, if successful, sync the files over into the real 
> Nagios config directory.
> 
> It's a little clunky, but Nagios doesn't ever break anymore.  Remember that 
> your pre-flight exec should require all the Nagios resources (so the files 
> get updated first), and should always run if the contents of the tmp dir vary 
> at all from the real target (diff is your friend here).  Otherwise, the 
> preflight may fail once and then never run again until the next time you make 
> a substantive server change.

hmm, that's an interesting approach. it sounds like it requires a lot of
exec magic but it does cover for the config breakages and also for
purging resources. When I finally get some free time, I'll look into
implementing that. Thanks for the hint.

-- 
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 puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Brian Gallew
I've found that Puppet/Naginator has the bad habit of occasionally breaking the 
Nagios config.  Here's how I worked around this:
1) When you collect your Nagios resource, store them all in a temporary 
directory (in my case, ~nagios/var/tmp)
2) Purge that directory with a cron job every night (so deleted resources 
disappear)
3) Create an exec that creates a ~nagios/etc/nagios-tmp.cfg by running sed on 
~nagios/etc/nagios.cfg and changing directories appropriately.
4) Create an exec that pre-flights Nagios using the nagios-tmp.cfg (which 
checks the tmp dir) and, if successful, sync the files over into the real 
Nagios config directory.

It's a little clunky, but Nagios doesn't ever break anymore.  Remember that 
your pre-flight exec should require all the Nagios resources (so the files get 
updated first), and should always run if the contents of the tmp dir vary at 
all from the real target (diff is your friend here).  Otherwise, the preflight 
may fail once and then never run again until the next time you make a 
substantive server change.


On Mar 2, 2011, at 10:34 AM, Gabriel Filion wrote:

> Hello,
> 
> I finally abandoned the idea of having a group-based sane-looking Nagios
> configuration with puppet, because there are too many weirdnesses in
> Naginator. And unfortunately I can't really bring any help with patches
> since I don't write any ruby..
> 
> There are some great nagios modules out there which you could use, or
> from which you could borrow ideas. Generally speaking, I see that they
> tend to define services for each host and attach them directly to hosts.
> It's big and clunky, but at least it works..
> 
> For example, in an sshd module, you would have something like:
> 
> @@nagios_service { "${fqdn}_ssh":
>  check_command => "check_ssh",
>  host_name => $fqdn,
> }
> 
> 
> The biggest problem I have right now is that purging nagios resources
> doesn't seem to erase anything, so my config gets messed up from time to
> time when nodes are taken out or things are moved around and I need to
> manullay remove nagios config files and have puppet regenerate them :\
> 
> On 11-03-02 09:55 AM, Martijn Grendelman wrote:
>> On 02-03-11 14:49, Brian Gallew wrote:
>>> Sadly, signs point to "no".
>> 
>> Too bad. But since I run a patched Puppetmaster anyway, I can do what I
>> want :-)
>> 
>> Unfortunately, it doesn't solve my problem.
>> 
>> I am trying to do the same thing as Gabriel Filion in this post:
>> http://groups.google.com/group/puppet-users/browse_thread/thread/276e6e694520224d
>> 
>> So, I have a nagios-target class, that defines a virtual resource:
>> 
>>@@nagios_host { "$hostname":
>>use => "generic-host",
>>address => $fqdn,
>>alias => $hostname,
>>ensure => present,
>>hostgroups => [],
>>}
>> 
>> and I would like to do something along the lines of this: in a different
>> class (not a subclass of nagios-target), for example in the class that
>> configures the MTA:
>> 
>>Nagios_host [$hostname] {
>>hostgroups +> "mail-satellite-servers",
>>}
>> 
>> which results in this error:
>> 
>> "Only subclasses can override parameters at ..."
>> 
>> which sounds logical, but...
>> 
>> Is there any way to do what I want? I can't really think of anything,
>> since (variable) scoping will always be in my way, as far as I can see...
>> 
>>> On Wed, Mar 2, 2011 at 5:15 AM, Martijn Grendelman >> > wrote:
>>> 
>>>Hi,
>>> 
>>>A question for the devs. Will this:
>>> 
>>>http://projects.puppetlabs.com/issues/4020
>>> 
>>>make it into a release any time soon?
> 
> 
> -- 
> 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 puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Gabriel Filion
Hello,

I finally abandoned the idea of having a group-based sane-looking Nagios
configuration with puppet, because there are too many weirdnesses in
Naginator. And unfortunately I can't really bring any help with patches
since I don't write any ruby..

There are some great nagios modules out there which you could use, or
from which you could borrow ideas. Generally speaking, I see that they
tend to define services for each host and attach them directly to hosts.
It's big and clunky, but at least it works..

For example, in an sshd module, you would have something like:

@@nagios_service { "${fqdn}_ssh":
  check_command => "check_ssh",
  host_name => $fqdn,
}


The biggest problem I have right now is that purging nagios resources
doesn't seem to erase anything, so my config gets messed up from time to
time when nodes are taken out or things are moved around and I need to
manullay remove nagios config files and have puppet regenerate them :\

On 11-03-02 09:55 AM, Martijn Grendelman wrote:
> On 02-03-11 14:49, Brian Gallew wrote:
>> Sadly, signs point to "no".
> 
> Too bad. But since I run a patched Puppetmaster anyway, I can do what I
> want :-)
> 
> Unfortunately, it doesn't solve my problem.
> 
> I am trying to do the same thing as Gabriel Filion in this post:
> http://groups.google.com/group/puppet-users/browse_thread/thread/276e6e694520224d
> 
> So, I have a nagios-target class, that defines a virtual resource:
> 
> @@nagios_host { "$hostname":
> use => "generic-host",
> address => $fqdn,
> alias => $hostname,
> ensure => present,
> hostgroups => [],
> }
> 
> and I would like to do something along the lines of this: in a different
> class (not a subclass of nagios-target), for example in the class that
> configures the MTA:
> 
> Nagios_host [$hostname] {
> hostgroups +> "mail-satellite-servers",
> }
> 
> which results in this error:
> 
> "Only subclasses can override parameters at ..."
> 
> which sounds logical, but...
> 
> Is there any way to do what I want? I can't really think of anything,
> since (variable) scoping will always be in my way, as far as I can see...
> 
>> On Wed, Mar 2, 2011 at 5:15 AM, Martijn Grendelman > > wrote:
>>
>> Hi,
>>
>> A question for the devs. Will this:
>>
>> http://projects.puppetlabs.com/issues/4020
>>
>> make it into a release any time soon?


-- 
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 puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Brian Gallew
Dude, I struggled with that for more than 6 months, and the position of the 
Puppet people was, "you're doing it wrong".  Since that didn't help my problem 
I ended up doing it this way:
1) Create a new fact (see attached) that reports back to the master server on 
what classes are defined on the client (during the last run!).
2) Create a new function (see attached) that will compute the correct set of 
hostgroups from the class list
3) Create a new fact (see attached) that will determine if the client is a zone 
server (e.g. global zone) or if it's a zone running on a server.
4) Use those to drive my Nagios configs.

Here's the relevant class fragment:

  @@nagios_host {
$fqdn:
  alias => $hostname,
  address => $service_ipaddress,
  max_check_attempts => 3,
  contact_groups => "unix",
  hostgroups => $nagios_hostgroup_list,
  icon_image_alt => $operatingsystem,
  icon_image => "$operatingsystem.png",
  notifications_enabled => 1,
  statusmap_image => "$operatingsystem.gd2",
  tag => inline_template("<%=my_nagios_home.sub(' ','_')%>"), # Puppet 
doesn't like tags with spaces?!?
  notes_url => $cprt_globalzone ? {
global => "https://${hostname}-a.${my_domain}/";,
default => undef,
  },
  parents => $cprt_globalzone ? {
"" => undef,
nil => undef,
global => undef,
default => "${cprt_globalzone}.${my_domain}",
  },
  use => [ $productname ? {
   "Sun Fire X4140" => "host-x4140-template",
   default => "host-generic-template" },
   "host-pnp-template"
   ],
 
 
  }




On Mar 2, 2011, at 6:55 AM, Martijn Grendelman wrote:

> On 02-03-11 14:49, Brian Gallew wrote:
>> Sadly, signs point to "no".
> 
> Too bad. But since I run a patched Puppetmaster anyway, I can do what I
> want :-)
> 
> Unfortunately, it doesn't solve my problem.
> 
> I am trying to do the same thing as Gabriel Filion in this post:
> http://groups.google.com/group/puppet-users/browse_thread/thread/276e6e694520224d
> 
> So, I have a nagios-target class, that defines a virtual resource:
> 
>@@nagios_host { "$hostname":
>use => "generic-host",
>address => $fqdn,
>alias => $hostname,
>ensure => present,
>hostgroups => [],
>}
> 
> and I would like to do something along the lines of this: in a different
> class (not a subclass of nagios-target), for example in the class that
> configures the MTA:
> 
>Nagios_host [$hostname] {
>hostgroups +> "mail-satellite-servers",
>}
> 
> which results in this error:
> 
> "Only subclasses can override parameters at ..."
> 
> which sounds logical, but...
> 
> Is there any way to do what I want? I can't really think of anything,
> since (variable) scoping will always be in my way, as far as I can see...
> 
> Best regards,
> Martijn.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> 
>> On Wed, Mar 2, 2011 at 5:15 AM, Martijn Grendelman > > wrote:
>> 
>>Hi,
>> 
>>A question for the devs. Will this:
>> 
>>http://projects.puppetlabs.com/issues/4020
>> 
>>make it into a release any time soon?
>> 
>>Best regards,
>>Martijn.
>> 
>>--
>>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+unsubscr...@googlegroups.com
>>.
>>For more options, visit this group at
>>http://groups.google.com/group/puppet-users?hl=en.
>> 
>> 
>> -- 
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/puppet-users?hl=en.
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

Facter.add(:cprt_classes) do
setcode do
	open('/var/lib/puppet/state/classes.txt').read().split().join(',') rescue ""
end
end
module Puppet::Parser::Functions
  newfunction(:cprt_calculatehostgroups, :type => :rvalue) do |args|
classlist = lookupvar('cprt_classes').split(',') rescue []
pairs = [['role::service', 'service'],
 ['role::production', 'production'],
 ['role::development', 'development'],
 ['role::auction_server', 'auct

Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Martijn Grendelman
On 02-03-11 14:49, Brian Gallew wrote:
> Sadly, signs point to "no".

Too bad. But since I run a patched Puppetmaster anyway, I can do what I
want :-)

Unfortunately, it doesn't solve my problem.

I am trying to do the same thing as Gabriel Filion in this post:
http://groups.google.com/group/puppet-users/browse_thread/thread/276e6e694520224d

So, I have a nagios-target class, that defines a virtual resource:

@@nagios_host { "$hostname":
use => "generic-host",
address => $fqdn,
alias => $hostname,
ensure => present,
hostgroups => [],
}

and I would like to do something along the lines of this: in a different
class (not a subclass of nagios-target), for example in the class that
configures the MTA:

Nagios_host [$hostname] {
hostgroups +> "mail-satellite-servers",
}

which results in this error:

"Only subclasses can override parameters at ..."

which sounds logical, but...

Is there any way to do what I want? I can't really think of anything,
since (variable) scoping will always be in my way, as far as I can see...

Best regards,
Martijn.

















> 
> On Wed, Mar 2, 2011 at 5:15 AM, Martijn Grendelman  > wrote:
> 
> Hi,
> 
> A question for the devs. Will this:
> 
> http://projects.puppetlabs.com/issues/4020
> 
> make it into a release any time soon?
> 
> Best regards,
> Martijn.
> 
> --
> 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+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
> 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios configuration arrays

2011-03-02 Thread Brian Gallew
Sadly, signs point to "no".

On Wed, Mar 2, 2011 at 5:15 AM, Martijn Grendelman wrote:

> Hi,
>
> A question for the devs. Will this:
>
> http://projects.puppetlabs.com/issues/4020
>
> make it into a release any time soon?
>
> Best regards,
> Martijn.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation

2010-10-01 Thread Jeff McCune
On Sep 30, 2010, at 3:04 PM, Greg Haase wrote:
> I believe that in the past I was able to view this information on my puppet
> server with 
> 
> ralsh nagios_host
> 
> It would give me a listing of what was stored in nagios_host.  Now when I do
> this I see nothing.

I'm not sure if you mean that you expect ralsh nagios_host to return what has 
been exported and stored in the "storedconfig" SQL database, but if you do this 
isn't accurate.

ralsh nagios_host will use the resource abstraction layer to query the current 
state of all resources of type nagios_host as they exist, not as they're stored 
in the database.

Does the distinction make sense?  It might help to run "ralsh user" or "ralsh 
group" to see how the ouput compares to the resources as they exist on the 
system.

Hope this helps,
--
Jeff McCune

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation

2010-10-01 Thread Daniel Pittman
Greg Haase  writes:

> I am exporting my resources to the database. I can verify that this is
> occurring.  Yet I am not getting all of the the
>
> Nagios_host <<|target ==nagios_hosts.${fqdn}.cfg|>>
>
> files written to my nagios server and I am interested in finding out how to
> trace down this functionality of the collection and exportation of resources
> so I can properly identify how/why it is not working in all of the cases.
>
> I guess if someone could point me to a basic model of this exportation and
> collection process I could work from there.  Is there any detailed writing
> about this?

Not other than what folks have pointed to already, I think.  I use this:

,[ client.pp ]
| @@file { "/etc/backuppc/${fqdn}.pl":
|   owner   => 'backuppc', group => 'www-data', mode => 0444,
|   content => template('backuppc/backuppc-client-config.pl.erb'),
|   tag => "backuppc-client-${backuppc_server}"
| }
`

,[ server.pp ]
|   File <<| tag == "backuppc-client-${fqdn}" |>> {
| require => [Package["backuppc"], File["/etc/backuppc/SDBackupPC.pm"]],
| notify  => Service["backuppc"],
|   }
`

...which works fine for our infrastructure.  It looks pretty much identical to
your code, but just in case. :)

Daniel
-- 
✣ Daniel Pittman✉ dan...@rimspace.net☎ +61 401 155 707
   ♽ made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation

2010-10-01 Thread Greg Haase
Avi, 

I am exporting my resources to the database. I can verify that this is
occurring.  Yet I am not getting all of the the

Nagios_host <<|target ==nagios_hosts.${fqdn}.cfg|>>

files written to my nagios server and I am interested in finding out how to
trace down this functionality of the collection and exportation of resources
so I can properly identify how/why it is not working in all of the cases.

I guess if someone could point me to a basic model of this exportation and
collection process I could work from there.  Is there any detailed writing
about this?

Greg




On 9/30/10 3:48 PM, "Avi Miller"  wrote:

> Greg Haase wrote:
>> Are you aware of any documentation that clearly explains how this
>> collect/export functionality works?
> 
> Exporting and collecting resources relies on stored configuration[1]
> being enabled on your Puppet Master. You should ensure that the database
> is configured and working before trying to export and collect resources.
> 
> Cheers,
> Avi
> 
> [1] 
> http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation

2010-09-30 Thread Avi Miller

Greg Haase wrote:

Are you aware of any documentation that clearly explains how this
collect/export functionality works?


Exporting and collecting resources relies on stored configuration[1] 
being enabled on your Puppet Master. You should ensure that the database 
is configured and working before trying to export and collect resources.


Cheers,
Avi

[1] 
http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration


--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation

2010-09-30 Thread Greg Haase
Stephen, 

Ah the David Schmitt nagios module. This is what I based my work on. I used
it as a model. 

Are you aware of any documentation that clearly explains how this
collect/export functionality works?

Greg

On 9/30/10 3:31 PM, "Steven Wagner"  wrote:

> Hi Greg,
> 
> I'm on my phone at the moment so I don't have the exact link handy, but there
> is a module on GitHub that works.  I tinkered with it a lot in my old setup
> but found most of my problems were due to not really understanding how the
> collect/export functionality worked.
> 
> This is my favorite feature of Puppet.  When I got it working, I teared up a
> bit.  :)
> 
> I believe it's http://github.com/DavidS/puppet-nagios
> 
> 
> (mobile edition)
> 
> On Sep 30, 2010, at 3:04 PM, Greg Haase  wrote:
> 
>> Greetings, 
>> 
>> I am working on getting Nagios implemented with Puppet so that when I add a
>> node to Puppet a Nagios configuration file is generated.
>> 
>> I can get nagios installed and configured on the server and the client with
>> no problems.  Yet getting the client configuration file on to the server is
>> not happening. I did have it working at one point in time yet It seems that
>> I cannot get back to that configuration.
>> 
>> I am relying on notation using the @@ and <<||>> I found somewhere in the
>> documentation yet I did not find a proper discussion of exactly how it
>> works.  I don't feel that I have a proper understanding of how it works.
>> 
>> What I understand is that by using the
>> 
>> @@name {}
>> 
>> I can load data into a "global object" that is accessible from any puppet
>> member. Who uses the
>> 
>> name <<||>> 
>> 
>> Notation to call the data stored in that global object.
>> 
>> I believe that in the past I was able to view this information on my puppet
>> server with 
>> 
>> ralsh nagios_host
>> 
>> It would give me a listing of what was stored in nagios_host.  Now when I do
>> this I see nothing.
>> 
>> Here is a listing of what I understand as being a way to use this:
>> 
>> Is this correct?
>> 
>> 
>> -
>> class nagios-server{
>>    A bunch of other stuff ..
>>file { "/etc/nagios/":
>>ensure => 'directory',
>>mode => 755,
>>owner  => nagios,
>>group  => nagios,
>>recurse => true;
>>}
>> Nagios_host  <<|target == "/etc/nagios/nagios_hosts.${fqdn}.cfg"|>>
>> }
>> -
>> class nagios-client {
>>@@nagios_host { $fqdn:
>>target => "/etc/nagios/nagios_hosts.${fqdn}.cfg",
>>ensure => present,
>>alias => $hostname,
>>address => $ipaddress,
>>use => "my-servers",
>>check_command => "check-host-alive",
>>max_check_attempts => 3,
>>hostgroups => "my-servers",
>>contact_groups => "admins",
>>}
>> A bunch of other stuff ..
>> }
>> -
>> 
>> Could someone please point me in the right direction to some documentation
>> that could help clarify this  the use of the @@ and <<||>>?
>> 
>> 
>> I'd greatly appreciate it.
>> 
>> Thanks
>> 
>> Greg
>> Greg Haase
>> gha...@syntheticgenomics.com
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To post to this group, send email to puppet-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> puppet-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/puppet-users?hl=en.
>> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation

2010-09-30 Thread Steven Wagner
Hi Greg,

I'm on my phone at the moment so I don't have the exact link handy, but there 
is a module on GitHub that works.  I tinkered with it a lot in my old setup but 
found most of my problems were due to not really understanding how the 
collect/export functionality worked.

This is my favorite feature of Puppet.  When I got it working, I teared up a 
bit.  :)

I believe it's http://github.com/DavidS/puppet-nagios


(mobile edition)

On Sep 30, 2010, at 3:04 PM, Greg Haase  wrote:

> Greetings, 
> 
> I am working on getting Nagios implemented with Puppet so that when I add a
> node to Puppet a Nagios configuration file is generated.
> 
> I can get nagios installed and configured on the server and the client with
> no problems.  Yet getting the client configuration file on to the server is
> not happening. I did have it working at one point in time yet It seems that
> I cannot get back to that configuration.
> 
> I am relying on notation using the @@ and <<||>> I found somewhere in the
> documentation yet I did not find a proper discussion of exactly how it
> works.  I don't feel that I have a proper understanding of how it works.
> 
> What I understand is that by using the
> 
> @@name {}
> 
> I can load data into a "global object" that is accessible from any puppet
> member. Who uses the
> 
> name <<||>> 
> 
> Notation to call the data stored in that global object.
> 
> I believe that in the past I was able to view this information on my puppet
> server with 
> 
> ralsh nagios_host
> 
> It would give me a listing of what was stored in nagios_host.  Now when I do
> this I see nothing.
> 
> Here is a listing of what I understand as being a way to use this:
> 
> Is this correct? 
> 
> 
> -
> class nagios-server{
>    A bunch of other stuff ..
>file { "/etc/nagios/":
>ensure => 'directory',
>mode => 755,
>owner  => nagios,
>group  => nagios,
>recurse => true;
>}
> Nagios_host  <<|target == "/etc/nagios/nagios_hosts.${fqdn}.cfg"|>>
> }
> -
> class nagios-client {
>@@nagios_host { $fqdn:
>target => "/etc/nagios/nagios_hosts.${fqdn}.cfg",
>ensure => present,
>alias => $hostname,
>address => $ipaddress,
>use => "my-servers",
>check_command => "check-host-alive",
>max_check_attempts => 3,
>hostgroups => "my-servers",
>contact_groups => "admins",
>}
> A bunch of other stuff ..
> }
> -
> 
> Could someone please point me in the right direction to some documentation
> that could help clarify this  the use of the @@ and <<||>>?
> 
> 
> I'd greatly appreciate it.
> 
> Thanks
> 
> Greg
> Greg Haase
> gha...@syntheticgenomics.com
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios allowed hosts, how would you do it?

2010-07-27 Thread Gabriel Filion
On 20/07/10 08:06 AM, Tore wrote:
> Hi,
> 
> We currently have a module `nagios` which install nrpe and nagios
> plugins for all nodes. The default node have this module included.
> 
> Currently we have a customer who wants to monitor their own services.
> We will still monitor them, but they want to do their own checks, fair
> enough.
> 
> How would you do this? This is what I have now:
> 
> node default {
> [...]
>include nagios
>$nagios_allowed_hosts = ["ip1", "ip2"]
> [...]
> }
> 
> But we don't want to add their source IP to this list, so thought this
> would do:
> Keep current default node, add this:
> 
> node special_customer inherits default {
> $nagios_allowed_hosts += "ip"
> }
> 
> And then inherit all of their nodes from this rather than default.
> 

It may look a bit nasty but you could possibly do it with a global variable:

$nagios_allowed_hosts = ['ip1', 'ip2']

node default {
import nagios
// ...
}

node special_customer inherits default {
$nagios_allowed_hosts += ['ip3']
}

-- 
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 puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Types

2010-07-06 Thread Douglas Garstang
On Tue, Jul 6, 2010 at 11:03 AM, James Turnbull  wrote:
> Douglas Garstang wrote:
>> On Tue, Jul 6, 2010 at 12:46 AM, Peter Meier  wrote:
>>> -BEGIN PGP SIGNED MESSAGE-
>>> Hash: SHA1
>>>
 Also, none of the other files created by puppet types are set to be
 readable only by root. I think this might be a bug in puppet.
 Surprised no one has noticed it before.
>>> http://projects.puppetlabs.com/issues/3299
>>
>> I guess someone else did notice it then. Rather surprised by Luke's
>> response to the bug however.
>
> The issue is duplication - if you allow people to manage owner, group
> and permissions in a type when you already have a capability to do so in
> another resource type.

Duplication... exactly... it takes you two operations to do something
that could be done in one. Is there a particular reason that the files
written by the nagios types are readable only by root? If there isn't,
then what is the point? Having to come along and clean up afterwards
with a file type seems like a hack.

Doug.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Types

2010-07-06 Thread James Turnbull
Douglas Garstang wrote:
> On Tue, Jul 6, 2010 at 12:46 AM, Peter Meier  wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>>> Also, none of the other files created by puppet types are set to be
>>> readable only by root. I think this might be a bug in puppet.
>>> Surprised no one has noticed it before.
>> http://projects.puppetlabs.com/issues/3299
> 
> I guess someone else did notice it then. Rather surprised by Luke's
> response to the bug however.

The issue is duplication - if you allow people to manage owner, group
and permissions in a type when you already have a capability to do so in
another resource type.

Regards

James Turnbull

-- 
Puppet Labs - http://www.puppetlabs.com
C: 503-734-8571

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Types

2010-07-06 Thread Douglas Garstang
On Tue, Jul 6, 2010 at 12:46 AM, Peter Meier  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>> Also, none of the other files created by puppet types are set to be
>> readable only by root. I think this might be a bug in puppet.
>> Surprised no one has noticed it before.
>
> http://projects.puppetlabs.com/issues/3299

I guess someone else did notice it then. Rather surprised by Luke's
response to the bug however.

Doug.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Types

2010-07-06 Thread Peter Meier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Also, none of the other files created by puppet types are set to be
> readable only by root. I think this might be a bug in puppet.
> Surprised no one has noticed it before.

http://projects.puppetlabs.com/issues/3299

cheers pete
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwy30EACgkQbwltcAfKi39kBACfV08lOuHOiM6hCiBzDEolHyS7
mdcAniMatqJgAHxqYsZzG4QabOhCythe
=1eXJ
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Types

2010-07-05 Thread Douglas Garstang
On Mon, Jul 5, 2010 at 6:57 PM, Gabriel Filion  wrote:
> On 2010-07-05 19:34, Douglas Garstang wrote:
>> First off, does anyone use the puppet built in nagios types?
>>
>> I just started to play with them, and I noticed that nagios_host
>> writes the nagios_host.cfg file as owned by root, and readable by
>> root, and no on else. Is there a reason for that? Since nagios runs as
>> the nagios user, it can't read the file. Sure, I can change the
>> ownership later with a file {}, but I shouldn't need to.
>>
>> -rw--- 1 root   root 294 Jul  5 16:30 nagios_host.cfg
>>
>> James, hope my tone is acceptable.
>>
>> Doug
>>
>
> This is probably the case since the puppet daemon must run as root to be
> able to install packages and create/remove/modify files. Also, the
> default umask for root is normally set to create files that are not
> accessible to everyone.
>
> As you mentioned, "file {...}" is probably the way to go:
>
>file { nagios_resource_cfg:
>path => "$nagios_basedir/resource.cfg",
>source => [ ... ],
>notify => Service['nagios'],
>owner => root, group => nagios, mode => '0640';
>}
>
> Another possibility would be to use (I havent tested it yet)
>
>File { owner => root, group => nagios, mode => '0640'; }
>
> inside the class in which you declare the nagio file resources so that
> those permissions are the default for the nagios config files.
>

Gabriel, thanks for the reply, but I don't really think that covers it.

Umask for my root user creates files that are world readable:

[r...@test01 ~]# id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[r...@test01 ~]# touch foo
[r...@test01 ~]# ls -l foo
-rw-r--r-- 1 root root 0 Jul  5 20:00 foo

Also, none of the other files created by puppet types are set to be
readable only by root. I think this might be a bug in puppet.
Surprised no one has noticed it before.

Doug.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios Types

2010-07-05 Thread Gabriel Filion
On 2010-07-05 19:34, Douglas Garstang wrote:
> First off, does anyone use the puppet built in nagios types?
> 
> I just started to play with them, and I noticed that nagios_host
> writes the nagios_host.cfg file as owned by root, and readable by
> root, and no on else. Is there a reason for that? Since nagios runs as
> the nagios user, it can't read the file. Sure, I can change the
> ownership later with a file {}, but I shouldn't need to.
> 
> -rw--- 1 root   root 294 Jul  5 16:30 nagios_host.cfg
> 
> James, hope my tone is acceptable.
> 
> Doug
> 

This is probably the case since the puppet daemon must run as root to be
able to install packages and create/remove/modify files. Also, the
default umask for root is normally set to create files that are not
accessible to everyone.

As you mentioned, "file {...}" is probably the way to go:

file { nagios_resource_cfg:
path => "$nagios_basedir/resource.cfg",
source => [ ... ],
notify => Service['nagios'],
owner => root, group => nagios, mode => '0640';
}

Another possibility would be to use (I havent tested it yet)

File { owner => root, group => nagios, mode => '0640'; }

inside the class in which you declare the nagio file resources so that
those permissions are the default for the nagios config files.

-- 
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 puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios client check?

2010-06-28 Thread Daniel Wittenberg
I was thinking I'd have to look at the master logs on server, but looks like 
each host has the state file.  So am I correct in assuming that the state.yaml 
will only get updated/touched on successful run?  This is why I was thinking of 
checking server logs on master to be sure that it completed successfully but 
maybe not necessary ?

Dan


On Jun 28, 2010, at 5:34 PM, Todd Zullinger wrote:

> Daniel Wittenberg wrote:
>> Anyone written a check for nagios to make sure their nodes are
>> checking in and updating correctly?  I think I'd rather have a
>> passive check on the nagios server that just alerts me if something
>> hasn't checked in for last 24 hours rather than having antoher
>> dashboard to go look at.  Anyone tried this?
> 
> There was a thread on this very subject a few weeks back:
> 
> http://groups.google.com/group/puppet-users/browse_thread/thread/ab9cb64b3356cba7
> 
> :)
> 
> -- 
> ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
> ~~
> There's no trick to being a humorist when you have the whole
> government working for you.
>-- Will Rogers.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios client check?

2010-06-28 Thread Todd Zullinger
Daniel Wittenberg wrote:
> Anyone written a check for nagios to make sure their nodes are
> checking in and updating correctly?  I think I'd rather have a
> passive check on the nagios server that just alerts me if something
> hasn't checked in for last 24 hours rather than having antoher
> dashboard to go look at.  Anyone tried this?

There was a thread on this very subject a few weeks back:

http://groups.google.com/group/puppet-users/browse_thread/thread/ab9cb64b3356cba7

:)

-- 
ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
There's no trick to being a humorist when you have the whole
government working for you.
-- Will Rogers.



pgpbd77Uw6l1s.pgp
Description: PGP signature


Re: [Puppet Users] Nagios checks

2010-06-02 Thread Disconnect
I do a very simple check:
# warn if the state files are 90 minutes old, critical at 150
minutes
nagios::service { "puppet_running": check_command =>
"check_puppet_age!7500!9000!2048!2047",
notifications_enabled => 0, }
}

check_puppet_age is: command_line => '/usr/lib/nagios/plugins/check_file_age
-w $ARG1$ -c $ARG2$ -W $ARG3$ -C $ARG4$ -f
/var/lib/puppet/state/state.yaml';

Just checks for state.yaml aging - it misses some problems, but for the most
part it fires as expected when a host is disabled, a manifest is broken,
etc..

On Tue, Jun 1, 2010 at 9:51 PM, Todd Zullinger  wrote:

> Peter Berghold wrote:
> > Has anybody out there written a custom check for Nagios to determine
> > if puppetd and/or puppetmasterd is running? I am considering writing
> > one if not.
>
> FWIW, I've got an overengineered check_puppet and puppetstatus tool
> at: http://tmz.fedorapeople.org/scripts/puppetstatus/
>
> I have found it necessary to disable puppet for a short time to work
> on something and not have puppet helpfully undo my work more than a
> few times.  While it's easy to use puppetd --disable to prevent puppet
> from running, it's also easy to forget to re-enable it.  Or worse, in
> a place with multiple SA's, it's easy for someone else to come along
> and notice puppetd seems to be 'stuck' and 'helpfully' clear out the
> lock file.
>
> Using 'sudo puppetstatus -d "Testing some foo"' creates the lock file
> as puppetd --disable would, but adds the text given and the username
> of the person disabling puppet.  That then shows up in nagios and if
> puppet remains disabled for longer than check_puppet would normally
> consider a critical amount of time, it remains a warning if there is a
> reason in the lockfile.  That also lets other SA's know puppet is down
> intentionally so they don't have to bug me or worry about 'fixing' it.
>
> (The checks in the script to chide folks running it as root are more
> of a goof, to gently prod admins in the habit of doing everything as
> root to stop that. :)
>
> (Oh, and this is in python -- sorry to any ruby lover's who might take
> offense.  I'll try to turn a blind eye to gems and vendor/ dirs if you
> don't complain to much about my python usage.)
>
> --
> ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: 
> www.pobox.com/~tmz/pgp
> ~~
> All of us could take a lesson from the weather.  It pays no attention
> to criticism.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios checks

2010-06-01 Thread Todd Zullinger
Peter Berghold wrote:
> Has anybody out there written a custom check for Nagios to determine
> if puppetd and/or puppetmasterd is running? I am considering writing
> one if not.

FWIW, I've got an overengineered check_puppet and puppetstatus tool
at: http://tmz.fedorapeople.org/scripts/puppetstatus/

I have found it necessary to disable puppet for a short time to work
on something and not have puppet helpfully undo my work more than a
few times.  While it's easy to use puppetd --disable to prevent puppet
from running, it's also easy to forget to re-enable it.  Or worse, in
a place with multiple SA's, it's easy for someone else to come along
and notice puppetd seems to be 'stuck' and 'helpfully' clear out the
lock file.

Using 'sudo puppetstatus -d "Testing some foo"' creates the lock file
as puppetd --disable would, but adds the text given and the username
of the person disabling puppet.  That then shows up in nagios and if
puppet remains disabled for longer than check_puppet would normally
consider a critical amount of time, it remains a warning if there is a
reason in the lockfile.  That also lets other SA's know puppet is down
intentionally so they don't have to bug me or worry about 'fixing' it.

(The checks in the script to chide folks running it as root are more
of a goof, to gently prod admins in the habit of doing everything as
root to stop that. :)

(Oh, and this is in python -- sorry to any ruby lover's who might take
offense.  I'll try to turn a blind eye to gems and vendor/ dirs if you
don't complain to much about my python usage.)

-- 
ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
All of us could take a lesson from the weather.  It pays no attention
to criticism.



pgpABe5qMfujN.pgp
Description: PGP signature


Re: [Puppet Users] Nagios checks

2010-05-28 Thread Joe McDonagh

On 05/27/2010 02:37 PM, Peter Berghold wrote:


Has anybody out there written a custom check for Nagios to determine 
if puppetd and/or puppetmasterd is running? I am considering writing 
one if not.


--
You received this message because you are subscribed to the Google 
Groups "Puppet Users" group.

To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.
I use the one that came with the source download, however it requires a 
rubygem that IMO it probably shouldn't use.


--
--
Joe McDonagh
Operations Engineer
AIM: YoosingYoonickz
IRC: joe-mac on freenode
"When the going gets weird, the weird turn pro."

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios checks

2010-05-27 Thread Richard Crowley
On Thu, May 27, 2010 at 12:19 PM, Michael DeHaan  wrote:
> On Thu, May 27, 2010 at 2:37 PM, Peter Berghold  
> wrote:
>> Has anybody out there written a custom check for Nagios to determine if
>> puppetd and/or puppetmasterd is running? I am considering writing one if
>> not.

I did a minimal check like this on the assumption that both apache2
and puppetmasterd have to be functioning for the response to be 400.

nagios_command { "check_https_port_status":
command_line => "/usr/lib/nagios/plugins/check_http --ssl -H
'\$HOSTADDRESS\$' -I '\$HOSTADDRESS\$' -p '\$ARG1\$' -e '\$ARG2\$'",
}

nagios_service { "puppet-https-8140":
service_description => "HTTPS 8140",
hostgroup_name => "puppetmaster",
check_command => "check_https_port_status!8140!400",
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios checks

2010-05-27 Thread Michael DeHaan
On Thu, May 27, 2010 at 2:37 PM, Peter Berghold  wrote:
> Has anybody out there written a custom check for Nagios to determine if
> puppetd and/or puppetmasterd is running? I am considering writing one if
> not.
>

I've found a few things:

http://www.kallisti.net.nz/blog/2009/02/monitoring-puppet-with-nagios/

http://renatasystems.org/freebsd/check_puppet.html

If folks have others please post them up.

--Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios based on David Schmitt's Complete Config : variables are empty

2010-03-08 Thread David Schmitt

On 3/2/2010 4:40 PM, Joe McDonagh wrote:

gehel wrote:

Hello !

I'm trying to implement a Nagios solution based on David Schmitt's
Complete Config. But I the following error when running puppetd -t -
v :

notice: Starting catalog run
err: //Node[monitoring]/nagios::target/Nagios::Host[]/File[/conf.d/
_host.cfg]/ensure: change from absent to present failed: Could not set
present on ensure: No such file or directory - /conf.d/
_host.cfg.puppettmp at /etc/puppet/modules/nagios/manifests/init.pp:40
notice: Finished catalog run in 3.91 seconds

As far as I understand, the problem comes from :

define host($ip= $fqdn, $short_alias = $fqdn) {
@@file {
"${nagios_cfgdir}/conf.d/${name}_host.cfg":
ensure => present,
content => template( "nagios/host.erb" ),
mode => 644,
owner => root,
group => root,
tag => 'nagios',
}
}

When this definition is run, it seems that ${nagios_cfgdir} and $
{name} are undefined. I am probably missing something quite simple,
but I cant put my finger on it ... Any help ?



My Nagios class is as follow :

class nagios {
$nagios_cfgdir = '/etc/nagios3'

include apache

package {
nagios3 :
alias => 'nagios',
ensure => latest;
[ 'nagios3-common', 'nagios-plugins-basic' ]:
ensure => installed,
before => Package['nagios'];
}
service {
'nagios3':
alias => 'nagios',
ensure => running,
hasstatus => true,
hasrestart => true,
}
file {
"$nagios_cfgdir/htpasswd.users":
content => "admin:QqtpoTN5OGzmA",
mode => 0640,
owner => root,
group => www-data,
}

File <<| tag == 'nagios' |>>

define host($ip= $fqdn, $short_alias = $fqdn) {
@@file {
"${nagios_cfgdir}/conf.d/${name}_host.cfg":
ensure => present,
content => template( "nagios/host.erb" ),
mode => 644,
owner => root,
group => root,
tag => 'nagios',
}
}

class target {
debug ( "$fqdn has $nagios_parent as parent" )
nagios::host { $fqdn: }
}
}

And my nodes.pp :

node 'monitoring' inherits basenode {
include apache

include nagios

$nagios_parent = "generic-host"
include nagios::target
}




Thanks a lot !

Guillaume


Unfortunately, the variable is out of scope. I ran into this problem too
and sadly ended up hard coding the value all over the place because it
would have been difficult to set it in one proper spot, short of
site.pp. Which I may end up doing, since I hate repeating myself. That
project got put on the back burner but I will be re visiting fairly soon.



Exactly. $nagios_cfgdir is supposed to be a site-global configuration. 
You can either use ${nagios::nagios_cfgdir} to reference the variable 
within the class (but "include nagios" in the define, so the variable 
exists already) or put it into your site.pp and forget about it.



Regards, David Schmitt
--
dasz.at OG  Tel: +43 (0)664 2602670 Web: http://dasz.at
Klosterneuburg UID: ATU64260999

   FB-Nr.: FN 309285 g  FB-Gericht: LG Korneuburg

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Nagios based on David Schmitt's Complete Config : variables are empty

2010-03-02 Thread Joe McDonagh

gehel wrote:

Hello !

I'm trying to implement a Nagios solution based on David Schmitt's
Complete Config. But I the following error when running puppetd -t -
v :

notice: Starting catalog run
err: //Node[monitoring]/nagios::target/Nagios::Host[]/File[/conf.d/
_host.cfg]/ensure: change from absent to present failed: Could not set
present on ensure: No such file or directory - /conf.d/
_host.cfg.puppettmp at /etc/puppet/modules/nagios/manifests/init.pp:40
notice: Finished catalog run in 3.91 seconds

As far as I understand, the problem comes from :

  define host($ip= $fqdn, $short_alias = $fqdn) {
@@file {
  "${nagios_cfgdir}/conf.d/${name}_host.cfg":
ensure => present,
content => template( "nagios/host.erb" ),
mode => 644,
owner => root,
group => root,
  tag => 'nagios',
}
  }

When this definition is run, it seems that ${nagios_cfgdir} and $
{name} are undefined. I am probably missing something quite simple,
but I cant put my finger on it ... Any help ?



My Nagios class is as follow :

class nagios {
  $nagios_cfgdir = '/etc/nagios3'

  include apache

  package {
nagios3 :
  alias => 'nagios',
  ensure => latest;
[ 'nagios3-common', 'nagios-plugins-basic' ]:
   ensure => installed,
   before => Package['nagios'];
  }
  service {
'nagios3':
  alias => 'nagios',
  ensure => running,
  hasstatus => true,
  hasrestart => true,
  }
  file {
"$nagios_cfgdir/htpasswd.users":
  content => "admin:QqtpoTN5OGzmA",
  mode => 0640,
  owner => root,
  group => www-data,
  }

  File <<| tag == 'nagios' |>>

  define host($ip= $fqdn, $short_alias = $fqdn) {
@@file {
  "${nagios_cfgdir}/conf.d/${name}_host.cfg":
ensure => present,
content => template( "nagios/host.erb" ),
mode => 644,
owner => root,
group => root,
  tag => 'nagios',
}
  }

  class target {
debug ( "$fqdn has $nagios_parent as parent" )
nagios::host { $fqdn: }
  }
}

And my nodes.pp :

node 'monitoring' inherits basenode {
  include apache

  include nagios

  $nagios_parent = "generic-host"
  include nagios::target
}




Thanks a lot !

Guillaume

  
Unfortunately, the variable is out of scope. I ran into this problem too 
and sadly ended up hard coding the value all over the place because it 
would have been difficult to set it in one proper spot, short of 
site.pp. Which I may end up doing, since I hate repeating myself. That 
project got put on the back burner but I will be re visiting fairly soon.


--
Joe McDonagh
AIM: YoosingYoonickz
IRC: joe-mac on freenode
L'ennui est contre-révolutionnaire

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.