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

# spec file for package monitoring-plugins-cpu_stats
# Copyright (c) 2020 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

Name:           monitoring-plugins-cpu_stats
Version:        0.0.1.g62f56aa
Release:        0
Summary:        CPU Utilization Statistics 
License:        GPL-3.0-or-later
Group:          System/Monitoring
Source:         check_cpu_stats-%{version}.tar.xz
Source1:        monitoring-plugins-cpu_stats-rpmlintrc
BuildRequires:  nagios-rpm-macros
Requires:       sysstat
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Monitoring plugin to check CPU utilization statistics. This script has
been designed and written on Unix platforms (Linux, Aix, Solaris).

The script is used to query 6 of the key cpu statistics: 

* user
* system
* iowait
* idle
* nice and 
* steal (if possible) 

You can also set warning and critical values (in percent) for 

* user
* system and
* iowat

Usage examples: 

* ./
* ./ -w 70,40,30 -c 90,60,40
* ./ -w 70,40,30 -c 90,60,40 -i 3 -n 5

%autosetup -n check_cpu_stats-%{version}

install -D -m755 %buildroot/%{nagios_plugindir}/check_cpu_stats
mkdir -p %{buildroot}%{nrpe_sysconfdir}
cat > %{buildroot}%{nrpe_sysconfdir}/check_cpu_stats.cfg << EOL
#command[check_cpu_stats]=%{nagios_plugindir}/check_cpu_stats -w 70,40,30 -c 90,60,40
#command[check_cpu_stats]=%{nagios_plugindir}/check_cpu_stats -w 70,40,30 -c 90,60,40 -i 3 -n 5

%license LICENSE
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{nrpe_sysconfdir}
%config(noreplace) %{nrpe_sysconfdir}/check_cpu_stats.cfg

openSUSE Build Service is sponsored by