File nagios-xen.spec of Package nagios-xen

#
# spec file for package nagios-xen
#
# 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-xen
Version:        1.0
Release:        0
Summary:        A Xen Virtual Machine Monitor Plugin for Nagios
License:        GPL-2.0+
Group:          System/Monitoring
Source0:        nagios-xen-%{version}.tar.bz2
BuildRequires:  nagios
BuildRequires:  nagios-rpm-macros
# should be noarch, but in this case the x86_46 ifarch macro does not work
# BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This plugin helps to monitor XEN machines.

Provides an example service configuration for Nagios servers.

%ifarch x86_64
%package  host
Summary:        A Xen Virtual Machine Monitor Plugin for Nagios
Group:          System/Monitoring
Requires:       xen-tools
Provides:       nagios-plugins-xemvm = 1.4.17
Obsoletes:      nagios-plugins-xemvm < 1.4.17

%description host
This plugin helps to monitor XEN machines.

Checks the number of Xen VMs running on a machine and returns a warning
or a critical message if the number exceeds the thresholds specified.
%endif

%prep
%setup -q

%build

%install
install -d %{buildroot}/%{nagios_sysconfdir}
cp xen_vm_service.cfg %{buildroot}/%{nagios_sysconfdir}/xen_vm_service.cfg.example
%ifarch x86_64
install -d %{buildroot}/%{nagios_plugindir}
cp xen_vm_checkcommands.cfg %{buildroot}/%{nagios_sysconfdir}/xen_vm_checkcommands.cfg
cp check_xenvm %{buildroot}/%{nagios_plugindir}/check_xenvm
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%config %{nagios_sysconfdir}/xen_vm_service.cfg.example

%ifarch x86_64
%files host
%defattr(0755,root,root)
%{nagios_plugindir}/check_xenvm
%defattr(-,root,root)
%config(noreplace) %{nagios_sysconfdir}/xen_vm_checkcommands.cfg
%endif

%changelog