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

# spec file for package monitoring-plugins-mem
# 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

Name:           monitoring-plugins-mem
Version:        20120618
Release:        0
Summary:        Check memory plugin for Nagios
License:        MIT
Group:          System/Monitoring
Source0:        check_mem.tar.bz2
Source1:        monitoring-plugins-mem-apparmor
Source2:        monitoring-plugins-mem-rpmlintrc
Source3:        nrpe-check_mem
Patch0:         monitoring-plugins-mem-add_php_to_pnp4nagios_template.patch
Patch1:         monitoring-plugins-mem-min_max_perfdata.patch
%if 0%{?suse_version} > 1010
# nagios can execute the script with embedded perl
Recommends:     perl
Provides:       nagios-plugins-mem = %{version}-%{release}
Obsoletes:      nagios-plugins-mem < %{version}-%{release}
BuildRequires:  nagios-rpm-macros
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

We have always monitored RAM usage on all of boxes. Sure, there's the argument
that unused RAM is money wasted, but I always like to know not just when the
box is swapping, but when it's about to start swapping. There have been a few
plugins over the years that I've used for this - check_ram for Solaris,
check_mem for Linux, and there's also

%setup -q -n check_mem
%patch0 -p1
%patch1 -p1


install -D -m755 %{buildroot}/%{nagios_plugindir}/check_mem
ln -s %{nagios_plugindir}/check_mem %{buildroot}/%{nagios_plugindir}/
install -D -m644 check_mem.php %{buildroot}/%{pnp4nagios_templatedir}/check_mem.php
install -D -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/apparmor.d/
sed -e "s|/usr/lib/nagios/plugins/|/usr/lib/nagios/plugins/check_mem|g" \
	%{SOURCE1} > %{buildroot}%{_sysconfdir}/apparmor.d/usr.lib.nagios.plugins.check_mem
install -Dm644 %{SOURCE3} %{buildroot}%{nrpe_sysconfdir}/check_mem.cfg

rm -rf %{buildroot}

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

openSUSE Build Service is sponsored by