2011-02-21 12:30:40 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# needsrootforbuild
|
|
|
|
|
|
|
|
Name: check_postgres
|
|
|
|
Summary: Postgres monitoring script
|
2012-07-11 12:51:46 +02:00
|
|
|
Version: 2.19.0
|
2011-02-21 12:30:40 +01:00
|
|
|
Release: 1
|
|
|
|
Url: http://bucardo.org/wiki/Check_postgres
|
2012-07-11 12:51:46 +02:00
|
|
|
License: GPL-2.0+
|
2011-02-21 12:30:40 +01:00
|
|
|
Group: System/Monitoring
|
|
|
|
Source0: %{name}-%{version}.tar.bz2
|
2012-07-12 20:58:43 +02:00
|
|
|
Source1: nagios-commands-postgres.cfg
|
2011-02-21 12:30:40 +01:00
|
|
|
Requires: postgresql
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(DBD::Pg)
|
|
|
|
BuildRequires: perl(DBI)
|
|
|
|
BuildRequires: perl(Data::Dumper)
|
|
|
|
BuildRequires: perl(File::Basename)
|
|
|
|
BuildRequires: perl(File::Temp)
|
|
|
|
BuildRequires: perl(Cwd)
|
|
|
|
BuildRequires: perl(Getopt::Long)
|
|
|
|
BuildRequires: perl(Time::HiRes)
|
|
|
|
BuildRequires: perl(Digest::MD5)
|
|
|
|
BuildRequires: perl(Date::Parse)
|
|
|
|
#BuildRequires: postgresql-server
|
|
|
|
Requires: perl = %{perl_version}
|
|
|
|
Requires: perl(Data::Dumper)
|
|
|
|
Requires: perl(File::Basename)
|
|
|
|
Requires: perl(File::Temp)
|
|
|
|
Requires: perl(Cwd)
|
|
|
|
Requires: perl(Getopt::Long)
|
|
|
|
Requires: perl(Time::HiRes)
|
|
|
|
Recommends: perl(Digest::MD5)
|
|
|
|
Recommends: perl(Date::Parse)
|
|
|
|
Recommends: coreutils
|
|
|
|
Recommends: util-linux
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%define libexecdir %_prefix/lib/nagios/plugins
|
|
|
|
|
|
|
|
%description
|
|
|
|
check_postgres.pl is a Perl script that runs many different tests against one
|
|
|
|
or more Postgres databases. It uses the psql program to gather the information,
|
|
|
|
and outputs the results in one of three formats: Nagios, MRTG, or simple.
|
|
|
|
|
|
|
|
Author:
|
|
|
|
-------
|
|
|
|
Greg Sabino Mullane <greg@endpoint.com>
|
|
|
|
|
2011-02-21 12:40:21 +01:00
|
|
|
|
|
|
|
%package -n nagios-plugins-postgres
|
|
|
|
Summary: Postgres monitoring script using check_postgres.pl
|
|
|
|
Group: System/Monitoring
|
|
|
|
PreReq: %{name} = %{version}
|
|
|
|
|
|
|
|
%description -n nagios-plugins-postgres
|
|
|
|
This package contains the symlinks to execute special checks via the standard
|
|
|
|
Nagios plugins way.
|
|
|
|
|
2011-02-21 12:30:40 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2012-07-12 20:58:43 +02:00
|
|
|
%{__install} -m 0644 %SOURCE1 nagios-commands-postgres.cfg
|
2011-02-21 12:30:40 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
perl Makefile.PL
|
|
|
|
make %{?jobs:-j%jobs}
|
|
|
|
|
|
|
|
%install
|
|
|
|
# install the module
|
|
|
|
%perl_make_install
|
|
|
|
# do not perl_process_packlist (noarch)
|
|
|
|
# remove .packlist file
|
|
|
|
%{__rm} -rf %{buildroot}%perl_vendorarch
|
|
|
|
# remove perllocal.pod file
|
|
|
|
%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
|
|
|
|
%perl_gen_filelist
|
2011-02-21 12:40:21 +01:00
|
|
|
# create symlinks for nagios-plugins-postgres package
|
|
|
|
mkdir -p %{buildroot}%{libexecdir}
|
|
|
|
pushd %{buildroot}%{libexecdir}
|
|
|
|
%{buildroot}%{_bindir}/check_postgres.pl --symlinks
|
|
|
|
# fix symlinks, as they point to the buildroot
|
|
|
|
for link in *; do
|
|
|
|
rm $link
|
|
|
|
ln -s %{_bindir}/check_postgres.pl $link
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
2011-02-21 12:30:40 +01:00
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf %buildroot
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root)
|
2012-07-12 20:58:43 +02:00
|
|
|
%doc MANIFEST README TODO nagios-commands-postgres.cfg
|
2011-02-21 12:40:21 +01:00
|
|
|
|
|
|
|
%files -n nagios-plugins-postgres
|
|
|
|
%defattr(-,root,root)
|
2011-02-21 12:30:40 +01:00
|
|
|
# avoid build dependecy of nagios - own the dirs
|
2011-02-21 12:40:21 +01:00
|
|
|
%dir %_prefix/lib/nagios
|
|
|
|
%dir %libexecdir
|
|
|
|
%libexecdir/*
|
|
|
|
|
2011-02-21 12:30:40 +01:00
|
|
|
%changelog
|