Skip to content

Commit 7cfa6fc

Browse files
committed
Merge branch 'dev'
2 parents 46b56dc + c19f614 commit 7cfa6fc

31 files changed

+1339
-83
lines changed

.github/workflows/mamonsu-tests-dev.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
paths-ignore:
88
- 'README.md'
99
- 'documentation/**'
10+
- 'examples/**'
1011
pull_request:
1112
branches:
1213
- dev
1314
paths-ignore:
1415
- 'README.md'
1516
- 'documentation/**'
17+
- 'examples/**'
1618

1719
jobs:
1820
mamonsu-tests:
@@ -23,7 +25,7 @@ jobs:
2325
strategy:
2426
matrix:
2527
docker_os: ['centos:7']
26-
zabbix_version: ['5.4.8']
28+
zabbix_version: ['5.4.10']
2729
pg_version: ['9.6', '10', '11', '12', '13', '14']
2830

2931
steps:
@@ -57,7 +59,7 @@ jobs:
5759
echo "::set-output name=zabbix_address::$(hostname -I | awk '{print $1}')"
5860
id: zabbix_address
5961
- name: Edit Zabbix address in agent.conf
60-
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.3.1.conf
62+
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.4.0.conf
6163

6264
- name: Copy test scripts to container
6365
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/

.github/workflows/mamonsu-tests-master.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
paths-ignore:
88
- 'README.md'
99
- 'documentation/**'
10+
- 'examples/**'
1011
pull_request:
1112
branches:
1213
- master
1314
paths-ignore:
1415
- 'README.md'
1516
- 'documentation/**'
17+
- 'examples/**'
1618

1719
jobs:
1820
mamonsu-tests:
@@ -23,7 +25,7 @@ jobs:
2325
strategy:
2426
matrix:
2527
docker_os: ['ubuntu:20.04', 'centos:7']
26-
zabbix_version: ['4.0.36', '4.4.10', '5.0.18', '5.4.8']
28+
zabbix_version: ['4.0.38', '5.0.20', '5.4.10', '6.0.0']
2729
pg_version: ['9.6', '10', '11', '12', '13', '14']
2830
exclude:
2931
# excludes PG 9.6 on CentOS 8
@@ -61,7 +63,7 @@ jobs:
6163
echo "::set-output name=zabbix_address::$(hostname -I | awk '{print $1}')"
6264
id: zabbix_address
6365
- name: Edit Zabbix address in agent.conf
64-
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.3.1.conf
66+
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.4.0.conf
6567

6668
- name: Copy test scripts to container
6769
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/

README.md

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,59 @@ See details in chapter called "[Metrics](documentation/metrics.md)".
6464
### Zabbix Screens
6565
Since Mamonsu **3.0** template contains screens:
6666
- Overview
67-
Contains graphs representing general important metrics: PostgreSQL connections, shared buffers size and usage, autovacuum, tuples, checkpoint, background worker, system CPU and memory.
68-
![Mamonsu Overview](examples/Mamonsu%20Overview.png)
67+
Contains graphs representing general important metrics: PostgreSQL connections, shared buffers size and usage, autovacuum, tuples, checkpoint, background worker, system CPU and memory.
68+
<details>
69+
<summary>Click to view</summary>
70+
<img src="examples/Mamonsu%20Overview.png" alt="Mamonsu Overview"/>
71+
</details>
72+
73+
6974
- PostgreSQL Instance
70-
Contains information about Instance availability
71-
![Mamonsu PostgreSQL Instance](examples/Mamonsu%20PostgreSQL%20Instance.png)
75+
Contains information about Instance availability
76+
<details>
77+
<summary>Click to view</summary>
78+
<img src="examples/Mamonsu%20PostgreSQL%20Instance.png" alt="Mamonsu PostgreSQL Instance"/>
79+
</details>
80+
81+
7282
- PostgreSQL Locks
73-
![Mamonsu PostgreSQL Locks](examples/Mamonsu%20PostgreSQL%20Locks.png)
74-
- PostgreSQL Transactions
75-
![Mamonsu PostgreSQL Transactions](examples/Mamonsu%20PostgreSQL%20Transactions.png)
83+
<details>
84+
<summary>Click to view</summary>
85+
<img src="examples/Mamonsu%20PostgreSQL%20Locks.png" alt="Mamonsu PostgreSQL Locks"/>
86+
</details>
87+
88+
89+
- PostgreSQL Transactions
90+
<details>
91+
<summary>Click to view</summary>
92+
<img src="examples/Mamonsu%20PostgreSQL%20Transactions.png" alt="Mamonsu PostgreSQL Transactions"/>
93+
</details>
94+
95+
7696
- PostgreSQL WAL
77-
Contains information about WAL size, archiving
78-
![Mamonsu PostgreSQL WAL](examples/Mamonsu%20PostgreSQL%20WAL.png)
97+
Contains information about WAL size, archiving
98+
<details>
99+
<summary>Click to view</summary>
100+
<img src="examples/Mamonsu%20PostgreSQL%20WAL.png" alt="Mamonsu PostgreSQL WAL"/>
101+
</details>
102+
103+
79104
- System
80105
Contains information about state of the system
81-
![Mamonsu System](examples/Mamonsu%20System.png)
106+
<details>
107+
<summary>Click to view</summary>
108+
<img src="examples/Mamonsu%20System.png" alt="Mamonsu System"/>
109+
</details>
110+
111+
112+
- Mamonsu Dashboard (*only for Zabbix 6.0+*)
113+
Pretty dashboard containing all necessary PostgreSQL and system information.
114+
<details>
115+
<summary>Click to view</summary>
116+
<img src="examples/Mamonsu%20Dashboard.png" alt="Mamonsu Dashboard"/>
117+
</details>
118+
119+
82120
### Tools
83121
Mamonsu provides the command-line interface for updating some Zabbix server settings, as well as getting an overview of the monitored system configuration and tuning PostgreSQL and system settings on the fly. Also it provides tool to generate a detailed report on the hardware, operating system, memory usage and other parameters of the monitored system. List of Mamonsu commands and options:
84122

documentation/metrics.md

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,33 @@ Default config:
494494
</tr>
495495
</table>
496496

497-
12. **Inactive Memory**
497+
12. **Available Memory**
498+
499+
Zabbix item:
500+
<table>
501+
<tr>
502+
<th>Name</th>
503+
<td>Free: Available memory</td>
504+
</tr>
505+
<tr>
506+
<th>Key</th>
507+
<td>system.memory[available]</td>
508+
</tr>
509+
<tr>
510+
<th>Type</th>
511+
<td>Numeric (float)</td>
512+
</tr>
513+
<tr>
514+
<th>Units</th>
515+
<td>Bytes</td>
516+
</tr>
517+
<tr>
518+
<th>Delta</th>
519+
<td>As Is</td>
520+
</tr>
521+
</table>
522+
523+
13. **Inactive Memory**
498524

499525
Zabbix item:
500526
<table>
@@ -520,7 +546,7 @@ Default config:
520546
</tr>
521547
</table>
522548

523-
13. **Mapped Memory**
549+
14. **Mapped Memory**
524550

525551
Zabbix item:
526552
<table>
@@ -546,7 +572,7 @@ Default config:
546572
</tr>
547573
</table>
548574

549-
14. **PageTables Memory**
575+
15. **PageTables Memory**
550576

551577
Zabbix item:
552578
<table>
@@ -572,7 +598,7 @@ Default config:
572598
</tr>
573599
</table>
574600

575-
15. **Slab Memory**
601+
16. **Slab Memory**
576602

577603
Zabbix item:
578604
<table>
@@ -598,7 +624,7 @@ Default config:
598624
</tr>
599625
</table>
600626

601-
16. **Swap Memory**
627+
17. **Swap Memory**
602628

603629
Zabbix item:
604630
<table>
@@ -627,7 +653,7 @@ Default config:
627653
*Swap Memory* calculated as `SwapTotal - SwapCached`.
628654

629655

630-
17. **SwapCached Memory**
656+
18. **SwapCached Memory**
631657

632658
Zabbix item:
633659
<table>
@@ -653,7 +679,7 @@ Default config:
653679
</tr>
654680
</table>
655681

656-
18. **VMallocUsed Memory**
682+
19. **VMallocUsed Memory**
657683

658684
Zabbix item:
659685
<table>
@@ -2799,7 +2825,40 @@ Default config:
27992825
### Items
28002826

28012827

2802-
1. **Ping**
2828+
1. **Server Version**
2829+
2830+
Zabbix item:
2831+
<table>
2832+
<tr>
2833+
<th>Name</th>
2834+
<td>PostgreSQL: server version</td>
2835+
</tr>
2836+
<tr>
2837+
<th>Key</th>
2838+
<td>pgsql.version[]</td>
2839+
</tr>
2840+
<tr>
2841+
<th>Type</th>
2842+
<td>Text</td>
2843+
</tr>
2844+
<tr>
2845+
<th>Units</th>
2846+
<td></td>
2847+
</tr>
2848+
<tr>
2849+
<th>Delta</th>
2850+
<td>As Is</td>
2851+
</tr>
2852+
<tr>
2853+
<th>Supported Version</th>
2854+
<td>9.5+</td>
2855+
</tr>
2856+
</table>
2857+
2858+
*Server Version* shows PostgreSQL/PostgresPro server version number.
2859+
2860+
2861+
2. **Ping**
28032862

28042863
Zabbix item:
28052864
<table>
@@ -2832,7 +2891,7 @@ Default config:
28322891
*Ping* calculates as difference between *ping query* start time and time of receiving *ping query* result.
28332892

28342893

2835-
2. **Cache Hit Ratio**
2894+
3. **Cache Hit Ratio**
28362895

28372896
Zabbix item:
28382897
<table>
@@ -2865,7 +2924,7 @@ Default config:
28652924
*Cache Hit Ratio* calculates as ratio between last value of `Blocks hit` and summa of last values of `Blocks hit` and `Blocks read`.
28662925

28672926

2868-
3. **Service Uptime**
2927+
4. **Service Uptime**
28692928

28702929
Zabbix item:
28712930
<table>

examples/Mamonsu Dashboard.png

514 KB
Loading

examples/Mamonsu Overview.png

93.8 KB
Loading
46 KB
Loading

examples/Mamonsu PostgreSQL Locks.png

77.8 KB
Loading
-35.3 KB
Loading

examples/Mamonsu PostgreSQL WAL.png

33.2 KB
Loading

examples/Mamonsu System.png

-42.6 KB
Loading

examples/README.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

github-actions-tests/mamonsu_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if [ "${OS%:*}" = "centos" ]; then
4545
chmod -R 777 /var/log/mamonsu/
4646
sudo mkdir -p /etc/mamonsu
4747
sudo touch /etc/mamonsu/agent.conf
48-
cat /mamonsu/github-actions-tests/sources/agent_3.3.1.conf > /etc/mamonsu/agent.conf
48+
cat /mamonsu/github-actions-tests/sources/agent_3.4.0.conf > /etc/mamonsu/agent.conf
4949
chmod -R 777 /etc/mamonsu/
5050
sudo yum -y install ./mamonsu*.rpm
5151
systemctl daemon-reload
@@ -74,7 +74,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then
7474
chmod -R 777 /var/log/mamonsu/
7575
sudo mkdir -p /etc/mamonsu
7676
sudo touch /etc/mamonsu/agent.conf
77-
cat /mamonsu/github-actions-tests/sources/agent_3.3.1.conf > /etc/mamonsu/agent.conf
77+
cat /mamonsu/github-actions-tests/sources/agent_3.4.0.conf > /etc/mamonsu/agent.conf
7878
chmod -R 777 /etc/mamonsu/
7979
sudo apt-get -y install ./mamonsu*.deb
8080
service mamonsu restart

mamonsu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__author__ = 'Dmitry Vasilyev'
22
__author_email__ = 'info@postgrespro.ru'
33
__description__ = 'Monitoring agent for PostgreSQL'
4-
__version__ = '3.3.1'
4+
__version__ = '3.4.0'
55
__licence__ = 'BSD'
66

77
__url__ = 'https://github.com/postgrespro/mamonsu'

mamonsu/lib/get_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ def key_and_query(self, args=None):
3737
args = []
3838
result = ""
3939
for one in args:
40-
result += 'UserParameter={0}\n'.format(one)
40+
result += 'UserParameter={0}\n'.format(' '.join(one.replace('\n', ' ').split()))
4141
return result

mamonsu/lib/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
{prog} zabbix item error <host name>
9393
{prog} zabbix item lastvalue <host name>
9494
{prog} zabbix item lastclock <host name>
95+
{prog} zabbix dashboard upload <template name>
9596
{prog} zabbix version
9697
9798
Options:

mamonsu/plugins/pgsql/bgwriter.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class BgWriter(Plugin):
4747
Plugin.DELTA.simple_change)
4848
]
4949

50+
graph_name_buffers = "PostgreSQL bgwriter buffers"
51+
graph_name_ws = "PostgreSQL bgwriter write/sync"
52+
5053
def run(self, zbx):
5154
columns = [x[0] for x in self.Items]
5255
result = Pooler.query(self.query.format(", ".join(columns)))
@@ -88,24 +91,23 @@ def graphs(self, template, dashboard=False):
8891
"color": item[3][1]
8992
})
9093
result = template.graph({
91-
"name": "PostgreSQL bgwriter buffers",
94+
"name": self.graph_name_buffers,
9295
"items": items_buffers
93-
}) + \
94-
template.graph({
95-
"name": "PostgreSQL bgwriter write/sync",
96-
"items": items_write_sync
97-
})
96+
}) + template.graph({
97+
"name": self.graph_name_ws,
98+
"items": items_write_sync
99+
})
98100
if not dashboard:
99101
return result
100102
else:
101103
return [{
102-
"dashboard": {"name": "PostgreSQL bgwriter buffers",
104+
"dashboard": {"name": self.graph_name_buffers,
103105
"page": ZbxTemplate.dashboard_page_overview["name"],
104106
"size": ZbxTemplate.dashboard_widget_size_medium,
105107
"position": 7}
106108
},
107109
{
108-
"dashboard": {"name": "PostgreSQL bgwriter write/sync",
110+
"dashboard": {"name": self.graph_name_ws,
109111
"page": ZbxTemplate.dashboard_page_overview["name"],
110112
"size": ZbxTemplate.dashboard_widget_size_medium,
111113
"position": 8}

0 commit comments

Comments
 (0)