diff --git a/nagios/files/commands.cfg b/nagios/files/commands.cfg index ed1656b..d656f38 100644 --- a/nagios/files/commands.cfg +++ b/nagios/files/commands.cfg @@ -127,6 +127,13 @@ define command{ } +# 'check_dummy' command definition +define command{ + command_name check_dummy + command_line $USER1$/check_dummy $ARG1$ + } + + # 'check_hpjd' command definition define command{ command_name check_hpjd diff --git a/nagios/manifests/init.pp b/nagios/manifests/init.pp index 818eb26..33fc9c9 100644 --- a/nagios/manifests/init.pp +++ b/nagios/manifests/init.pp @@ -291,6 +291,22 @@ class nagios::server inherits nagios::server::manual { } +# Install nagios NSCA service +# +class nagios::server::nsca { + + package { "nsca": + ensure => installed, + } + + service { "nsca": + ensure => running, + enable => true, + } + +} + + # Define nagios email contact. # # === Parameters diff --git a/nagios/manifests/target.pp b/nagios/manifests/target.pp index 99f4cbd..988f162 100644 --- a/nagios/manifests/target.pp +++ b/nagios/manifests/target.pp @@ -442,3 +442,32 @@ define nagios::target::nrpe::service($source=undef, } + +# Install NSCA client tools +# +class nagios::target::nsca inherits nagios::target { + + package { "nsca-client": + ensure => installed, + } + +} + + +# Register new NSCA service to Nagios server +# +# === Sample usage: +# +# nagios::target::nsca::service { "test": } +# +define nagios::target::nsca::service() { + + require nagios::target::nsca + + @@nagios::service { "${::homename}_${name}": + command => "check_dummy!0", + description => $name, + host => $::homename, + } + +}