Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mstyushin committed Aug 19, 2024
2 parents 97d9bea + 29961c2 commit fd75eb0
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mamonsu-tests-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT
id: zabbix_address
- name: Edit Zabbix address in agent.conf
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.8.conf
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.9.conf

- name: Copy test scripts to container
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mamonsu-tests-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT
id: zabbix_address
- name: Edit Zabbix address in agent.conf
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.8.conf
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.9.conf

- name: Copy test scripts to container
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/
Expand Down
4 changes: 2 additions & 2 deletions github-actions-tests/mamonsu_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [ "${OS%:*}" = "centos" ]; then
python3 setup.py build && python3 setup.py install
make rpm
sudo rpm -i ./mamonsu*.rpm
cat /mamonsu/github-actions-tests/sources/agent_3.5.8.conf > /etc/mamonsu/agent.conf
cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf
systemctl daemon-reload
systemctl restart mamonsu
sleep 5
Expand All @@ -64,7 +64,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then
python3 setup.py build && python3 setup.py install
make deb
sudo dpkg -i ./mamonsu*.deb
cat /mamonsu/github-actions-tests/sources/agent_3.5.8.conf > /etc/mamonsu/agent.conf
cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf
service mamonsu restart
sleep 5
echo && echo && echo "mamonsu version:"
Expand Down
2 changes: 1 addition & 1 deletion github-actions-tests/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ REPO
eval "${PACKAGE_MANAGER_INSTALL} wget"
eval "${PACKAGE_MANAGER_INSTALL} bc"
eval "${PACKAGE_MANAGER_INSTALL} unzip"
eval "${PACKAGE_MANAGER_INSTALL} https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
eval "${PACKAGE_MANAGER_INSTALL} https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm"
REPO=${PACKAGE_MANAGER_INSTALL}" https://download.postgresql.org/pub/repos/yum/reporpms/EL-"$(echo ${OS} | sed -r 's/^[^0-9]*([0-9]+).*/\1/')"-x86_64/pgdg-redhat-repo-latest.noarch.rpm"\

# run tests
Expand Down
2 changes: 1 addition & 1 deletion mamonsu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = 'Dmitry Vasilyev'
__author_email__ = '[email protected]'
__description__ = 'Monitoring agent for PostgreSQL'
__version__ = '3.5.8'
__version__ = '3.5.9'
__licence__ = 'BSD'

__url__ = 'https://github.com/postgrespro/mamonsu'
Expand Down
6 changes: 5 additions & 1 deletion mamonsu/plugins/pgsql/driver/pg8000/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
from collections import defaultdict, deque
from datetime import datetime as Datetime
from decimal import Decimal
from pkg_resources import packaging
from hashlib import md5
from itertools import count, islice
from struct import Struct
from warnings import warn

try:
from pkg_resources import packaging
except ImportError:
import packaging.version

from mamonsu.plugins.pgsql.driver.pg8000 import converters
from .exceptions import (
ArrayContentNotSupportedError, DatabaseError, Error, IntegrityError,
Expand Down
5 changes: 4 additions & 1 deletion mamonsu/plugins/pgsql/driver/pool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from pkg_resources import packaging
from .connection import Connection, ConnectionInfo

try:
from pkg_resources import packaging
except ImportError:
import packaging.version

class Pool(object):
ExcludeDBs = ["template0", "template1"]
Expand Down
5 changes: 4 additions & 1 deletion mamonsu/plugins/pgsql/memory_leak_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
import os
from .pool import Pooler
import re
from pkg_resources import packaging
import mamonsu.lib.platform as platform
import posix

try:
from pkg_resources import packaging
except ImportError:
import packaging.version

class MemoryLeakDiagnostic(Plugin):
DEFAULT_CONFIG = {
Expand Down
6 changes: 5 additions & 1 deletion mamonsu/plugins/pgsql/replication.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# -*- coding: utf-8 -*-

from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin
from pkg_resources import packaging
from .pool import Pooler
from mamonsu.lib.zbx_template import ZbxTemplate

try:
from pkg_resources import packaging
except ImportError:
import packaging.version

NUMBER_NON_ACTIVE_SLOTS = 0


Expand Down
4 changes: 4 additions & 0 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
mamonsu (3.5.9-1) stable; urgency=low
* Run on systems with latest setuptools installed (>67.7.2);
* Drop using dotted user:group specification in RPM pre-install stage;

mamonsu (3.5.8-1) stable; urgency=low
* Prepare for python 3.12: remove deprecated distutils imports;

Expand Down
12 changes: 8 additions & 4 deletions packaging/rpm/SPECS/mamonsu.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: mamonsu
Version: 3.5.8
Version: 3.5.9
Release: 1%{?dist}
Summary: Monitoring agent for PostgreSQL
Group: Applications/Internet
Expand Down Expand Up @@ -57,22 +57,26 @@ getent passwd mamonsu > /dev/null || \
-c "mamonsu monitoring user" mamonsu

mkdir -p /var/run/mamonsu
chown -R mamonsu.mamonsu /var/run/mamonsu
chown -R mamonsu:mamonsu /var/run/mamonsu

mkdir -p /etc/mamonsu/plugins
touch /etc/mamonsu/plugins/__init__.py

mkdir -p /var/log/mamonsu
chown -R mamonsu.mamonsu /var/log/mamonsu
chown -R mamonsu:mamonsu /var/log/mamonsu

%preun
/sbin/service mamonsu stop >/dev/null 2>&1
/sbin/chkconfig --del mamonsu

%post
chown -R mamonsu.mamonsu /etc/mamonsu
chown -R mamonsu:mamonsu /etc/mamonsu

%changelog
* Mon Aug 19 2024 Maxim Styushin <[email protected]> - 3.5.9-1
- Run on systems with latest setuptools installed (>67.7.2);
- Drop using dotted user:group specification in RPM pre-install stage;

* Thu Apr 18 2024 Maxim Styushin <[email protected]> - 3.5.8-1
- Prepare for python 3.12: remove deprecated distutils imports;

Expand Down
2 changes: 1 addition & 1 deletion packaging/win/mamonsu.def.nsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!define NAME Mamonsu
!define VERSION 3.5.8
!define VERSION 3.5.9
!define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu"
!define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall"
!define EDB_REG "SOFTWARE\Postgresql"
Expand Down

0 comments on commit fd75eb0

Please sign in to comment.