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

#
# spec file for package monitoring-plugins-printer
#
# Copyright (c) 2014 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:           monitoring-plugins-printer
Version:        0.15
Release:        100
License:        GPL-2.0+
%define         realname check_printer
Summary:        Generic check for printers supporting SNMP Printer MIB
Url:            http://www.nagiosexchange.org/cgi-bin/page.cgi?g=1955.html;d=1
Group:          System/Monitoring
Source:         %realname.tar.bz2
# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
Patch1:         monitoring-plugins-printer-config.patch
# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
Patch2:         monitoring-plugins-printer-destdir.patch
# for the directory ownership:
BuildRequires:  monitoring-plugins-common
BuildRequires:  nagios-rpm-macros
%if 0%{?suse_version} >= 1500
BuildRequires:  libnsl-devel
%endif
Provides:       nagios-plugins-printer = %{version}
Obsoletes:      nagios-plugins-printer < %{version}
Requires:       monitoring-plugins-common
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This monitorinh plugin queries prtAlertTable from the Printer MIB.

It honors only prtAlertTrainingLevel = trained(4) or
fieldService(5),prtAlertTrainingLevel = other(1),unknown(2),untrained(3) and
management(6) are ignored.

For prtAlertSeverityLevel = warning(4) the plugin result is "WARNING", for
critical(3) the plugin result is "CRITICAL", obviously, for
warningBinaryChangeEvent(5) (new in RFC3805) the state is by default "WARNING",
but there is a hardcoded table of change events, which result in state
"CRITICAL".

%prep
%setup -q -n %realname
%patch1 -p0
%patch2 -p0

%build
make %{?_smp_mflags}

%install
mkdir -p %{buildroot}%{nagios_plugindir}
%makeinstall DESTDIR=%{buildroot}
strip %{buildroot}%{nagios_plugindir}/*

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{nagios_plugindir}/*

%changelog
openSUSE Build Service is sponsored by