File percona-monitoring-plugins.spec of Package percona-monitoring-plugins
#
# spec file for package percona-monitoring-plugins
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
Name: percona-monitoring-plugins
Version: 1.1.8
Release: 0
Summary: Percona MySQL Monitoring Plugins
License: GPL-2.0-or-later
Group: System/Monitoring
URL: http://www.percona.com/software/percona-monitoring-plugins
Source: %{name}-%{version}.tar.gz
Patch0: percona-monitoring-plugins-1.1.8-fix_redundant_argument_in_sprintf.patch
# https://github.com/percona/percona-monitoring-plugins/pull/111
Patch1: pmp-check-aws-rds-python3.patch
Patch2: make-python3.patch
Patch3: pmp-check-mongo-python3.patch
Patch4: pmp-zabbix-template-python3.patch
Patch5: ss_get_rds_stats-python3.patch
Patch6: dict2xml-python3.patch
BuildRequires: nagios-rpm-macros
BuildRequires: python3-PyYAML
BuildRequires: perl(Digest::MD5)
BuildArch: noarch
%description
The Percona Monitoring Plugins are high-quality components to add
enterprise-grade MySQL monitoring and graphing capabilities to your existing
in-house, on-premises monitoring solutions. The components are designed to
integrate seamlessly with widely deployed solutions such as Nagios and Cacti
and are delivered in the form of templates, plugins, and scripts which make it
easy to monitor MySQL performance.
%package -n percona-nagios-plugins
Summary: Percona MySQL Monitoring Plugins for Nagios/Icinga
Group: System/Monitoring
Requires: coreutils
# for pmp-check-mysql-file-privs:
Requires: findutils
Requires: gawk
# for pmp-check-lvm-snapshots:
Requires: grep
Requires: lsof
Requires: lvm
# for pmp-check-mysql-deadlocks:
Requires: mysql-client
Requires: perl
Requires: procps
# for pmp-check-aws-rds.py:
Requires: python3-boto
# for pmp-check-mysql-deleted-files:
Requires: sysvinit-tools
%description -n percona-nagios-plugins
This package contains the Percona MySQL Monitoring Plugins for Nagios/Icinga
and other compatible monitoring solutions.
* The plugins are installed below:
%{nagios_plugindir}
The Percona Monitoring Plugins are high-quality components to add
enterprise-grade MySQL monitoring and graphing capabilities to your existing
in-house, on-premises monitoring solutions. The components are designed to
integrate seamlessly with widely deployed solutions such as Nagios and Cacti
and are delivered in the form of templates, plugins, and scripts which make it
easy to monitor MySQL performance.
%package -n percona-cacti-templates
%define cacti_resource_dir /srv/www/cacti/resource/
%define cacti_scripts_dir /srv/www/cacti/scripts/
Summary: Percona MySQL Monitoring Plugins for Cacti
Group: System/Monitoring
Requires: cacti >= 0.8.6
%description -n percona-cacti-templates
This package contains the Percona MySQL Monitoring Plugins for Cacti.
* Cacti resource files are installed below:
%{cacti_resource_dir}/percona/
* Scripts are installed below:
%{cacti_scripts_dir}
The Percona Monitoring Plugins are high-quality components to add
enterprise-grade MySQL monitoring and graphing capabilities to your existing
in-house, on-premises monitoring solutions. The components are designed to
integrate seamlessly with widely deployed solutions such as Nagios and Cacti
and are delivered in the form of templates, plugins, and scripts which make it
easy to monitor MySQL performance.
%package -n percona-zabbix-templates
%define zabbix_agent_user zabbix
%define zabbix_agent_conf_dir %{_sysconfdir}/zabbix
%define zabbix_agent_dir %{_localstatedir}/lib/zabbix
Summary: Percona MySQL Monitoring Plugins for Zabbix
Group: System/Monitoring
Requires: zabbix
%description -n percona-zabbix-templates
This package contains the Percona MySQL Monitoring Plugins for Zabbix.
* Scripts are installed below %{zabbix_agent_dir}/percona/scripts
* Templates are installed below %{zabbix_agent_dir}/percona/templates
* an example Zabbix Agent config is installed in %{zabbix_agent_conf_dir}
The Percona Monitoring Plugins are high-quality components to add
enterprise-grade MySQL monitoring and graphing capabilities to your existing
in-house, on-premises monitoring solutions. The components are designed to
integrate seamlessly with widely deployed solutions such as Nagios and Cacti
and are delivered in the form of templates, plugins, and scripts which make it
easy to monitor MySQL performance.
%prep
%autosetup -p1
find . -type f -name '*.py' -execdir sed -Ei 's!%{_bindir}/(env |)python(2.7|)!%{_bindir}/python3!' {} +
%build
./make.sh nodocs
%install
# Nagios/Icinga plugins
mkdir -p %{buildroot}/%{nagios_plugindir}
cp -r release/%{name}-%{version}/nagios/bin/* %{buildroot}/%{nagios_plugindir}/
# Cacti resources and scripts
mkdir -p %{buildroot}/%{cacti_resource_dir}/percona/ %{buildroot}/%{cacti_scripts_dir}
cp -r release/%{name}-%{version}/cacti/{bin,definitions,misc,templates} %{buildroot}/%{cacti_resource_dir}/percona/
cp -r release/%{name}-%{version}/cacti/scripts/* %{buildroot}/%{cacti_scripts_dir}/
# Zabbix scripts and templates
mkdir -p %{buildroot}/%{zabbix_agent_dir}/percona
install -D -m 0644 release/%{name}-%{version}/zabbix/templates/userparameter_percona_mysql.conf \
%{buildroot}/%{_sysconfdir}/zabbix/userparameter_percona_mysql.conf
cp -r release/%{name}-%{version}/zabbix/{bin,scripts,templates,triggers} %{buildroot}/%{zabbix_agent_dir}/percona/
%files -n percona-nagios-plugins
%if 0%{?suse_version} >= 1500
%license COPYING
%else
%license COPYING
%endif
%doc Changelog docs/nagios/*
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/*
%files -n percona-cacti-templates
%if 0%{?suse_version} >= 1500
%license COPYING
%else
%license COPYING
%endif
%doc Changelog docs/cacti/*
%dir /srv/www/cacti
%dir %{cacti_resource_dir}
%dir %{cacti_resource_dir}/percona/
%dir %{cacti_scripts_dir}
%{cacti_resource_dir}/percona/*
%{cacti_scripts_dir}/*
%files -n percona-zabbix-templates
%if 0%{?suse_version} >= 1500
%license COPYING
%else
%license COPYING
%endif
%doc Changelog docs/zabbix/*
%dir %{_sysconfdir}/zabbix
%dir %{zabbix_agent_dir}
%dir %{zabbix_agent_dir}/percona
%config(noreplace) %{_sysconfdir}/zabbix/userparameter_percona_mysql.conf
%{zabbix_agent_dir}/percona/*
%changelog