]> git.pld-linux.org Git - packages/nagios-nrpe.git/blob - nagios-nrpe.spec
- added tmpfiles config for systemd
[packages/nagios-nrpe.git] / nagios-nrpe.spec
1 Summary:        Nagios remote plugin execution service/plugin
2 Summary(pl.UTF-8):      Demon i wtyczka zdalnego wywoływania wtyczek Nagios
3 Name:           nagios-nrpe
4 Version:        2.13
5 Release:        1
6 License:        GPL v2
7 Group:          Networking
8 Source0:        http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz
9 # Source0-md5:  e5176d9b258123ce9cf5872e33a77c1a
10 Source1:        nrpe.init
11 Source2:        nrpe-command.cfg
12 Source3:        %{name}.tmpfiles
13 Patch0:         %{name}-config.patch
14 Patch1:         nrpe_check_control.patch
15 URL:            http://www.nagios.org/
16 BuildRequires:  autoconf
17 BuildRequires:  automake
18 BuildRequires:  openssl-devel
19 BuildRequires:  openssl-tools
20 BuildRequires:  rpmbuild(macros) >= 1.268
21 Requires(post,preun):   /sbin/chkconfig
22 Requires:       nagios-common
23 Requires:       rc-scripts
24 Provides:       nagios-core
25 Obsoletes:      netsaint-nrpe
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %define         _sysconfdir     /etc/nagios
29 %define         _datadir        %{_prefix}/share/%{name}
30 %define         _plugindir      %{_libdir}/nagios/plugins
31 %define         _libexecdir     %{_plugindir}
32 %define         _localstatedir  %{_var}/log/nagios
33 %define         nsport          5666
34
35 %description
36 NRPE is an addon for Nagios that allows you to execute "local" plugins
37 (like check_disk, check_procs, etc.) on remote hosts. The check_nrpe
38 plugin is called from Nagios and makes plugin execution requests to
39 the NRPE daemon running on the remote host (either as a standalone
40 daemon or as a service under inetd). Supports passing command
41 arguments to server, as well as native SSL/TLS encryption (anonymous
42 DH mode).
43
44 %description -l pl.UTF-8
45 NRPE to dodatek do Nagiosa pozwalający na wywoływanie "lokalnych"
46 wtyczek (takich jak check_disk, check_procs itp.) na zdalnych
47 maszynach. Wtyczka check_nrpe jest wywoływana z poziomu Nagiosa i
48 wysyła żądania uruchomienia wtyczek do demona NRPE działającego na
49 zdalnej maszynie (jako samodzielny demon lub usługa inetd). Obsługuje
50 przekazywanie argumentów poleceń do serwera, a także natywne
51 szyfrowanie SSL/TLS (w trybie anonimowego DH).
52
53 %package -n nagios-plugin-check_nrpe
54 Summary:        check_nrpe plugin for Nagios
55 Summary(pl.UTF-8):      Wtyczka check_nrpe dla Nagiosa
56 Group:          Networking
57 Requires:       nagios-common
58 Provides:       %{name}-plugin = %{version}-%{release}
59 Obsoletes:      nagios-nrpe-plugin < 2.12-6
60
61 %description -n nagios-plugin-check_nrpe
62 check_nrpe plugin for Nagios. This plugin allows running plugins on
63 remote machines using nrpe service.
64
65 %description -n nagios-plugin-check_nrpe -l pl.UTF-8
66 Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie wtyczek
67 na innych komputerach za pomocą demona nrpe.
68
69 %prep
70 %setup -q -n nrpe-%{version}
71 %undos contrib/nrpe_check_control.c
72 %patch0 -p1
73 %patch1 -p1
74
75 %build
76 %{__aclocal}
77 %{__autoconf}
78 %configure \
79         --with-nrpe-port=%{nsport} \
80         --with-nrpe-user=nagios \
81         --with-nrpe-group=nagios \
82         --enable-ssl \
83         --enable-command-args
84
85 %{__make} all
86
87 %{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} contrib/nrpe_check_control.c -o contrib/nrpe_check_control
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{plugins,nrpe.d},%{_libdir}/nagios/plugins,%{_sbindir}} \
92         $RPM_BUILD_ROOT{%{_localstatedir},/var/run/nrpe} \
93         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
94
95 cp -p sample-config/nrpe.cfg $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.cfg
96 sed -e 's,@plugindir@,%{_plugindir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/plugins/check_nrpe.cfg
97 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
98 install -p src/nrpe $RPM_BUILD_ROOT%{_sbindir}
99 install -p src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
100
101 install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %post
107 /sbin/chkconfig --add nrpe
108 %service nrpe restart
109
110 %preun
111 if [ "$1" = "0" ] ; then
112         %service nrpe stop
113         /sbin/chkconfig --del nrpe
114 fi
115
116 %triggerpostun -- %{name} < 2.6-1.1
117 %{__sed} -i -e 's,/var/run/nrpe.pid,/var/run/nrpe/nrpe.pid,' %{_sysconfdir}/nrpe.cfg
118
119 %triggerpostun -n nagios-plugin-check_nrpe -- nagios-plugin-check_nrpe < 2.12-7.1
120 if [ -f %{_sysconfdir}/plugins/nrpe.cfg.rpmsave ]; then
121         cp -f %{_sysconfdir}/plugins/check_nrpe.cfg{,.rpmnew}
122         mv -f %{_sysconfdir}/plugins/{nrpe.cfg.rpmsave,check_nrpe.cfg}
123         sed -i -e 's,-c \$ARG1\$,$ARG1$,' %{_sysconfdir}/plugins/check_nrpe.cfg
124 fi
125
126 %files
127 %defattr(644,root,root,755)
128 %doc Changelog LEGAL README* SECURITY
129 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.cfg
130 %attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d
131 %attr(755,root,root) %{_sbindir}/nrpe
132 %attr(754,root,root) /etc/rc.d/init.d/nrpe
133 %dir %attr(775,root,nagios) /var/run/nrpe
134 /usr/lib/tmpfiles.d/%{name}.conf
135
136 %files -n nagios-plugin-check_nrpe
137 %defattr(644,root,root,755)
138 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/check_nrpe.cfg
139 %attr(755,root,root) %{_plugindir}/check_nrpe
This page took 0.667265 seconds and 4 git commands to generate.