summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/nsca/files/nsca-nagios3')
-rw-r--r--net-analyzer/nsca/files/nsca-nagios336
1 files changed, 36 insertions, 0 deletions
diff --git a/net-analyzer/nsca/files/nsca-nagios3 b/net-analyzer/nsca/files/nsca-nagios3
new file mode 100644
index 000000000000..bef0cb7db976
--- /dev/null
+++ b/net-analyzer/nsca/files/nsca-nagios3
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+
+opts="${opts} reload"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting nsca"
+ start-stop-daemon --start --quiet --name nsca \
+ --startas /usr/bin/nsca \
+ -c nagios:nagios \
+ -- -c /etc/nagios/nsca.cfg \
+ --daemon
+ eend $? "Failed to Start nsca"
+}
+
+stop() {
+ ebegin "Stopping nsca"
+ start-stop-daemon --stop --quiet -n nsca
+ eend $? "Failed to Stop nsca"
+}
+
+reload() {
+ ebegin "Reloading nsca"
+ kill -HUP `pgrep nsca`
+ eend $? "Failed to reload nsca"
+}
+
+restart() {
+ ebegin "Restarting nsca"
+ svc_stop
+ svc_start
+ eend $? "Failed to Restart nsca"
+}