%define plugin check_raid
Summary: Nagios plugin to check current server's RAID status
Name: nagios-plugin-%{plugin}
-Version: 2.0
-Release: 0.1
+Version: 2.1
+Release: 0.5
License: Unknown
Group: Networking
Source0: %{plugin}
# Source0-md5: 168cc7a68638ed2e07df81c4bd43603a
-URL: http://www.monitoringexchange.org/cgi-bin/page.cgi?g=Detailed/1692.html;d=1
+URL: http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_raid/details
Source1: %{plugin}.cfg
Requires: nagios-core
+Requires: sudo
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define plugindir %{_prefix}/lib/nagios/plugins
%description
-This plugin reports the current server's RAID status.
+This plugin chekcs Check all RAID volumes (hardware and software) that
+can be identified.
Supports:
-- IPS; Solaris, AIX, Linux software RAID; megaide
-- megaraid, mpt (serveraid), aacli (serveraid)
+- Linux, Solaris and AIX software RAID
+- Linux MegaIDE/IPS/Serveraid/MPT/LSI hardware RAID controllers.
%prep
%setup -qcT
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+if [ "$1" = 1 ]; then
+ # setup sudo rules on first install
+ %{plugindir}/%{plugin} -S || :
+fi
+
+%postun
+if [ "$1" = 0 ]; then
+ # remove all sudo rules related to us
+ %{__sed} -i -e '/CHECK_RAID/d' /etc/sudoers
+fi
+
%files
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg