summaryrefslogtreecommitdiff
blob: d83171e22facd4dcc88473f4edcfc7a3e00aed99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/sbin/runscript

opts="${opts} reload"

depend() {
	need net
}

start() {
	ebegin "Starting nrpe"
	start-stop-daemon --start --quiet --name nrpe \
	--startas /usr/bin/nrpe \
		-c nagios:nagios \
		-- -c /etc/nagios/nrpe.cfg \
		--daemon
	eend $? "Failed to Start nrpe"
}

stop() {
	ebegin "Stopping nrpe"
	start-stop-daemon --stop --quiet -n nrpe
	eend $? "Failed to Stop nrpe"
}

reload() {
	ebegin "Reloading nrpe"
	kill -HUP `pgrep nrpe | head -1`
	eend $? "Failed to reload nrpe"
}

restart() {
	ebegin "Restarting nrpe"
	svc_stop
	svc_start
	eend $? "Failed to Restart nrpe"
}