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

#
# spec file for package monitoring-plugins-freenas
#
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
#
# 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/
#


%define         realname check_freenas
Name:           monitoring-plugins-freenas
Version:        0.3.0
Release:        0
Summary:        Checks various parameters from FreeNAS systems
License:        GPL-3.0-or-later
Group:          System/Monitoring
URL:            https://gitlab.com/6uellerBpanda/check_freenas
Source0:        https://gitlab.com/6uellerBpanda/check_freenas/-/archive/v%{version}/%{realname}-v%{version}.tar.bz2
BuildRequires:  ruby-macros >= 5
BuildRequires:  nagios-rpm-macros
Requires:       %{rubygem net-ssh}
BuildArch:      noarch
%if 0%{?suse_version} && 0%{?suse_version} < 1330
%define rb_build_versions ruby25
%define rb_build_abi      ruby:2.5.0
%define rb_suffix         ruby2.5
%else
%define rb_build_versions %{rb_default_ruby}
%define rb_build_abi      %{rb_default_ruby_abi}
%define rb_suffix         %{rb_default_ruby_suffix}
%endif

%description
This plugin checks various parameters from FreeNAS systems:
  * Alerts - Check outstanding alerts
  * Updates - Notifies of available updates
  * Datasets - Check used space in MB of all datasets with perfdata
  * zpool_usage
  * dataset_quota
  * ARC Cache usage/status
  * io_requests_pending
  * disk_busy
  * zpool io stats

%prep
%setup -q -n %{realname}-v%{version}

%build
sed -i 's|#!%{_bindir}/env ruby|#!%{_bindir}/ruby.%{rb_suffix}|g' check_freenas.rb

%install
install -D -m 0755 check_freenas.rb %{buildroot}/%{nagios_plugindir}/check_freenas

%files
%license LICENSE
%doc CHANGELOG.md README.md
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_freenas

%changelog
openSUSE Build Service is sponsored by