1 |
Summary: Nagios nsca integration |
2 |
%define name smeserver-nagios-nsca |
3 |
Name: %{name} |
4 |
%define version 1.0.1 |
5 |
%define release 0 |
6 |
Version: %{version} |
7 |
Release: %{release} |
8 |
License: GPL |
9 |
Group: Applications/System |
10 |
Source: %{name}-%{version}.tar.gz |
11 |
Packager: Michael Weinberger <mweinber@neddix.de> |
12 |
BuildRoot: /var/tmp/%{name}-buildroot/ |
13 |
BuildArch: noarch |
14 |
Requires: smeserver-release >= 7.1.3 |
15 |
Requires: nagios-nsca >= 2.6 |
16 |
AutoReq: no |
17 |
|
18 |
%changelog |
19 |
* Thu Oct 1 2007 Michael Weinberger <mweinber@neddix.de> |
20 |
- Initial release |
21 |
|
22 |
%description |
23 |
Nagios nsca integration |
24 |
|
25 |
Setting the TCP wrapper allowed hosts: |
26 |
config setprop nsca HostsAllow "127.0.0.1 10.203.104.0/255.255.252.0 172.22.32.0/255.255.240.0" |
27 |
expand-template /etc/hosts.allow |
28 |
|
29 |
|
30 |
%prep |
31 |
%setup |
32 |
%setup -q -n %{name}-%{version} |
33 |
|
34 |
%build |
35 |
|
36 |
%install |
37 |
rm -rf $RPM_BUILD_ROOT |
38 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
39 |
rm -f %{name}-%{version}-filelist |
40 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
41 |
>> %{name}-%{version}-filelist |
42 |
find $RPM_BUILD_ROOT -depth -type l -print |\ |
43 |
sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist |
44 |
|
45 |
%clean |
46 |
rm -rf $RPM_BUILD_ROOT |
47 |
|
48 |
%pre |
49 |
|
50 |
%post |
51 |
/sbin/e-smith/config printtype nsca > /dev/null || /sbin/e-smith/config set nsca service |
52 |
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
53 |
/sbin/e-smith/expand-template /etc/hosts.allow |
54 |
/sbin/e-smith/service nsca restart |
55 |
fi |
56 |
|
57 |
%preun |
58 |
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
59 |
if [ $1 = 0 ] ; then # uninstall |
60 |
/sbin/e-smith/service nsca stop |
61 |
fi |
62 |
fi |
63 |
|
64 |
|
65 |
%postun |
66 |
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
67 |
if [ $1 = 0 ] ; then # uninstall |
68 |
/sbin/e-smith/expand-template /etc/hosts.allow |
69 |
fi |
70 |
fi |
71 |
|
72 |
%files -f %{name}-%{version}-filelist |
73 |
%defattr(-,root,root) |