2024-01-06 07:30:52 +01:00
|
|
|
%define nrpeport 5666
|
|
|
|
%define nrpeuser nrpe
|
|
|
|
%define nrpegroup nrpe
|
|
|
|
|
|
|
|
Name: nagios-nrpe
|
2024-01-06 07:30:54 +01:00
|
|
|
Version: 4.1.0
|
2024-01-06 07:30:53 +01:00
|
|
|
Release: 1mamba
|
2024-01-06 07:30:52 +01:00
|
|
|
Summary: Nagios Remote Plugin Executor (NRPE)
|
|
|
|
Group: Network/Monitoring
|
|
|
|
Vendor: openmamba
|
|
|
|
Distribution: openmamba
|
|
|
|
Packager: Davide Madrisan <davide.madrisan@gmail.com>
|
2024-01-06 07:30:54 +01:00
|
|
|
URL: https://www.nagios.org/
|
2024-01-06 07:30:53 +01:00
|
|
|
#Source0: http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-%{version}/nrpe-%{version}.tar.gz
|
|
|
|
Source0: https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-%{version}/nrpe-%{version}.tar.gz
|
2024-01-06 07:30:52 +01:00
|
|
|
Source1: nagios-nrpe.sysconfig
|
|
|
|
Source2: nagios-commands-nrpe.cfg
|
2024-01-06 07:30:52 +01:00
|
|
|
Source3: nrpe.service
|
|
|
|
Source4: nrpe.socket
|
|
|
|
Source5: nrpe.tmpfiles
|
|
|
|
Source6: nrpe@.service
|
2024-01-06 07:30:52 +01:00
|
|
|
Patch0: %{name}-2.13-initscript_add_reload.patch
|
|
|
|
Patch1: %{name}-2.13-initscript_extra_options.patch
|
|
|
|
Patch2: %{name}-2.13-include_nrpe_d_directory.patch
|
|
|
|
Patch3: %{name}-2.13-initscript_return_codes.patch
|
|
|
|
Patch4: %{name}-2.13-relocate_pid_file.patch
|
2024-01-06 07:30:52 +01:00
|
|
|
Patch5: nrpe-2.15-rundir.patch
|
2024-01-06 07:30:52 +01:00
|
|
|
License: GPL
|
|
|
|
## AUTOBUILDREQ-BEGIN
|
|
|
|
BuildRequires: glibc-devel
|
2024-01-06 07:30:53 +01:00
|
|
|
BuildRequires: libnsl-devel
|
2024-01-06 07:30:52 +01:00
|
|
|
BuildRequires: libopenssl-devel
|
2024-01-06 07:30:53 +01:00
|
|
|
BuildRequires: libwrap-devel
|
2024-01-06 07:30:52 +01:00
|
|
|
## AUTOBUILDREQ-END
|
|
|
|
Requires: initscripts
|
|
|
|
Provides: nrpe = %{?epoch:%epoch:}%{version}-%{release}
|
|
|
|
Requires: nagios-plugins
|
2024-01-06 07:30:52 +01:00
|
|
|
%systemd_requires
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
Nrpe runs as a background process on the remote host and processes command execution requests from the check_nrpe plugin on the Nagios host.
|
|
|
|
Upon receiving a plugin request from an authorized host, it will execute the command line associated with the command name it received and send the program output and return code back to the check_nrpe plugin.
|
|
|
|
|
|
|
|
%package -n nagios-plugins-nrpe
|
|
|
|
Summary: Nagios Remote Plugin Executor Plugin
|
|
|
|
Group: Network/Monitoring
|
|
|
|
|
|
|
|
%description -n nagios-plugins-nrpe
|
|
|
|
The check_nrpe plugin is run on the Nagios host and is used to contact the NRPE process on remote hosts.
|
|
|
|
The plugin requests that a plugin be executed on the remote host and wait for the NRPE process to execute the plugin and return the result.
|
|
|
|
The plugin then uses the output and return code from the plugin execution on the remote host for its own output and return code.
|
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
%debug_package
|
|
|
|
|
2024-01-06 07:30:52 +01:00
|
|
|
%prep
|
|
|
|
%setup -q -n nrpe-%{version}
|
2024-01-06 07:30:53 +01:00
|
|
|
#%patch0 -p1
|
|
|
|
#%patch1 -p1
|
|
|
|
#%patch2 -p1
|
|
|
|
#%patch3 -p1
|
|
|
|
#%patch4 -p1
|
|
|
|
#%patch5 -p1
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
|
|
|
|
%configure \
|
2024-01-06 07:30:53 +01:00
|
|
|
--with-init-type=systemd \
|
|
|
|
--with-inetd-type=systemd \
|
|
|
|
--with-dist-type=debian \
|
|
|
|
--with-pkgsysconfdir=%{_sysconfdir}/nagios \
|
|
|
|
--with-objsysconfdir=%{_sysconfdir}/nagios/nrpe.d \
|
2024-01-06 07:30:52 +01:00
|
|
|
--with-nrpe-port=%{nrpeport} \
|
|
|
|
--with-nrpe-user=%{nrpeuser} \
|
|
|
|
--with-nrpe-group=%{nrpegroup} \
|
|
|
|
--bindir=%{_sbindir} \
|
|
|
|
--libexecdir=%{_libdir}/nagios/plugins \
|
|
|
|
--datadir=%{_datadir}/nagios \
|
|
|
|
--sysconfdir=%{_sysconfdir}/nagios \
|
2024-01-06 07:30:53 +01:00
|
|
|
--localstatedir=/run/nagios \
|
2024-01-06 07:30:52 +01:00
|
|
|
--enable-command-args
|
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
%make all
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
install -d -m0755 %{buildroot}%{_unitdir}
|
|
|
|
%makeinstall NAGIOS_INSTALL_OPTS= NRPE_INSTALL_OPTS= \
|
|
|
|
INIT_DIR=%{buildroot}%{_unitdir} INETD_DIR=%{buildroot}%{_unitdir} \
|
|
|
|
install-plugin install-inetd install-init install-config
|
2024-01-06 07:30:52 +01:00
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
install -d %{buildroot}%{_sysconfdir}/nagios/nrpe.d
|
2024-01-06 07:30:52 +01:00
|
|
|
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/nagios/conf.d/commands-nrpe.cfg
|
2024-01-06 07:30:53 +01:00
|
|
|
rm -f %{buildroot}%{_sbindir}/nrpe-uninstall
|
2024-01-06 07:30:52 +01:00
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
:<< _OBSOLETE
|
|
|
|
#install -D -p -m 0755 init-script %{buildroot}/%{_initrddir}/nrpe
|
|
|
|
install -D -p -m 0644 sample-config/nrpe.cfg %{buildroot}/%{_sysconfdir}/nagios/nrpe.cfg
|
|
|
|
install -D -p -m 0755 src/nrpe %{buildroot}%{_sbindir}/nrpe
|
|
|
|
install -D -p -m 0755 src/check_nrpe %{buildroot}%{_libdir}/nagios/plugins/check_nrpe
|
|
|
|
#install -D -p -m 0644 %{S:1} %{buildroot}/%{_sysconfdir}/sysconfig/nrpe
|
2024-01-06 07:30:52 +01:00
|
|
|
install -D -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/nrpe.service
|
|
|
|
install -D -m0644 %{SOURCE4} %{buildroot}%{_unitdir}/nrpe.socket
|
|
|
|
install -D -m0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nrpe.conf
|
|
|
|
install -D -m0644 %{SOURCE6} %{buildroot}%{_unitdir}/nrpe@.service
|
2024-01-06 07:30:53 +01:00
|
|
|
_OBSOLETE
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
install -d %{buildroot}%{_sysconfdir}/sudoers.d
|
|
|
|
cat > %{buildroot}%{_sysconfdir}/sudoers.d/nrpe << _EOF
|
2024-01-06 07:30:53 +01:00
|
|
|
nrpe ALL=(root) NOPASSWD:%{_libdir}/nagios/plugins/check_ide_smart
|
|
|
|
nrpe ALL=(root) NOPASSWD:%{_libdir}/nagios/plugins/check_disk
|
2024-01-06 07:30:52 +01:00
|
|
|
_EOF
|
|
|
|
|
2024-01-06 07:30:52 +01:00
|
|
|
%clean
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
|
|
|
|
%pre
|
2024-01-06 07:30:53 +01:00
|
|
|
if [ $1 -ge 1 ]; then
|
|
|
|
/usr/sbin/groupadd -r %{nrpegroup} -g 65061 &>/dev/null || true
|
|
|
|
/usr/sbin/useradd -u 65061 -c "Nagios NRPE user" -d /run/nrpe \
|
|
|
|
-r -g %{nrpegroup} -s /sbin/nologin %{nrpeuser} 2>/dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
%systemd_pre nrpe
|
|
|
|
:
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
%post
|
2024-01-06 07:30:52 +01:00
|
|
|
if [ $1 -ge 1 ]; then
|
|
|
|
%tmpfiles_create nrpe.conf
|
|
|
|
fi
|
2024-01-06 07:30:53 +01:00
|
|
|
%systemd_post nrpe
|
2024-01-06 07:30:52 +01:00
|
|
|
:
|
2024-01-06 07:30:52 +01:00
|
|
|
|
2024-01-06 07:30:52 +01:00
|
|
|
%preun
|
2024-01-06 07:30:53 +01:00
|
|
|
%systemd_preun nrpe
|
|
|
|
:
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%systemd_postun_with_restart nrpe
|
2024-01-06 07:30:52 +01:00
|
|
|
:
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2024-01-06 07:30:52 +01:00
|
|
|
%{_sysconfdir}/sudoers.d/nrpe
|
2024-01-06 07:30:52 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/nagios/nrpe.cfg
|
2024-01-06 07:30:52 +01:00
|
|
|
%{_sbindir}/nrpe
|
2024-01-06 07:30:53 +01:00
|
|
|
%dir %{_sysconfdir}/nagios/nrpe.d
|
2024-01-06 07:30:52 +01:00
|
|
|
%{_unitdir}/nrpe.service
|
|
|
|
%{_tmpfilesdir}/nrpe.conf
|
|
|
|
%doc LEGAL
|
2024-01-06 07:30:52 +01:00
|
|
|
|
|
|
|
%files -n nagios-plugins-nrpe
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_sysconfdir}/nagios/conf.d/commands-nrpe.cfg
|
|
|
|
%{_libdir}/nagios/plugins/check_nrpe
|
|
|
|
|
|
|
|
%changelog
|
2024-01-06 07:30:54 +01:00
|
|
|
* Wed Jul 20 2022 Automatic Build System <autodist@mambasoft.it> 4.1.0-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
* Mon Jan 18 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.0.3-1mamba
|
|
|
|
- update to 4.0.3
|
|
|
|
|
2024-01-06 07:30:53 +01:00
|
|
|
* Sun Oct 13 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.1-1mamba
|
|
|
|
- update to 3.2.1
|
|
|
|
|
|
|
|
* Sun Oct 13 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 2.15-4mamba
|
|
|
|
- rebuilt with openssl 1.1.1d
|
|
|
|
|
2024-01-06 07:30:52 +01:00
|
|
|
* Sun Dec 27 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.15-3mamba
|
|
|
|
- systemd support
|
|
|
|
|
2024-01-06 07:30:52 +01:00
|
|
|
* Wed May 07 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.15-2mamba
|
|
|
|
- require nagios-plugins
|
|
|
|
- install a default nrpe command configuration for nagios
|
|
|
|
|
|
|
|
* Sun Jan 12 2014 Davide Madrisan <davide.madrisan@gmail.com> 2.15-1mamba
|
|
|
|
- update to 2.15
|
|
|
|
|
|
|
|
* Thu Jan 03 2013 Automatic Build System <autodist@mambasoft.it> 2.14-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
|
|
|
* Tue Oct 23 2012 Davide Madrisan <davide.madrisan@gmail.com> 2.13-1mamba
|
|
|
|
- package created by autospec
|