Skip to content

Commit 973a30f

Browse files
committed
doc: string interpolation feature in agent.conf
1 parent 1ad3419 commit 973a30f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

documentation/configuration_file.md

+21
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ All parameters must be specified in the `parameter = value` format.
1010

1111
> **_NOTE:_** It is necessary to check permissions to the _mamonsu_ user to directories/files for correct interaction of agent with them. By default configuration file _agent.conf_ should have read/write permissions for _mamonsu_ user only.
1212
13+
> **_NOTE:_** Config file supports string interpolation via _%()s_ syntax in parameter values. please see “[Parameter Values Interpolation](#parameter-values-interpolation)” below.
14+
1315
***
1416

1517
### Connection Parameters
@@ -237,3 +239,22 @@ By default this plugin is disabled. To enable it set the enabled parameter to Tr
237239
This plugin collects two metrics: *pg_probackup.dir.size[#backup_directory]* (the size of the target directory) and *pg_probackup.dir.error[#backup_directory]* (backup errors) for each specified *backup_directory*.
238240

239241
If any generated backup has bad status, like ERROR, CORRUPT, ORPHAN, а trigger is fired.
242+
243+
### Parameter Values Interpolation
244+
245+
Mamonsu uses python3 built-in configparser library which allows defining arbitary variables in any config section and then reuse it within the same config section.
246+
247+
Example:
248+
```editorconfig
249+
[postgres]
250+
pg = postgres
251+
enabled = True
252+
user = %(pg)s
253+
password = %(pg)s
254+
database = %(pg)s
255+
port = 5432
256+
application_name = %(pg)s
257+
query_timeout = 10
258+
```
259+
260+
What is important to note here is that you cannot use symbol _%_ in any parameter's value since it will be treated as an interolation syntax.

0 commit comments

Comments
 (0)