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

%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
Source0:        %{pluginname}-%{version}.tar.bz2
Requires:       awk
Requires:       bash
Requires:       bc
Requires:       grep
Requires:       procps
BuildRequires:  nagios-rpm-macros
BuildArch:      noarch

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.

%setup -n %{pluginname}


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

# avoid build dependency of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%if 0%{?sle_version} == 120100
%license LICENSE