File monitoring-plugins-multipath.spec of Package monitoring-plugins-multipath

#
# spec file for package monitoring-plugins-multipath
#
# Copyright (c) 2012-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-multipath
Version:        1.12
Release:        100
Summary:        Checks multipath connections to SAN storage
License:        GPL-3.0+
Group:          System/Monitoring
Url:            https://exchange.icinga.com/exchange/check_multipath/releases
Source0:        check_multipath
Source1:        nrpe_check_multipath
Source2:        sudo_check_multipath
Patch1:         check_multipath.patch
BuildRequires:  nagios-rpm-macros
Provides:       nagios-plugins-multipath = %{version}-%{release}
Obsoletes:      nagios-plugins-multipath < %{version}-%{release}
Requires:       multipath-tools
Requires:       sudo
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Checks multipath connections to SAN storage on your GNU/Linux box, also has
working support for specifying required redundancy level

It is updated and fixed version of:
* http://www.monitoringexchange.org/inventory/Check-Plugins/Operating-Systems/Linux/check_multipath
* http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES.old/nagios-plugin-check_multipath.sh
* http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_multipath/details

%prep
%setup -q -T -c %{name}
install -m755 %{SOURCE0} .
%patch1

%build

%install
mkdir -p %{buildroot}/%{nagios_plugindir}
install -m 755 check_multipath %{buildroot}/%{nagios_plugindir}/check_multipath
cd %{buildroot}/%{nagios_plugindir}/
cd -
install -Dm644 %{SOURCE1} %{buildroot}/%{nrpe_sysconfdir}/check_multipath.cfg 
%if 0%{?suse_version} > 1310
install -Dm400 %{SOURCE2} %{buildroot}/%{_sysconfdir}/sudoers.d/check_multipath
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
# avoid build dependecy of nagios - own the dirs
%dir %{nrpe_sysconfdir}
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_multipath
%config(noreplace) %{nrpe_sysconfdir}/check_multipath.cfg
%if 0%{?suse_version} > 1310
%dir %{_sysconfdir}/sudoers.d
%config(noreplace) %{_sysconfdir}/sudoers.d/check_multipath
%endif

%changelog
openSUSE Build Service is sponsored by