LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File nagios-plugins-mem.spec of Package nagios-plugins-mem (Project home:eumel_8)

#
# spec file for package nagios-plugins-mem
#
# Copyright (c) 2013 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


Name:           nagios-plugins-mem
Version:        20120618
Release:        0
Summary:        Check memory plugin for Nagios
License:        MIT
Group:          System/Monitoring
Url:            https://github.com/justintime/nagios-plugins
Source0:        check_mem.tar.bz2
Source1:        nagios-plugins-mem-apparmor
Source2:        nagios-plugins-mem-rpmlintrc
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0:         nagios-plugins-mem-add_php_to_pnp4nagios_template.patch
%if 0%{?suse_version} > 1010
# nagios can execute the script with embedded perl
Recommends:     perl
%endif
BuildRequires:  nagios-rpm-macros
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
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 check_mem.pl.

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

%build

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

%clean
rm -rf %{buildroot}

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

%changelog