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

#
# spec file for package monitoring-plugins-delayed_queue
#
# Copyright (c) 2017 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-delayed_queue
Summary:        Check OBS delayed API queue
License:        BSD-3-Clause
Group:          System/Monitoring
Version:        1.0
Release:        0
Url:            http://www.open-build-service.org/
Source0:        check_delayed_queue
Source1:        20_nagios_nopasswd_delayed_queue
Requires:       sudo
%if 0%{?suse_version} > 1010
# nagios can execute the script with embedded perl
Recommends:     perl 
%endif
BuildArch:      noarch
BuildRequires:  nagios-rpm-macros
BuildRequires:  sudo
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Open Build Service API server has a queue with delayed jobs that is used 
to not stress the backend machines too much. 

With this check running on the API machine, you can monitor the queue length
to be informed if it get's too large.

%prep
#
%build
#
%install
install -D -m755 %{SOURCE0} %buildroot/%{nagios_plugindir}/check_delayed_queue
sed -i "s|__RUBY_PATH__|/usr/bin/bundle.ruby2.5 exec rails|g" %buildroot/%{nagios_plugindir}/check_delayed_queue
install -D -m640 %{SOURCE1} %buildroot/%{_sysconfdir}/sudoers.d/20_nagios_nopasswd_delayed_queue
sed -i "s|__RUBY_PATH__|/usr/bin/bundle.ruby2.5|g" %buildroot/%{_sysconfdir}/sudoers.d/20_nagios_nopasswd_delayed_queue

%files 
%defattr(-,root,root)
# avoid build dependecy of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_delayed_queue
%dir %{_sysconfdir}/sudoers.d
%config(noreplace) %{_sysconfdir}/sudoers.d/20_nagios_nopasswd_delayed_queue

%changelog
openSUSE Build Service is sponsored by