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

#
# spec file for package monitoring-plugins-redis
#
# Copyright (c) 2022 SUSE LINUX 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-redis
Version:        20140117g4011ea1
Release:        0
Summary:        Redis monitoring plugin
License:        GPL-2.0-or-later
Group:          System/Monitoring
Url:            https://github.com/willixix/WL-NagiosPlugins
Source:         %{name}-%{version}.tar.xz
Source1:        gpl.txt
BuildRequires:  nagios-rpm-macros
BuildArch:      noarch
BuildRequires:  perl(Redis)
Requires:       perl(Redis)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This is Redis Server Check plugin. It gets stats variables and allows to set
thresholds on their value or their rate of change. It can measure response time,
hitrate, memory utilization, check replication sync and more. It can also test
data in a specified key (if necessary doing average or sum on range).

%prep
%setup -q
install -m0644 %{SOURCE1} COPYING

%build

%install
install -D -m755 check_redis.pl    %buildroot/%{nagios_plugindir}/check_redis

%check
retVal=$(perl %buildroot/%{nagios_plugindir}/check_redis -h >/dev/null || echo $?)
if [ "$retVal" != "3" ]; then
    echo "Test failed: check_redis can not print help text" >&2
    exit 1
fi

%files
%defattr(-,root,root)
%doc README 
%license COPYING
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_redis

%changelog
openSUSE Build Service is sponsored by