]> git.pld-linux.org Git - packages/nagios-nrpe.git/blame - nagios-nrpe.spec
move nrpe command definitions to nrpe.d/commands.cfg
[packages/nagios-nrpe.git] / nagios-nrpe.spec
CommitLineData
9f54c7ed 1Summary: Nagios remote plugin execution service/plugin
32b335f7 2Summary(pl.UTF-8): Demon i wtyczka zdalnego wywoływania wtyczek Nagios
884ffea2 3Name: nagios-nrpe
989908be 4Version: 2.15
ea740bab 5Release: 4
6095acef
PZ
6License: GPL v2
7Group: Networking
56070b30 8Source0: http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz
989908be 9# Source0-md5: 3921ddc598312983f604541784b35a50
283125e4 10Source1: nrpe.init
8a6ed10e 11Source2: nrpe-command.cfg
bdffdf09 12Source3: %{name}.tmpfiles
ea740bab 13Source4: commands.cfg
dc04870c 14Patch0: %{name}-config.patch
a572586a 15Patch1: nrpe_check_control.patch
6095acef 16URL: http://www.nagios.org/
bef67369 17BuildRequires: openssl-devel
f384e93f 18BuildRequires: openssl-tools
65eed899 19BuildRequires: rpmbuild(macros) >= 1.647
74881710 20Requires(post,preun): /sbin/chkconfig
fab2344e 21Requires: nagios-common
783f405f 22Requires: rc-scripts
7186fe13 23Provides: nagios-core
c1473eca 24Obsoletes: netsaint-nrpe
884ffea2 25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
6095acef
PZ
26
27%define _sysconfdir /etc/nagios
28%define _datadir %{_prefix}/share/%{name}
29%define _plugindir %{_libdir}/nagios/plugins
fcdb117d 30%define _libexecdir %{_plugindir}
6095acef 31%define _localstatedir %{_var}/log/nagios
6095acef
PZ
32%define nsport 5666
33
34%description
475d9adc
ER
35NPRE (Nagios Remote Plugin Executor) is a system daemon that will
36execute various Nagios plugins locally on behalf of a remote
37(monitoring) host that uses the check_nrpe plugin.
6095acef 38
84d968ba
JR
39%description -l pl.UTF-8
40NRPE to dodatek do Nagiosa pozwalający na wywoływanie "lokalnych"
d951bfe3 41wtyczek (takich jak check_disk, check_procs itp.) na zdalnych
84d968ba
JR
42maszynach. Wtyczka check_nrpe jest wywoływana z poziomu Nagiosa i
43wysyła żądania uruchomienia wtyczek do demona NRPE działającego na
44zdalnej maszynie (jako samodzielny demon lub usługa inetd). Obsługuje
45przekazywanie argumentów poleceń do serwera, a także natywne
d951bfe3 46szyfrowanie SSL/TLS (w trybie anonimowego DH).
6095acef 47
0a9173a1 48%package -n nagios-plugin-check_nrpe
6095acef 49Summary: check_nrpe plugin for Nagios
32b335f7 50Summary(pl.UTF-8): Wtyczka check_nrpe dla Nagiosa
6095acef 51Group: Networking
f4d9de42 52Requires: nagios-common
0a9173a1 53Provides: %{name}-plugin = %{version}-%{release}
56070b30 54Obsoletes: nagios-nrpe-plugin < 2.12-6
6095acef 55
0a9173a1 56%description -n nagios-plugin-check_nrpe
475d9adc
ER
57The check_nrpe plugin is called from Nagios and makes plugin execution
58requests to the NRPE daemon running on the remote host. Supports
59passing command arguments to server, as well as native SSL/TLS
60encryption (anonymous DH mode).
6095acef 61
0a9173a1 62%description -n nagios-plugin-check_nrpe -l pl.UTF-8
783f405f 63Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie wtyczek
84d968ba 64na innych komputerach za pomocą demona nrpe.
6095acef
PZ
65
66%prep
283125e4 67%setup -q -n nrpe-%{version}
a572586a 68%undos contrib/nrpe_check_control.c
e3dd2648 69%patch0 -p1
a572586a 70%patch1 -p1
6095acef
PZ
71
72%build
6095acef 73%configure \
6095acef 74 --with-nrpe-port=%{nsport} \
e8316598 75 --with-nrpe-user=nagios \
56070b30 76 --with-nrpe-group=nagios \
ba61d89b 77 --enable-ssl \
a9eca6a0 78 --with-ssl-lib=%{_libdir} \
ba61d89b 79 --enable-command-args
6095acef
PZ
80
81%{__make} all
82
a572586a
ER
83%{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} contrib/nrpe_check_control.c -o contrib/nrpe_check_control
84
6095acef
PZ
85%install
86rm -rf $RPM_BUILD_ROOT
56070b30 87install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{plugins,nrpe.d},%{_libdir}/nagios/plugins,%{_sbindir}} \
bdffdf09 88 $RPM_BUILD_ROOT{%{_localstatedir},/var/run/nrpe} \
65eed899 89 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
6095acef 90
56070b30 91cp -p sample-config/nrpe.cfg $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.cfg
ea740bab 92cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.d
5dffe4d7 93sed -e 's,@plugindir@,%{_plugindir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/plugins/check_nrpe.cfg
56070b30
ER
94install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
95install -p src/nrpe $RPM_BUILD_ROOT%{_sbindir}
96install -p src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
65eed899 97cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
bdffdf09 98
6095acef
PZ
99%clean
100rm -rf $RPM_BUILD_ROOT
101
6095acef 102%post
50034c16 103/sbin/chkconfig --add nrpe
c18c6a62 104%service nrpe restart
6095acef
PZ
105
106%preun
107if [ "$1" = "0" ] ; then
c18c6a62 108 %service nrpe stop
50034c16 109 /sbin/chkconfig --del nrpe
6095acef
PZ
110fi
111
ea740bab
ER
112%triggerpostun -- %{name} < 2.15-4
113# skip *this* trigger on downgrade
114[ $1 -le 1 ] && exit 0
115
116# check if need to migrate
117grep -q '^command\[' %{_sysconfdir}/nrpe.cfg || exit 0
118
119# move command definitions to separate file
120mv -f %{_sysconfdir}/nrpe.d/commands.cfg{,.rpmnew}
121grep '^command\[' %{_sysconfdir}/nrpe.cfg > %{_sysconfdir}/nrpe.d/commands.cfg
122cp -f %{_sysconfdir}/nrpe.cfg{,.rpmsave}
123sed -i -e '/^command\[/d' %{_sysconfdir}/nrpe.cfg
124%service nrpe restart
125
ce845d3e
ER
126%triggerpostun -- %{name} < 2.6-1.1
127%{__sed} -i -e 's,/var/run/nrpe.pid,/var/run/nrpe/nrpe.pid,' %{_sysconfdir}/nrpe.cfg
128
5dffe4d7
ER
129%triggerpostun -n nagios-plugin-check_nrpe -- nagios-plugin-check_nrpe < 2.12-7.1
130if [ -f %{_sysconfdir}/plugins/nrpe.cfg.rpmsave ]; then
131 cp -f %{_sysconfdir}/plugins/check_nrpe.cfg{,.rpmnew}
132 mv -f %{_sysconfdir}/plugins/{nrpe.cfg.rpmsave,check_nrpe.cfg}
133 sed -i -e 's,-c \$ARG1\$,$ARG1$,' %{_sysconfdir}/plugins/check_nrpe.cfg
134fi
135
6095acef
PZ
136%files
137%defattr(644,root,root,755)
138%doc Changelog LEGAL README* SECURITY
783f405f 139%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.cfg
56070b30 140%attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d
ea740bab 141%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.d/commands.cfg
6095acef 142%attr(755,root,root) %{_sbindir}/nrpe
ce845d3e
ER
143%attr(754,root,root) /etc/rc.d/init.d/nrpe
144%dir %attr(775,root,nagios) /var/run/nrpe
65eed899 145%{systemdtmpfilesdir}/%{name}.conf
6095acef 146
0a9173a1 147%files -n nagios-plugin-check_nrpe
6095acef 148%defattr(644,root,root,755)
5dffe4d7 149%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/check_nrpe.cfg
8a6ed10e 150%attr(755,root,root) %{_plugindir}/check_nrpe
This page took 0.120244 seconds and 4 git commands to generate.