1 %define plugin check_megaraid_sas
2 Summary: Nagios plugin to check the state of disk and logical drives attached to LSI megaraid SAS controllers
3 Name: nagios-plugin-%{plugin}
4 # revision from download page
9 # http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=680&cf_id=24
10 Source0: check_megaraid_sas
12 Patch1: check_megaraid_sas-size.patch
13 Patch2: check_megaraid_sas-JBOD.patch
14 URL: http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_megaraid_sas/details
17 Requires: nagios-plugins-libs
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define plugindir %{_prefix}/lib/nagios/plugins
22 %define _sysconfdir /etc/nagios/plugins
25 A plugin to check the health and status of disk and logical drives
26 attached to LSI megaraid SAS controllers. This plugin calls LSI's
27 MegaCli utility to determine the health of disks and logical drive
28 units attached to Megraid SAS controllers. It has been tested by the
29 author on Dell PERC 5 & 6 controllers, but should work well with any
30 controller supported by the MegaCli tool.
35 install %{SOURCE0} %{plugin}
36 %{__sed} -i -e 's#/usr/sbin/MegaCli#/sbin/MegaCli#g' %{plugin}
42 cat > nagios.cfg <<'EOF'
46 command_name %{plugin}
47 command_line %{plugindir}/%{plugin}
53 service_description megaraid_sas
56 normal_check_interval 15
57 notification_interval 300
59 check_command check_megaraid_sas
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{plugindir}}
67 install %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin}
68 cp -a nagios.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
71 rm -rf $RPM_BUILD_ROOT
74 %defattr(644,root,root,755)
75 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
76 %attr(755,root,root) %{plugindir}/%{plugin}