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