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

#
# spec file for package monitoring-plugins-mirrorbrain_mirror
#
# Copyright (c) 2019 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-mirrorbrain_mirror
Version:        0.1
Release:        0
Summary:        Check if a mirror server is enabled in MirrorBrain
License:        BSD-3-Clause
Group:          System/Monitoring
Url:            https://github.com/openSUSE/mirrorbrain
Source0:        check_mirror.sh
Source1:        check_mirror-sudo
Source2:        check_mirror.cfg
BuildRequires:  nagios-rpm-macros
BuildRequires:  sudo
Requires:       coreutils
Requires:       gawk
Requires:       grep
Requires:       monitoring-plugins-common
Requires:       python-mb
Requires:       sudo
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This check uses the mb tool to check if a mirror is enabled/disabled 
by admin and/or by the mirrorprobe script. 
The assumption is that a given (monitored) mirror should always be 
enabled - so this script will exit with warn/crit messages if this 
is not the case.

The usage of this script is very simple: just get the list of available 
mirrors from mirrorbrain (via 'mb list') and call the script via:
 ./check_mirror.sh <your_mirror_name>

%prep

%build

%install
install -D -m0755 %{SOURCE0} %buildroot/%{nagios_plugindir}/check_mirror.sh
install -D -m0400 %{SOURCE1} %buildroot/%{_sysconfdir}/sudoers.d/check_mirror
install -D -m0644 %{SOURCE2} %buildroot/%{nrpe_sysconfdir}/check_mirror.cfg

%clean
rm -rf %buildroot

%files
%defattr(-,root,root)
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{nrpe_sysconfdir}
%{nagios_plugindir}/check_mirror.sh
%config(noreplace) %{_sysconfdir}/sudoers.d/check_mirror
%config(noreplace) %{nrpe_sysconfdir}/check_mirror.cfg

%changelog
openSUSE Build Service is sponsored by