Skip to content

Commit 94be55a

Browse files
committed
doc: updated documentation:
- changed Installation section; - formatting;
1 parent d4611df commit 94be55a

File tree

2 files changed

+18
-51
lines changed

2 files changed

+18
-51
lines changed

README.md

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Supported PostgreSQL versions: 9.5 - 14
3838
- [Additional chapters](#additional-chapters)
3939

4040
## Mamonsu: concepts
41-
Based by zabbix, Mamonsu provides an extensible cross-platform solution that can collect and visualize multiple PostgreSQL and system metrics. Mamonsu has about 100 PostgreSQL metrics and about 30 system metrics. Mamonsu collects [metrics](documentation/metrics.md) such as database availability, number of connections, locks, WAL problems, checkpoints, background writer activity, memory problems and many others. Unlike the native Zabbix Agent configured to collect PostgreSQL metrics, Mamonsu uses a single database connection, which minimizes performance impact on the monitored system. Mamonsu also contains a number of [tools](documentation/tools.md) for interacting with the Zabbix API, obtaining system information and information about collected metrics.
41+
Based by Zabbix, Mamonsu provides an extensible cross-platform solution that can collect and visualize multiple PostgreSQL and system metrics. Mamonsu has about 100 PostgreSQL metrics and about 30 system metrics. Mamonsu collects [metrics](documentation/metrics.md) such as database availability, number of connections, locks, WAL problems, checkpoints, background writer activity, memory problems and many others. Unlike the native Zabbix Agent configured to collect PostgreSQL metrics, Mamonsu uses a single database connection, which minimizes performance impact on the monitored system. Mamonsu also contains a number of [tools](documentation/tools.md) for interacting with the Zabbix API, obtaining system information and information about collected metrics.
4242
Mamonsu is written entirely in Python and has a plugin architecture. It is an active agent, which means that it sends the data to the Zabbix server once it is collected. Pre-configured to monitor multiple PostgreSQL and system metrics out of the box, Mamonsu can be extended with your own [custom plugins](documentation/adding_custom_plugins.md) to track other metrics critical for your system.
4343
Mamonsu can be installed on the same server where the DBMS we are going to watch is located or on remote server, but:
4444
> **_NOTE:_** While Mamonsu can collect PostgreSQL metrics from a remote server, system metrics are only collected locally. If you choose to collect PostgreSQL metrics remotely, make sure to disable collection of system metrics to avoid confusion, as they will be displayed under the same host in Zabbix.
@@ -132,40 +132,7 @@ $ makensis packaging/win/mamonsu.nsis
132132

133133
## Installation
134134
To use Mamonsu, you must create a Zabbix account and set up a Zabbix server as explained in [Zabbix documentation](https://www.zabbix.com/documentation/current/). Naturally, you must also have a PostgreSQL instance up and running if you are going to monitor PostgreSQL metrics.
135-
A pre-built Mamonsu package is provided in official Postgres Pro repository.
136-
**For Debian, Ubuntu, Astra:**
137-
```shell
138-
$ wget https://repo.postgrespro.ru/mamonsu/keys/apt-repo-add.sh
139-
$ sudo chmod 700 ./apt-repo-add.sh
140-
$ sudo ./apt-repo-add.sh
141-
$ apt-get install mamonsu
142-
```
143-
**For RPM-based distros such as Centos, RHEL, Oraclelinux, SLES, AltLinux, AltLinux-spt:**
144-
Install rpm from https://repo.postgrespro.ru/mamonsu/keys adding name of specific distro such as:
145-
```shell
146-
$ rpm -i https://repo.postgrespro.ru/mamonsu/keys/centos.rpm
147-
```
148-
Install package
149-
- for RH-like:
150-
```shell
151-
$ yum install mamonsu
152-
```
153-
- for SLES:
154-
```shell
155-
$ zypper install mamonsu
156-
```
157-
- for AltLinux, AltlLinux-spt:
158-
```shell
159-
$ apt-get update
160-
$ apt-get install mamonsu
161-
```
162-
**For Windows:**
163-
Pre-Build packages for Windows: [Windows installer](https://repo.postgrespro.ru/mamonsu/win/)
164-
165-
**Build and install from source code:**
166-
```shell
167-
git clone ... && cd mamonsu && python3 setup.py build && python3 setup.py install
168-
```
135+
A pre-built Mamonsu packages is provided in official Postgres Pro repository: [repo/mamonsu](https://repo.postgrespro.ru/mamonsu/)
169136

170137
## Usage
171138
### Screenshots
@@ -200,9 +167,9 @@ If you omit this step, metrics can only be collected on behalf of a superuser, w
200167
mamonsu bootstrap [-M mamonsu_user] [-x | --create-extensions] [-c | --config] [connection_options]
201168
```
202169
For details of usage, see “[Tools](documentation/tools.md#bootstrap)".
203-
As the result of this operation, monitoring functions are created in the mamonsu_database in *mamonsu* schema, and the right to execute them is granted to the mamonsu_user. Thus, a superuser connection is no longer required. Mamonsu also creates several tables in the specified database. Do not delete these tables as they are required for Mamonsu to work.
170+
As the result of this operation, monitoring functions are created in the *mamonsu_database* in *mamonsu* schema, and the right to execute them is granted to the *mamonsu_user*. Thus, a superuser connection is no longer required. Mamonsu also creates several tables in the specified database. Do not delete these tables as they are required for Mamonsu to work.
204171
2. **Configure Mamonsu**
205-
Edit the agent.conf configuration file.
172+
Edit the *agent.conf* configuration file.
206173
Configure Zabbix-related settings. The address field must point to the running Zabbix server, while the client field must provide the name of the Zabbix host. You can find the list of hosts available for your account in the Zabbix web interface under Configuration > Hosts.
207174
```editorconfig
208175
[zabbix]
@@ -211,13 +178,13 @@ As the result of this operation, monitoring functions are created in the mamonsu
211178
client = zabbix_host_name
212179
address = zabbix_server
213180
```
214-
By default, Mamonsu will collect both PostgreSQL and system metrics. If required, you can disable metrics collection of either type by setting the enabled parameter to False in the [postgres] or [system] section of the agent.conf file, respectively.
181+
By default, Mamonsu will collect both PostgreSQL and system metrics. If required, you can disable metrics collection of either type by setting the enabled parameter to False in the [postgres] or [system] section of the *agent.conf* file, respectively.
215182
```editorconfig
216183
[system]
217184
; enabled by default
218185
enabled = True
219186
```
220-
If you are going to collect PostgreSQL metrics, specify connection parameters for the PostgreSQL server you are going to monitor. In the user, password and database fields, you must specify the mamonsu_user, mamonsu_password and the mamonsu_database used for bootstrap, respectively. If you skipped the bootstrap, specify a superuser credentials and the database to connect to.
187+
If you are going to collect PostgreSQL metrics, specify connection parameters for the PostgreSQL server you are going to monitor. In the user, password and database fields, you must specify the *mamonsu_user*, *mamonsu_password* and the *mamonsu_database* used for `bootstrap`, respectively. If you skipped the `bootstrap`, specify a superuser credentials and the database to connect to.
221188
> **_NOTE:_** Mamonsu stores passwords as plain text in its configuration file, so control access to this file.
222189
```editorconfig
223190
[postgres]
@@ -234,12 +201,12 @@ As the result of this operation, monitoring functions are created in the mamonsu
234201
```shell
235202
mamonsu export template template.xml
236203
```
237-
Mamonsu generates the template.xml file in your current directory. By default, the name of the template that will be displayed in the Zabbix account is *Mamonsu PostgreSQL OS*, where *OS* is the name of your operating system. To get a template with a different display name, you can run the above command with the *--template-name* option.
204+
Mamonsu generates the *template.xml* file in your current directory. By default, the name of the template that will be displayed in the Zabbix account is *Mamonsu PostgreSQL OS*, where *OS* is the name of your operating system. To get a template with a different display name, you can run the above command with the *--template-name* option.
238205
2. **Optionally, specify your Zabbix account settings** in the following environment variables on your monitoring system:
239206
- Set the ZABBIX_USER and ZABBIX_PASSWD variables to the login and password of your Zabbix account, respectively.
240207
- Set the ZABBIX_URL to http://zabbix/
241208
242-
If you skip this step, you will have to add the following options to all mamonsu zabbix commands that you run:
209+
If you skip this step, you will have to add the following options to all `mamonsu zabbix` commands that you run:
243210
```shell
244211
--url=http://zabbix/ --user=zabbix_login --password=zabbix_password
245212
```
@@ -250,7 +217,7 @@ As the result of this operation, monitoring functions are created in the mamonsu
250217
Alternatively, you can upload the template through the Zabbix web interface: log in to your Zabbix account and select Templates > Import.
251218
252219
4. **Link the generated template to the host to be monitored**
253-
In the Zabbix web interface, select your host, go to Templates > Add, select your template, and click Update. If you would like to link a template with a new Zabbix host, you can do it from the command line using mamonsu zabbix commands. See the section called "[Zabbix cli](documentation/tools.md#zabbix-cli)" for details.
220+
In the Zabbix web interface, select your host, go to Templates > Add, select your template, and click Update. If you would like to link a template with a new Zabbix host, you can do it from the command line using `mamonsu zabbix` commands. See the section called "[Zabbix cli](documentation/tools.md#zabbix-cli)" for details.
254221
### Run
255222
On UNIX-like systems:
256223
```shell
@@ -277,12 +244,12 @@ Or through the Zabbix web interface:
277244
278245
### Best practices
279246
280-
**Zabbix host setup only with mamonsu zabbix cli**
247+
**Zabbix host setup only with `mamonsu zabbix` cli**
281248
1. Generate a template
282249
```shell
283250
mamonsu export template template.xml
284251
```
285-
2. Set zabbix variables
252+
2. Set Zabbix variables
286253
```shell
287254
export ZABBIX_USER=Admin
288255
export ZABBIX_PASSWD=zabbix
@@ -296,7 +263,7 @@ Or through the Zabbix web interface:
296263
```shell
297264
mamonsu zabbix host create "pg-host" $(mamonsu zabbix hostgroup id "Linux Servers") $(mamonsu zabbix template id "Mamonsu PostgreSQL Linux") "10.10.0.4"
298265
```
299-
This snippet shows how to create Zabbix host called "pg-host" with Mamonsu template in hostgroup "Linux Servers" with address 10.10.0.4.
266+
This snippet shows how to create Zabbix host called *pg-host* with Mamonsu template in hostgroup *Linux Servers* with address *10.10.0.4*.
300267
301268
**Mamonsu setup with remote PostgreSQL**
302269
1. Generate and upload template
@@ -340,7 +307,7 @@ Or through the Zabbix web interface:
340307
```shell
341308
ssh -L 63333:localhost:5432 [email protected]
342309
```
343-
4. Setup agent.conf
310+
4. Setup *agent.conf*
344311
```editorconfig
345312
[postgres]
346313
enabled = True
@@ -374,7 +341,7 @@ If you need to retain the collected data, do the following:
374341
6. Create a new host for the same system and link the new template to it.
375342
7. Restart mamonsu. It will collect data for the new host. The old host will no longer be used, but the data collected will be available.
376343
377-
The difficulty is that Zabbix cannot massively rename nodes.
344+
The difficulty is that Zabbix cannot massively rename hosts.
378345
We offer the following recommendations:
379346
1. If you have access to the Zabbix database:
380347
Mass rename hosts via SQL:
@@ -459,7 +426,7 @@ API query:
459426
esac
460427
done
461428
462-
# get zabbix auth token
429+
# get Zabbix auth token
463430
auth_token=$(curl -H "Content-type: application/json-rpc" -X POST ${ZABBIX_URL}api_jsonrpc.php -d'
464431
{
465432
"jsonrpc": "2.0",
@@ -471,7 +438,7 @@ API query:
471438
"id": 1
472439
}' | python3 -c "import sys, json; print(json.load(sys.stdin)['result'])")
473440
474-
# get array of zabbix hosts to rename
441+
# get array of Zabbix hosts to rename
475442
readarray -t hosts < <(mamonsu zabbix --url=${ZABBIX_URL} --user=${ZABBIX_USER} --password=${ZABBIX_PASSWORD} host list | awk '{ print "\""$0"\""}' | grep ${ZABBIX_PATTERN})
476443
hosts=("${hosts[@]//\"/}")
477444

documentation/configuration_file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Mamonsu: configuration file
22

33
## Configuration Parameters
4-
The agent.conf configuration file is located in the /etc/mamonsu directory by default. It provides several groups of parameters that control which metrics to collect and how to log the collected data:
4+
The *agent.conf* configuration file is located in the */etc/mamonsu* directory by default. It provides several groups of parameters that control which metrics to collect and how to log the collected data:
55
- [Connection Parameters](#connection-parameters);
66
- [Logging parameters](#logging-parameters);
77
- [Plugin Parameters](#plugin-parameters).
88

9-
All parameters must be specified in the parameter = value format.
9+
All parameters must be specified in the `parameter = value` format.
1010

1111
***
1212

0 commit comments

Comments
 (0)