File monitoring-plugins-amavis.spec of Package monitoring-plugins-amavis
#
# spec file for package monitoring-plugins-amavis
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: monitoring-plugins-amavis
Summary: Check amavisd-new daemon
License: GPL-2.0-or-later
Group: System/Monitoring
Version: 1.1
Release: 0
Url: https://github.com/glensc/monitoring-plugin-check_amavis
Source0: monitoring-plugin-check_amavis-%{version}.tar.gz
Source1: nrpe-check_amavis.cfg
Source2: COPYING
Patch1: check_amavis_add_timeout.patch
Patch2: check_amavis_strict_mode_fix.patch
Patch3: check_amavis_smtp_return_code.patch
Requires: perl(Getopt::Long)
Requires: perl(MIME::Entity)
Requires: perl(Net::SMTP)
%if 0%{?suse_version} > 1010
# nagios can execute the script with embedded perl
Recommends: perl
%endif
BuildArch: noarch
BuildRequires: nagios-rpm-macros
Provides: nagios-plugins-amavis = %{version}-%{release}
Obsoletes: nagios-plugins-amavis < %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
check_amavis checks if amavisd-new daemon is working and if its antivirus
engine is working. This check talks with amavisd-new daemon. It tests if the
daemon is up and if it's able to scan an email with a virus (EICAR test virus
is sent).
Please note that if amavisd-new is run on a different machine, you should
enable the connection from Nagios IP address (take a look at amavisd.conf).
%prep
%setup -q -n monitoring-plugin-check_amavis-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
install -m644 %{SOURCE2} .
%build
%install
install -D -m755 check_amavis.pl %{buildroot}%{nagios_plugindir}/check_amavis
install -D -m640 check_amavis.cfg %{buildroot}%{_sysconfdir}/check_amavis.cfg
install -D -m644 %{SOURCE1} %{buildroot}%{nrpe_sysconfdir}/check_amavis.cfg
%clean
rm -rf %buildroot
%files
%defattr(-,root,root)
%if 0%{?suse_version} >= 1500
%license COPYING
%else
%doc COPYING
%endif
# avoid build dependecy of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{nrpe_sysconfdir}
%{nagios_plugindir}/check_amavis
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/check_amavis.cfg
%config(noreplace) %{nrpe_sysconfdir}/check_amavis.cfg
%changelog