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