From 18ed1fb48ea3b2375fa3ad6c4cbae4308cb26c14 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Apr 03 2008 21:43:38 +0000 Subject: Initial import of package into CVS. --- diff --git a/.cvsignore b/.cvsignore index e69de29..1f4b6c0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +nsca-2.7.2.tar.gz diff --git a/nsca-2.7.2-confpath.patch b/nsca-2.7.2-confpath.patch new file mode 100644 index 0000000..cf0b660 --- /dev/null +++ b/nsca-2.7.2-confpath.patch @@ -0,0 +1,11 @@ +--- nsca-2.7.2/src/send_nsca.c.orig 2008-02-18 20:44:32.000000000 -0800 ++++ nsca-2.7.2/src/send_nsca.c 2008-02-18 20:45:05.000000000 -0800 +@@ -25,7 +25,7 @@ + int server_port=DEFAULT_SERVER_PORT; + char server_name[MAX_HOST_ADDRESS_LENGTH]; + char password[MAX_INPUT_BUFFER]=""; +-char config_file[MAX_INPUT_BUFFER]="send_nsca.cfg"; ++char config_file[MAX_INPUT_BUFFER]="/etc/nagios/send_nsca.cfg"; + char delimiter[2]="\t"; + + char received_iv[TRANSMITTED_IV_SIZE]; diff --git a/nsca-2.7.2-initscript.patch b/nsca-2.7.2-initscript.patch new file mode 100644 index 0000000..02bae8f --- /dev/null +++ b/nsca-2.7.2-initscript.patch @@ -0,0 +1,48 @@ +--- init-script.in 2003-01-08 03:57:23.000000000 +0100 ++++ init-script.in 2008-03-11 17:52:45.000000000 +0100 +@@ -5,11 +5,11 @@ + # This script takes care of starting and stopping the NSCA daemon. + # Modeled after init script for NRPE written by jaclu@grm.se + # +-# chkconfig: 2345 80 30 ++# chkconfig: - 80 20 + # description: nsca is a daemon for accepting service check results \ + # from applications running on other hosts. + # processname: nsca +-# config: /usr/local/nagios/etc/nsca.cfg ++# config: /etc/nagios/nsca.cfg + + # Source function library + if [ -f /etc/rc.d/init.d/functions ]; then +@@ -26,7 +26,7 @@ + # Check that networking is up. + [ ${NETWORKING} = "no" ] && exit 0 + +-NscaBin=@bindir@/nsca ++NscaBin=@sbindir@/nsca + NscaCfg=@sysconfdir@/nsca.cfg + LockFile=/var/lock/subsys/nsca + +@@ -51,11 +51,21 @@ + $0 stop + $0 start + ;; ++ reload) ++ echo -n $"Reloading nsca: " ++ killproc nsca -HUP ++ RETVAL=$? ++ echo ++ ;; ++ condrestart) ++ [ -e $LockFile ] && restart ++ RETVAL=$? ++ ;; + status) + status nsca + ;; + *) +- echo "Usage: nsca {start|stop|restart|status}" ++ echo "Usage: nsca {start|stop|restart|reload|condrestart|status}" + exit 1 + esac + diff --git a/nsca.spec b/nsca.spec new file mode 100644 index 0000000..63c70e0 --- /dev/null +++ b/nsca.spec @@ -0,0 +1,140 @@ +Summary: Nagios Service Check Acceptor +Name: nsca +Version: 2.7.2 +Release: 6%{?dist} +License: GPLv2+ +Group: Applications/System +URL: http://www.nagios.org/ +Source: http://downloads.sourceforge.net/nagios/nsca-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Patch0: nsca-2.7.2-initscript.patch +Patch1: nsca-2.7.2-confpath.patch + +BuildRequires: libmcrypt-devel +Requires: nagios +Requires(preun): /sbin/service, /sbin/chkconfig +Requires(post): /sbin/chkconfig +Requires(postun): /sbin/service + + +%description +The purpose of this addon is to allow you to execute Nagios/NetSaint +plugins on a remote host in as transparent a manner as possible. + + +%package client +Group: Applications/System +Summary: Client application for sending updates to a nsca server + + +%description client +Client application for sending updates to a nsca server. + + +%prep +%setup -q +%patch0 -p0 -b .initscript +%patch1 -p1 -b .confpath +# Change defaults in the config file to match the nagios package +sed -i -e "s|^command_file=.*|command_file=%{_localstatedir}/spool/nagios/cmd/nagios.cmd|" \ + -e "s|^alternate_dump_file=.*|alternate_dump_file=%{_localstatedir}/spool/nagios/cmd/nsca.dump|" \ + sample-config/nsca.cfg.in + + +%build +%configure \ + --sysconfdir="%{_sysconfdir}/nagios" \ + --localstatedir="%{_localstatedir}/log/nagios" \ + --with-nsca-user="nagios" \ + --with-nsca-grp="nagios" \ + --with-nsca-port="5667" +make %{?_smp_mflags} all + + +%install +rm -rf %{buildroot} +install -Dp -m 0755 src/nsca %{buildroot}%{_sbindir}/nsca +install -Dp -m 0755 src/send_nsca %{buildroot}%{_sbindir}/send_nsca +install -Dp -m 0644 sample-config/nsca.cfg %{buildroot}%{_sysconfdir}/nagios/nsca.cfg +install -Dp -m 0644 sample-config/send_nsca.cfg %{buildroot}%{_sysconfdir}/nagios/send_nsca.cfg +install -Dp -m 0755 init-script %{buildroot}%{_initrddir}/nsca + + +%post +/sbin/chkconfig --add nsca || : + + +%preun +if [ $1 -eq 0 ]; then + /sbin/service nsca stop &>/dev/null + /sbin/chkconfig --del nsca || : +fi + + +%postun +if [ "$1" -ge "1" ]; then + /sbin/service nsca condrestart &>/dev/null || : +fi + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,0755) +%doc Changelog LEGAL README SECURITY +%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/nagios/nsca.cfg +%{_initrddir}/nsca +%{_sbindir}/nsca + + +%files client +%defattr(-,root,root,-) +%doc Changelog LEGAL README SECURITY +%dir %{_sysconfdir}/nagios +%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/nagios/send_nsca.cfg +%{_sbindir}/send_nsca + + +%changelog +* Mon Mar 31 2008 Wart - 2.7.2-6 +- Change license to match sources + +* Tue Mar 11 2008 Xavier Bachelot - 2.7.2-5 +- Fix and rename initscript patch. +- Let client sub-package own %%{_sysconfdir}/nagios. + +* Sun Mar 09 2008 Wart - 2.7.2-4 +- Merge sed script for init script into the init script patch + +* Mon Mar 03 2008 Xavier Bachelot - 2.7.2-3 +- Sync with Wart's package (rhbz#433547). + +* Thu Feb 07 2008 Xavier Bachelot - 2.7.2-2 +- Split daemon and client. + +* Wed Feb 02 2008 Xavier Bachelot - 2.7.2-1 +- Update to 2.7.2. +- Clean up spec. + +* Mon Dec 11 2006 Dag Wieers - 2.6-1 +- Updated to release 2.6. + +* Wed Feb 08 2006 Dag Wieers - 2.5-2 +- Removed -s option in sysv script. (Rick Johnson) + +* Wed Feb 08 2006 Dag Wieers - 2.5-1 +- Updated to release 2.5. + +* Tue Nov 11 2003 Dag Wieers - 2.4-2 +- Fixed command_file and alternate_dump_file in nsca.cfg. (Johan Krisar) +- Removed the nagios dependency. (Johan Krisar) +- Added %%{_localstatedir}/spool/nagios/ as directoriy to filelist. + +* Mon Oct 27 2003 Dag Wieers - 2.4-1 +- Fixed default port and xinetd file. (Shad L. Lords) + +* Mon Oct 06 2003 Dag Wieers - 2.4-0 +- Initial package. (using DAR) diff --git a/sources b/sources index e69de29..def72d6 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +33a98e7975f633a9489d7a8938ed6131 nsca-2.7.2.tar.gz