]> git.pld-linux.org Git - SPECS.git/blob - nagios-ocpd.spec
SPECS updated Sun 1 Aug 20:28:02 CEST 2021
[SPECS.git] / nagios-ocpd.spec
1 Summary:        Obsessive Compulsive Host/Service Processor Daemon for Nagios
2 Name:           nagios-ocpd
3 Version:        1.1
4 Release:        1
5 License:        GPL v2+
6 Group:          Networking/Daemons
7 Source0:        ocpd.pl
8 Source1:        README
9 Source2:        ocpd.init
10 URL:            http://wiki.nagios.org/index.php/OCP_Daemon
11 BuildRequires:  perl-Event-Lib
12 BuildRequires:  perl-base
13 BuildRequires:  rpm-perlprov >= 4.1-13
14 BuildRequires:  rpmbuild(macros) >= 1.228
15 Requires(post,preun):   /sbin/chkconfig
16 Requires:       nagios >= 3.1.2-6
17 Requires:       nagios-nsca-client
18 Requires:       perl-Event-Lib >= 1.03-1
19 Requires:       rc-scripts
20 BuildArch:      noarch
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         _libdir         %{_prefix}/lib/nagios
24 %define         _spooldir       %{_var}/spool/nagios
25
26 %description
27 Given the way Nagios operates, running a command every time a
28 host/service check result comes in can greatly reduce the speed at
29 which Nagios can do its work. On huge Nagios setups the checks can end
30 up lagging behind without fully using the server resources.
31
32 There is a way to make Nagios write OCHP/OCSP data into a named pipe
33 instead of running a command every time, and on the other end of the
34 pipe a daemon takes care of sending the data to the master Nagios
35 server.
36
37 %prep
38 %setup -qcT
39 install -p %{SOURCE0} .
40 cp -p %{SOURCE1} .
41
42 %build
43 %{__perl} -c ocpd.pl
44
45 %install
46 rm -rf $RPM_BUILD_ROOT
47 install -d $RPM_BUILD_ROOT{%{_libdir},%{_spooldir},/etc/rc.d/init.d}
48 install -p ocpd.pl $RPM_BUILD_ROOT%{_libdir}/ocpd
49 %{__sed} -i -e 's,/usr/local/nagios/bin/send_nsca,/usr/sbin/send_nsca,' $RPM_BUILD_ROOT%{_libdir}/ocpd
50 touch $RPM_BUILD_ROOT%{_spooldir}/host-perfdata.fifo
51 touch $RPM_BUILD_ROOT%{_spooldir}/service-perfdata.fifo
52 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
53
54 %clean
55 rm -rf $RPM_BUILD_ROOT
56
57 %post
58 for f in service-perfdata.fifo host-perfdata.fifo; do
59         if [ ! -e %{_spooldir}/$f ]; then
60                 mkfifo -m 600 %{_spooldir}/$f
61                 chown nagios:nagios %{_spooldir}/$f
62         fi
63 done
64
65 /sbin/chkconfig --add %{name}
66 %service %{name} restart
67
68 %preun
69 if [ "$1" = "0" ]; then
70         %service -q %{name} stop
71         /sbin/chkconfig --del %{name}
72 fi
73
74 %files
75 %defattr(644,root,root,755)
76 %doc README
77 %attr(754,root,root) /etc/rc.d/init.d/nagios-ocpd
78 %attr(755,root,root) %{_libdir}/ocpd
79 %attr(600,nagios,nagios) %ghost %{_spooldir}/host-perfdata.fifo
80 %attr(600,nagios,nagios) %ghost %{_spooldir}/service-perfdata.fifo
This page took 0.159317 seconds and 3 git commands to generate.