| 1 |
# This would be the module you put on all your nrpe-monitored nodes |
| 2 |
class site_nagios::mcollective { |
| 3 |
# fake install nrpe |
| 4 |
file { ['/etc/nagios', '/etc/nagios/nrpe.d']: |
| 5 |
ensure => 'directory', |
| 6 |
} |
| 7 |
|
| 8 |
file { '/etc/nagios/nrpe.d/hello_world.cfg': |
| 9 |
content => "command[hello_world]=echo Hello World!\n", |
| 10 |
} |
| 11 |
|
| 12 |
mcollective::plugin { 'nrpe': |
| 13 |
package => true, |
| 14 |
} |
| 15 |
|
| 16 |
mcollective::actionpolicy { 'nrpe': |
| 17 |
default => 'deny', |
| 18 |
} |
| 19 |
|
| 20 |
mcollective::actionpolicy::rule { 'root nrpe': |
| 21 |
agent => 'nrpe', |
| 22 |
callerid => 'cert=root', |
| 23 |
} |
| 24 |
|
| 25 |
mcollective::actionpolicy::rule { 'nagios nrpe': |
| 26 |
agent => 'nrpe', |
| 27 |
callerid => 'cert=nagios', |
| 28 |
actions => 'runcommand', |
| 29 |
} |
| 30 |
} |