simple icinga/nrpe example manifest

52 views
Skip to first unread message

Andy Brown

unread,
Jul 16, 2013, 9:45:05 AM7/16/13
to example42-pu...@googlegroups.com
Folks,

can someone please point me to an example manifest showing how to make use of the icinga and nrpe modules?

cheers, Andy

Background: 
I've been struggling to understand the per-module example42 documentation. I don't have a clear picture of how exported resources are being used to configure hostgroups, for example.
I'm an experienced engineer, so please don't just tell me to rtfm - I've crawled all over the web doing that ;)
I have two vm's - one as the icinga server, one monitored.
here's my manifest:

node 'monitored-node.home'
{
  class { 'nrpe': use_ssl => false }
  class {'icinga::target': automatic_host => false}
  icinga::host {$fqdn: hostgroups => 'type1-boxes'}
}

node 'icinga-server.home' {
class { 'icinga':
enable_idoutils           => false,
                use_ssl  => false,
  }

  icinga::hostgroup {'type1-boxes':}
}

Alessandro Franceschi

unread,
Jul 16, 2013, 10:36:39 AM7/16/13
to example42-pu...@googlegroups.com
To be honest I usually use the monitor wrapper in my setups, with top scope variables like:
$monitor = true
$monitor_tool = [ 'puppi' , 'icinga' ]

(Puppi as monitor_tool allows you to run locally on the server, with the command "puppi check" the same checks you'll find on Icinga)

That's enough for all the nodes (when they use Example42 modules),
on the Icinga server you basically just need:

include icinga

There are then various options on how to configure the monitoring.

Automatic Hostgroups management is a bit a PITA, the icinga module provides the possibility to create automatically hostgroups according to a custom variable, for example you may set (at top scope) something like:
$::icinga_hostgrouplogic = 'role'
and on your Icinga server automatic hostgroup for each role should be created.
To create custom hostgroups use
icinga::hostgroup (on the Icinga server)
and to assign a node to an host group use the hostgroup parameters in icinga::host (on the monitored node)
Actually your piece of code should work.
Reply all
Reply to author
Forward
0 new messages