Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/nsca/files: nsca.init nsca-nagios3 nsca.conf
Date: Thu, 23 Aug 2012 21:27:28
Message-Id: 20120823212708.E465C204CB@flycatcher.gentoo.org
1 flameeyes 12/08/23 21:27:08
2
3 Added: nsca.init nsca-nagios3 nsca.conf
4 Log:
5 Move from net-analyzer/nagios-nsca to net-analyzer/nsca, as the package work with Icinga just fine.
6
7 (Portage version: 2.2.0_alpha121/cvs/Linux x86_64, RepoMan options: --force)
8
9 Revision Changes Path
10 1.1 net-analyzer/nsca/files/nsca.init
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nsca/files/nsca.init?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nsca/files/nsca.init?rev=1.1&content-type=text/plain
14
15 Index: nsca.init
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2012 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/nsca/files/nsca.init,v 1.1 2012/08/23 21:27:08 flameeyes Exp $
21
22 : ${CFGFILE:=/etc/nagios/nsca.cfg}
23
24 get_config() {
25 [ -f ${CFGFILE} ] || return 1
26
27 sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \
28 ${CFGFILE}
29 }
30
31 extra_started_commands="reload"
32
33 command=/usr/libexec/${SVCNAME}
34 command_args="-c ${CFGFILE} --daemon"
35 pidfile=$(get_config pid_file)
36
37 depend() {
38 config ${CFGFILE}
39
40 need net
41 case $(get_config nsca_user) in
42 icinga) need icinga ;;
43 nagios) need nagios ;;
44 esac
45 }
46
47 reload() {
48 ebegin "Reloading nsca"
49 kill -HUP `cat $(get_config pid_file)`
50 eend $? "Failed to reload nsca"
51 }
52
53
54
55 1.1 net-analyzer/nsca/files/nsca-nagios3
56
57 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nsca/files/nsca-nagios3?rev=1.1&view=markup
58 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nsca/files/nsca-nagios3?rev=1.1&content-type=text/plain
59
60 Index: nsca-nagios3
61 ===================================================================
62 #!/sbin/runscript
63
64 opts="${opts} reload"
65
66 depend() {
67 need net
68 }
69
70 start() {
71 ebegin "Starting nsca"
72 start-stop-daemon --start --quiet --name nsca \
73 --startas /usr/bin/nsca \
74 -c nagios:nagios \
75 -- -c /etc/nagios/nsca.cfg \
76 --daemon
77 eend $? "Failed to Start nsca"
78 }
79
80 stop() {
81 ebegin "Stopping nsca"
82 start-stop-daemon --stop --quiet -n nsca
83 eend $? "Failed to Stop nsca"
84 }
85
86 reload() {
87 ebegin "Reloading nsca"
88 kill -HUP `pgrep nsca`
89 eend $? "Failed to reload nsca"
90 }
91
92 restart() {
93 ebegin "Restarting nsca"
94 svc_stop
95 svc_start
96 eend $? "Failed to Restart nsca"
97 }
98
99
100
101 1.1 net-analyzer/nsca/files/nsca.conf
102
103 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nsca/files/nsca.conf?rev=1.1&view=markup
104 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nsca/files/nsca.conf?rev=1.1&content-type=text/plain
105
106 Index: nsca.conf
107 ===================================================================
108 # Choose the configuration file to use; the pre-defined configurations
109 # for Nagios and Icinga are available in their respective directories:
110 # /etc/nagios/nsca.cfg
111 # /etc/icinga/nsca.cfg
112 CFGFILE=/etc/nagios/nsca.cfg