diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 86 |
1 files changed, 50 insertions, 36 deletions
@@ -78,11 +78,24 @@ files directly. NRPE Services ------------- -NRPE Services can be defines as i.e.: +Some Nagios services need to be checked via NRPE. The following will make the +nagios server define a service that will check the NRPE command 'check_cpu' on +the current node: + + nagios::service { 'CPU Usage': + use_nrpe => true, + check_command => "check_cpu", + nrpe_args => "-t 60" + } + +NRPE Commands +------------- + +To be able to call NRPE commands on a host, one needs to define that command +and what it is going to execute: - nagios::service { 'CPU Usage': use_nrpe => 'true', - check_command => "check_cpu", - nrpe_args => "-t 60" + nagios::nrpe::command { 'debsums': + check_command => '/usr/lib/nagios/plugins/check_debsums openssh-server' } @@ -200,50 +213,51 @@ Examples Usage example: +~~~ node nagios { - include nagios::apache - include nagios::defaults - - # Declare another nagios command - nagios::command { http_port: command_line -=> '/usr/lib/nagios/plugins/check_http -p $ARG1$ -H $HOSTADDRESS$ -I -$HOSTADDRESS$' - - # Declare unmanaged hosts - nagios_host { - 'router01.mydomain.com': - alias => 'router01', - notes => 'MyDomain Gateway', - address => "10.0.0.1", - use => 'generic-host'; - "router02.mydomain.com": - alias => 'router02', - address => '192.168.0.1', - parents => 'router01', - use => 'generic-host'; - } + class { 'nagios::apache': } -> class { 'nagios::defaults': } + + # Declare another nagios command + nagios::command { http_port: + command_line => '/usr/lib/nagios/plugins/check_http -p $ARG1$ -H $HOSTADDRESS$ -I $HOSTADDRESS$' + } + + # Declare unmanaged hosts + nagios_host { + 'router01.mydomain.com': + alias => 'router01', + notes => 'MyDomain Gateway', + address => '10.0.0.1', + use => 'generic-host'; + 'router02.mydomain.com': + alias => 'router02', + address => '192.168.0.1', + parents => 'router01', + use => 'generic-host'; + } } node target { - # Monitor this host - class{'nagios::target': - parents = 'router01' - } + # Monitor this host + class{'nagios::target': + parents = 'router01' + } - # monitor a service - $apache2_port = 8080 - include apache2 + # monitor a service + $apache2_port = 8080 + include apache2 - # This actually does this somewhere: - #nagios::service { "http_${apache2_port}": - # check_command => "http_port!${apache2_port}" - #} + # This actually does this somewhere: + #nagios::service { "http_${apache2_port}": + # check_command => "http_port!${apache2_port}" + #} } +~~~ TODO ==== |