2023-03-05 10:40:28 +01:00
|
|
|
%define zabbix_agent_dir %{_sysconfdir}/zabbix/zabbix_agent2.d
|
|
|
|
|
|
|
|
|
|
Name: zabbix-raidstat
|
|
|
|
|
Version: 1.0
|
|
|
|
|
Release: 1%{?dist}
|
|
|
|
|
Summary: Zabbix module for raid statistics for hp, mavell, adaptec or megacli raid tools
|
|
|
|
|
%define debug_package %{nil}
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/ps78674/zabbix-raidstat
|
|
|
|
|
Source0: %{name}.tgz
|
|
|
|
|
BuildRequires: golang >= 1.8
|
|
|
|
|
%if 0%{?rhel} >= 8
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: go-bindata
|
|
|
|
|
%endif
|
|
|
|
|
Requires: zabbix-agent2
|
|
|
|
|
|
|
|
|
|
# Temporary solution while waiting for golang and go-bindata to be built in cbs.centos.org
|
|
|
|
|
#ExclusiveArch: i686 x86_64
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Simple parser for arcconf, ssacli, mvcli and megacli written in Go. To use it, you must
|
|
|
|
|
install following:
|
|
|
|
|
|
|
|
|
|
- Copy raidstat/zabbix/raidstat.sudoers to /etc/sudoers.d/raidstat
|
|
|
|
|
- Copy zabbix/userparameter_raidstat.conf to /etc/zabbix/zabbix_agentd.d
|
|
|
|
|
- Copy compiled binaries to /opt/raidstat
|
|
|
|
|
- Import templatezabbix/zbx_raid_monitoring.xml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
make
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p ${RPM_BUILD_ROOT}/opt/raidstat
|
|
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{zabbix_agent_dir}
|
|
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d
|
|
|
|
|
install -m 0644 zabbix/userparameter_raidstat.conf ${RPM_BUILD_ROOT}/%{zabbix_agent_dir}/userparameter_raidstat.conf
|
|
|
|
|
install -m 0644 zabbix/raidstat.sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/raidstat
|
|
|
|
|
for p in raidstat adaptec.so config.json hp.so marvell.so megacli.so adaptec.so; do
|
|
|
|
|
install build/${p} ${RPM_BUILD_ROOT}/opt/raidstat/${p}
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
|
/usr/bin/systemctl restart zabbix-agent2.service >/dev/null 2>&1 || :
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
|
/usr/bin/systemctl restart zabbix-agent2.service >/dev/null 2>&1 || :
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(0644,root,root,-)
|
|
|
|
|
%doc README.md
|
|
|
|
|
%config %{zabbix_agent_dir}/userparameter_raidstat.conf
|
2023-03-05 10:46:47 +01:00
|
|
|
%config %{_sysconfdir}/sudoers.d/raidstat
|
2023-03-05 10:40:28 +01:00
|
|
|
%attr(755,root,root) /opt/raidstat/raidstat
|
|
|
|
|
/opt/raidstat/*.so
|
|
|
|
|
/opt/raidstat/*json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
|
|
|
|
|
[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Sun Mar 5 2023 Daniel Steiner <daniel.steiner@dsteiner.ch>
|
|
|
|
|
- First build on Fedora 37.
|
|
|
|
|
|