2011-02-21 12:30:40 +01:00
|
|
|
#
|
2014-07-31 00:38:06 +02:00
|
|
|
# spec file for package check_postgres
|
|
|
|
#
|
2022-03-08 18:16:45 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2014-07-31 00:38:06 +02:00
|
|
|
#
|
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.
|
|
|
|
|
2019-04-03 21:26:06 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-07-31 00:38:06 +02:00
|
|
|
#
|
|
|
|
|
2011-02-21 12:30:40 +01:00
|
|
|
|
2018-03-21 13:32:29 +01:00
|
|
|
Name: check_postgres
|
2020-02-05 18:21:14 +01:00
|
|
|
Version: 2.25.0
|
2018-03-21 13:32:29 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Postgres monitoring script
|
2019-04-03 21:26:06 +02:00
|
|
|
License: GPL-2.0-or-later
|
2018-03-21 13:32:29 +01:00
|
|
|
Group: System/Monitoring
|
2019-04-03 21:26:06 +02:00
|
|
|
URL: http://bucardo.org/wiki/Check_postgres
|
|
|
|
Source: https://github.com/bucardo/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
2018-03-21 13:32:29 +01:00
|
|
|
Source1: nagios-commands-postgres.cfg
|
|
|
|
Source2: create_manpage.pl
|
2022-03-08 18:16:45 +01:00
|
|
|
Source3: check_postgres.cfg
|
2018-03-21 13:32:29 +01:00
|
|
|
BuildRequires: nagios-rpm-macros
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(Cwd)
|
|
|
|
BuildRequires: perl(DBD::Pg)
|
|
|
|
BuildRequires: perl(DBI)
|
|
|
|
BuildRequires: perl(Data::Dumper)
|
|
|
|
BuildRequires: perl(Date::Parse)
|
|
|
|
BuildRequires: perl(Digest::MD5)
|
|
|
|
BuildRequires: perl(File::Basename)
|
|
|
|
BuildRequires: perl(File::Temp)
|
|
|
|
BuildRequires: perl(Getopt::Long)
|
|
|
|
BuildRequires: perl(Pod::Man)
|
|
|
|
BuildRequires: perl(Time::HiRes)
|
|
|
|
Requires: perl = %{perl_version}
|
|
|
|
Requires: postgresql
|
|
|
|
Requires: perl(Cwd)
|
|
|
|
Requires: perl(Data::Dumper)
|
|
|
|
Requires: perl(File::Basename)
|
|
|
|
Requires: perl(File::Temp)
|
|
|
|
Requires: perl(Getopt::Long)
|
|
|
|
Requires: perl(Time::HiRes)
|
|
|
|
Recommends: coreutils
|
|
|
|
Recommends: util-linux
|
|
|
|
Recommends: perl(Date::Parse)
|
|
|
|
Recommends: perl(Digest::MD5)
|
|
|
|
BuildArch: noarch
|
2011-02-21 12:30:40 +01:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2014-07-31 00:38:06 +02:00
|
|
|
%package -n monitoring-plugins-postgres
|
2011-02-21 12:40:21 +01:00
|
|
|
Summary: Postgres monitoring script using check_postgres.pl
|
2018-03-21 13:32:29 +01:00
|
|
|
# FIXME: use proper Requires(pre/post/preun/...)
|
2019-04-03 21:26:06 +02:00
|
|
|
Group: System/Monitoring
|
2011-02-21 12:40:21 +01:00
|
|
|
PreReq: %{name} = %{version}
|
2014-07-31 00:38:06 +02:00
|
|
|
Provides: nagios-plugins-postgres = %{version}-%{release}
|
|
|
|
Obsoletes: nagios-plugins-postgres < %{version}-%{release}
|
2011-02-21 12:40:21 +01:00
|
|
|
|
2014-07-31 00:38:06 +02:00
|
|
|
%description -n monitoring-plugins-postgres
|
2011-02-21 12:40:21 +01:00
|
|
|
This package contains the symlinks to execute special checks via the standard
|
2014-07-31 00:38:06 +02:00
|
|
|
monitoring plugins way.
|
2011-02-21 12:40:21 +01:00
|
|
|
|
2011-02-21 12:30:40 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2018-03-21 13:32:29 +01:00
|
|
|
install -m 0644 %{SOURCE1} nagios-commands-postgres.cfg
|
2020-02-05 18:21:14 +01:00
|
|
|
sed -i 's|#!/usr/bin/env perl|#!/usr/bin/perl|g' check_postgres.pl
|
2011-02-21 12:30:40 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
perl Makefile.PL
|
2018-03-21 13:32:29 +01:00
|
|
|
make %{?_smp_mflags}
|
2011-02-21 12:30:40 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
# install the module
|
|
|
|
%perl_make_install
|
|
|
|
# do not perl_process_packlist (noarch)
|
|
|
|
# remove .packlist file
|
2018-03-21 13:32:29 +01:00
|
|
|
rm -rf %{buildroot}%{perl_vendorarch}
|
2011-02-21 12:30:40 +01:00
|
|
|
# remove perllocal.pod file
|
2018-03-21 13:32:29 +01:00
|
|
|
rm -rf %{buildroot}%{perl_archlib}
|
2011-02-21 12:30:40 +01:00
|
|
|
%perl_gen_filelist
|
2014-07-31 00:46:36 +02:00
|
|
|
# create symlinks for monitoring-plugins-postgres package
|
2014-07-31 00:38:06 +02:00
|
|
|
mkdir -p %{buildroot}%{nagios_plugindir}
|
|
|
|
pushd %{buildroot}%{nagios_plugindir}
|
2011-02-21 12:40:21 +01:00
|
|
|
%{buildroot}%{_bindir}/check_postgres.pl --symlinks
|
|
|
|
# fix symlinks, as they point to the buildroot
|
|
|
|
for link in *; do
|
2018-03-21 13:32:29 +01:00
|
|
|
rm "$link"
|
|
|
|
ln -s "%{_bindir}/check_postgres.pl" "$link"
|
2011-02-21 12:40:21 +01:00
|
|
|
done
|
|
|
|
popd
|
2013-10-29 12:44:34 +01:00
|
|
|
# create man page
|
|
|
|
mkdir -p %{buildroot}/%{_mandir}/man1
|
|
|
|
perl %{SOURCE2} "%{version}" "1" check_postgres.pl > %{buildroot}/%{_mandir}/man1/check_postgres.pl.1
|
2022-03-08 18:16:45 +01:00
|
|
|
# install nrpe snipplets
|
|
|
|
install -D -m0644 %{SOURCE3} %{buildroot}%{nrpe_sysconfdir}/check_postgres.cfg
|
2011-02-21 12:30:40 +01:00
|
|
|
|
|
|
|
%files -f %{name}.files
|
2018-03-21 13:32:29 +01:00
|
|
|
%doc MANIFEST README* TODO nagios-commands-postgres.cfg check_postgres.pl.html
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
%license LICENSE
|
|
|
|
%else
|
|
|
|
%doc LICENSE
|
|
|
|
%endif
|
2019-04-03 21:26:06 +02:00
|
|
|
%{_mandir}/man1/check_postgres.pl.1%{?ext_man}
|
2011-02-21 12:40:21 +01:00
|
|
|
|
2014-07-31 00:38:06 +02:00
|
|
|
%files -n monitoring-plugins-postgres
|
2011-02-21 12:30:40 +01:00
|
|
|
# avoid build dependecy of nagios - own the dirs
|
2014-07-31 00:38:06 +02:00
|
|
|
%dir %{nagios_libdir}
|
|
|
|
%dir %{nagios_plugindir}
|
2022-03-08 18:16:45 +01:00
|
|
|
%dir %{nrpe_sysconfdir}
|
|
|
|
%config(noreplace) %{nrpe_sysconfdir}/check_postgres.cfg
|
2014-07-31 00:38:06 +02:00
|
|
|
%{nagios_plugindir}/*
|
2011-02-21 12:40:21 +01:00
|
|
|
|
2011-02-21 12:30:40 +01:00
|
|
|
%changelog
|