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

#  
# spec file for package monitoring-plugins-md_raid
#  
# Copyright (c) 2012 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-md_raid
Summary:        Checks Linux Software Raid. Works on both 32-bit and 64-bit systems
Version:        0.7.2 
Release:        100
License:        GPL-2.0+
Group:          System/Monitoring   
Url:            https://www.monitoringexchange.org/inventory/Check-Plugins/Operating-Systems/Linux/check_md_raid 
Source0:        check_md_raid
Patch0:         check_md_raid-active.patch
Patch1:         check_md_raid-clean.patch
Source1:        monitoring-plugins-md_raid-README.SUSE
BuildRequires:  monitoring-plugins-common
BuildRequires:  nagios-rpm-macros
Provides:       nagios-plugins-md_raid = %{version}-%{release}
Obsoletes:      nagios-plugins-md_raid < %{version}-%{release}
Requires:       monitoring-plugins-common
Requires:       mdadm
BuildArch:      noarch  
BuildRoot:      %{_tmppath}/%{name}-build  
  
%description  
Checks Linux Software Raid (also known as MD Raid). Works on both 32-bit and 64-bit systems

Checks Linux Software Raid (also known as MD Raid). Works on both 32-bit and 64-bit systems
Usage Run the plugin is as follows:
./check_md_raid
RAID OK: All arrays OK [1 array checked]

It requires the mdadm utility which is what you also used to create the raid
array. If it is not in the standard location of /sbin/mdadm then just do the
following
ln -s /path/to/mdadm /sbin/mdadm

and then run the plugin again.

This runs straight on both 32-bit and 64-bit systems and all modern linux
distros that have Python.  This has been tested and all works nicely for me on
servers of both architectures and across distros.  The plugin must be run as
root in order to test the state of all the arrays. Use sudo to grant the nagios
or nrpe user the rights to run it using sudo without a password like so:
visudo
add the following line:
nagios (ALL)=ALL NOPASSWD:/path/to/check_md_raid

Rewritten to work with python 2.3 as well (no longer uses subprocess for those
of you on debian...)

Support

If you have any issues, contact me at 
hpsekhon(AT)googlemail.com  

%prep  
%setup -q -T -c %name
install -m644 %{SOURCE0} .
%patch0 -p0
%patch1 -p0
 
%build  
#  
   
%install  
install -Dm755 check_md_raid %buildroot/%{nagios_plugindir}/check_md_raid
install -Dm644 %{SOURCE1} %buildroot/%{_defaultdocdir}/%{name}/README.SUSE  
   
%clean  
rm -rf %buildroot  
   
%files  
%defattr(-, root, root)  
%doc %{_defaultdocdir}/%{name}  
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_md_raid
   
%changelog  
openSUSE Build Service is sponsored by