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

#
# spec file for package monitoring-plugins-cpu_proc
#
# 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 https://bugs.opensuse.org/
#


%define pluginname check_cpu_proc
Name:           monitoring-plugins-cpu_proc
Version:        1.0
Release:        0
Summary:        Check CPU or memory usage of a named process
License:        GPL-3.0-or-later
Group:          System/Monitoring
Url:            https://github.com/thomasweaver/check_cpu_proc
Source0:        %{pluginname}-%{version}.tar.bz2
Requires:       awk
Requires:       bash
Requires:       bc
Requires:       grep
Requires:       procps
BuildRequires:  nagios-rpm-macros
BuildArch:      noarch

%description
This plugin takes in a process name and then uses the command ps to work out how much
memory and cpu all the processes of that name are taking up in percentage. It will
output performance data for CPU Usage Percentage, Memory Usage Percentage, VSZ, RSS
and the number of processes of that name.

%prep
%setup -n %{pluginname}

%build

%install
install -D -m755 %{pluginname}.sh %{buildroot}%{nagios_plugindir}/%{pluginname}

%files
%defattr(-,root,root)
# avoid build dependency of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/%{pluginname}
%if 0%{?sle_version} == 120100
%doc LICENSE
%else
%license LICENSE
%endif
%doc README.md

%changelog
openSUSE Build Service is sponsored by