File monitoring-plugins-sar-perf.spec of Package monitoring-plugins-sar-perf

# spec file for package monitoring-plugins-sar-perf
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 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-sar-perf
Summary:        Get performance data from sar 
Version:        0.1
Release:        100
License:        BSD-2-Clause
Group:          System/Monitoring
Source0:        nickanderson-check-sar-perf-4878d0c.tar.gz 
Source1:        check_iostat
Source2:        usr.lib.nagios.plugins.check_iostat
Patch0:         monitoring-plugins-sar-perf-output.patch
Patch1:         monitoring-plugins-sar-perf-stdout.patch
BuildRequires:  nagios-rpm-macros
%if 0%{?suse_version}
Recommends:     apparmor-profiles
Provides:       nagios-plugins-sar-perf = %{version}-%{release}
Obsoletes:      nagios-plugins-sar-perf < %{version}-%{release}
Requires:       python sysstat
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This plug-in was written to get performance data from sar. It was developed for
use with Zenoss but should work with other NRPE compatible NMS.

Example output:

check_sar_perf cpu
sar OK| CPU=all user=59.90 nice=0.00 system=4.46 iowait=0.00 steal=0.00

check_sar_perf disk sda
sar OK| DEV=sda tps=0.00 rd_sec/s=0.00 wr_sec/s=0.00 avgrq-sz=0.00
  avgqu-sz=0.00 await=0.00 svctm=0.00 util=0.00

%setup -q -n nickanderson-check-sar-perf-4878d0c
%patch0 -p0
%patch1 -p0


install -D -m755 %{buildroot}/%{nagios_plugindir}/check_sar_perf
install -m755 %{SOURCE1} %{buildroot}/%{nagios_plugindir}/check_iostat
install -Dm0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/apparmor.d/usr.lib.nagios.plugins.check_iostat

rm -rf %{buildroot}

# avoid build dependecy of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{_sysconfdir}/apparmor.d
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.nagios.plugins.check_iostat