<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<!--
	Copyright (c) 2016 Nagios(R) Core(TM) Development Team
-->

<service_bundle type='manifest' name='NGOS:nrpe'>

	<service
		name='network/nagios/nrpe'
		type='service'
		version='1'>

		<restarter>
			<service_fmri value='svc:/network/inetd:default' />
		</restarter>

		<dependency name='config_data'
			grouping='require_all'
			restart_on='restart'
			type='path'>
			<service_fmri
			    value='file://localhost@sysconfdir@/nrpe.cfg' />
		</dependency>

		<exec_method
			type='method'
			name='inetd_start'
			exec='@sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -i'
			timeout_seconds='0'>
			<method_context>
				<method_credential user='@nrpe_user@' group='@nrpe_group@'/>
			</method_context>
		</exec_method>

		<exec_method
			type='method'
			name='inetd_offline'
			exec=':kill_process'
			timeout_seconds='0'/>

		<exec_method
			type='method'
			name='inetd_disable'
			exec=':kill'
			timeout_seconds='0'/>

		<property_group name='inetd' type='framework'>
			<stability value='Evolving' />
			<propval name='name' type='astring' value='nrpe' />
			<propval name='endpoint_type' type='astring' value='stream' />
			<propval name='proto' type='astring' value='tcp' />
			<propval name='wait' type='boolean' value='false' />
			<propval name='isrpc' type='boolean' value='false' />
		</property_group>

		<property_group name='general' type='framework'>
			<propval name='enabled'
				type='boolean'
				value='false'/>
			<propval name='action_authorization'
				type='astring'
				value='solaris.smf.manage.nrpe'/>
			<propval name='value_authorization'
				type='astring'
				value='solaris.smf.manage.nrpe'/>
		</property_group>

		<instance name='default' enabled='false' />

		<stability value='Unstable' />

		<template>
			<common_name>
				<loctext xml:lang="C">NRPE daemon</loctext>
			</common_name>
			<description>
				<loctext xml:lang="C">
					Nagios Remote Plugin Executor daemon
				</loctext>
			</description>
			<documentation>
				<doc_link name='nagios.org' uri='http://www.nagios.org' />
			</documentation>
		</template>

	</service>

</service_bundle>
