File monitoring-plugins-megaraid_sas.spec of Package monitoring-plugins-megaraid_sas
#
# spec file for package monitoring-plugins-megaraid_sas
#
# 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-megaraid_sas
Version: 12
Release: 100
License: GPL-2.0+
Summary: Check drives attached to LSI megaraid SAS controllers
Url: http://www.monitoringexchange.org/inventory/Check-Plugins/Hardware/Devices/RAID-Controller/check_megaraid_sas
Group: System/Monitoring
Source0: http://www.monitoringexchange.org/attachment/download/Check-Plugins/Hardware/Devices/RAID-Controller/check_megaraid_sas/check_megaraid_sas
Source1: monitoring-plugins-megaraid_sas-rpmlintrc
Source2: usr.lib.nagios.plugins.check_megaraid_sas
BuildRequires: nagios-rpm-macros
Provides: nagios-plugins-megaraid_sas = %{version}-%{release}
Obsoletes: nagios-plugins-megaraid_sas < %{version}-%{release}
Requires: MegaCli
Requires: monitoring-plugins-common
Recommends: apparmor-profiles
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This plugin calls LSI's MegaCli utility to determine the health of disks and
logical drive units attached to Megraid SAS controllers. It has been tested by
the author on Dell PERC 5 & 6 controllers, but should work well with any
controller supported by the MegaCli tool.
%prep
%build
%install
install -Dm755 %{SOURCE0} %{buildroot}/%{nagios_plugindir}/check_megaraid_sas
%ifarch x86_64
sed -i "s|/usr/sbin/MegaCli|/opt/MegaRAID/MegaCli/MegaCli64|g" %{buildroot}/%{nagios_plugindir}/check_megaraid_sas
%else
sed -i "s|/usr/sbin/MegaCli|/opt/MegaRAID/MegaCli/MegaCli|g" %{buildroot}/%{nagios_plugindir}/check_megaraid_sas
%endif
install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/apparmor.d/usr.lib.nagios.plugins.check_megaraid_sas
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root)
%dir %{nagios_libdir}
%dir %{_sysconfdir}/apparmor.d
%{nagios_plugindir}/
%config(noreplace) %{_sysconfdir}/apparmor.d/*
%changelog