class nagios::client inherits nagios {
realize(
File["/opt/nagios/etc/nrpe.cfg"],
File["/opt/nagios/sbin/nrpe"],
File["/etc/xinetd.d/nrpe"],
)
@@nagios_host { "$fqdn":
use => "generic-host" ,
host_name => "$fqdn" ,
alias => "$fqdn" ,
address => "$ipaddress_eth0" ,
contact_groups => "$nagios_contact_groups" ,
target => "/opt/nagios/etc/$nagios_hostgroup/hosts.cfg" ,
tag => "nagios_host" ,
}
}
define nagios::service ( $use = "generic-service" , $host_name = $fqdn , $service_description , $notification_enabled = 1 , $event_handler = false , $check_command ) {
@@nagios_service { "$service_description":
service_description => $service_description ,
notifications_enabled => $notification_enabled ,
event_handler => $even_handler ,
use => "$use" ,
check_command => "$check_command" ,
target => "/opt/nagios/etc/$nagios_hostgroup/$fqdn" ,
tag => "nagios_service" ,
}
}
~