Skip to content

Commit 9ece11e

Browse files
committed
docs: edit help message
1 parent 727ea71 commit 9ece11e

File tree

2 files changed

+45
-48
lines changed

2 files changed

+45
-48
lines changed

mamonsu/lib/parser.py

+43-46
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,31 @@
2424
Command: export zabbix-parameters
2525
Examples:
2626
{prog} export zabbix-parameters <file>
27-
NOTE: <file> can be stated with a path, along which it will be exported
28-
EXAMPLE: /etc/zabbix/zabbix_agent.d/conf_file_name.conf
2927
Options:
30-
--plugin-type <plugin_type> (pg,sys,all)
31-
--pg-version <pg_version>
28+
--plugin-type <plugin_type> (pg|sys|all) by default all
29+
--pg-version <pg_version> by default 10
3230
--add-plugins <directory>
3331
--config <file>
34-
Default plugin_type = all, pg-version = 10
35-
Note: default pg-version is vanilla, but with PGPRO or PGEE before version number it can be changed. Supported version
36-
numbers are 10, 11, 9.6, 9.5
37-
Example: PGPRO_10 or PGEE_11 or PGPRO_9.6
32+
HINT: default pg-version is vanilla, but with PGEE or PGPRO before version number it can be changed (PGEE_10). Supported version
33+
numbers are 12, 10, 11, 9.6, 9.5
3834
3935
4036
Export template for native zabbix agent:
4137
Command: export zabbix-template
4238
Examples:
4339
{prog} export zabbix-template [options] <file>
4440
Options:
45-
--template-name <template name>
46-
--plugin-type <plugin_type> (pg,sys,all)
47-
--application <application name in template>
48-
--pg-version <pg_version>
41+
--template-name <template name> by default PostgresPro-<platform name>
42+
--plugin-type <plugin_type> (pg|sys|all) by default all
43+
--application <application name in template> by default App-PostgresPro-<platform name>
44+
--pg-version <pg_version> by default 10
4945
--add-plugins <directory>
5046
--config <file>
5147
--old-zabbix
52-
Default plugin_type = all, template name = PostgresPro-<platform name>,
53-
application = App-PostgresPro-<platform name>, pg-version = 10,
54-
Note: default pg-version is vanilla, but with PGPRO or PGEE before version number it can be changed. Supported version
55-
numbers are 10, 11, 9.6, 9.5
48+
HINT: default pg-version is vanilla, but with PGEE or PGPRO before version number it can be changed (PGEE_10). Supported version
49+
numbers are 12, 10, 11, 9.6, 9.5
5650
By default, mamonsu exports the template for Zabbix 4.4 or higher.
5751
To export a template for older Zabbix versions, use the --old-zabbix option.
58-
Example: PGPRO_10 or PGEE_11 or PGPRO_9.6
5952
6053
6154
Export zabbix template with additional plugins included in config file:
@@ -64,20 +57,19 @@
6457
{prog} export template [options] <file>
6558
Options:
6659
--add-plugins <directory>
67-
--template-name <template name>
68-
--application <application name in template>
60+
--template-name <template name> by default PostgresPro-<platform name>
61+
--application <application name in template> by default App-PostgresPro-<platform name>
6962
--config <file>
7063
--old-zabbix
71-
Default template name = PostgresPro-<platform name>, application = App-PostgresPro-<platform name>
72-
By default, mamonsu exports the template for Zabbix 4.4 or higher.
64+
HINT: By default, mamonsu exports the template for Zabbix 4.4 or higher.
7365
To export a template for older Zabbix versions, use the --old-zabbix option.
7466
7567
7668
Bootstrap DDL for monitoring:
7769
Command: bootstrap
7870
Examples:
7971
{prog} bootstrap -M <mamonsu_username>
80-
HINT: -M <mamonsu_username> is used to assign ownership of bootstap queries
72+
HINT: -M <mamonsu_username> is used to assign ownership of bootstrap queries
8173
Options:
8274
-p, --port <PGPORT>
8375
-W <PGPASSWORD>
@@ -88,21 +80,18 @@
8880
8981
Information about working mamonsu:
9082
Command: agent
91-
Options:
92-
-c, --config <file>
9383
Examples:
9484
{prog} agent version
9585
{prog} agent metric-list
9686
{prog} agent metric-get <metric key>
87+
Options:
88+
-c, --config <file>
89+
9790
9891
9992
Zabbix API toolbox:
10093
Command: zabbix
101-
Options:
102-
--url=http://zabbix/web/face
103-
--user=WebUser
104-
--password=WebPassword
105-
Examples:
94+
Usage:
10695
{prog} zabbix template list
10796
{prog} zabbix template show <template name>
10897
{prog} zabbix template id <template name>
@@ -125,7 +114,11 @@
125114
{prog} zabbix item error <host name>
126115
{prog} zabbix item lastvalue <host name>
127116
{prog} zabbix item lastclock <host name>
128-
117+
Options:
118+
--url=http://zabbix/web/face
119+
--user=WebUser
120+
--password=WebPassword
121+
129122
Export metrics to zabbix server
130123
Command: upload
131124
Example:
@@ -144,21 +137,23 @@
144137
Report about hardware and software:
145138
Command: report
146139
Options:
147-
--run-system
148-
--run-postgres
140+
--run-system=Boolean by default True
141+
--run-postgres=Boolean by default True
149142
--host <PGHOST>
150143
--port <PGPORT>
144+
--disable-sudo
151145
-W <PGPASSWORD>
152146
-d, --dbname <DBNAME>
153147
-U, --username <USERNAME>
154148
-r, --print-report
155149
-w, --report-path <path to file>
150+
156151
157152
158153
AutoTune config and system:
159154
Command: tune
160155
Options:
161-
-l, --log-level INFO|DEBUG|WARN
156+
-l, --log-level (INFO|DEBUG|WARN) by default INFO
162157
--dry-run
163158
--disable-sudo
164159
--dont-tune-pgbadger
@@ -171,7 +166,7 @@
171166
AutoTune config and system:
172167
Command: tune
173168
Options:
174-
-l, --log-level INFO|DEBUG|WARN
169+
-l, --log-level (INFO|DEBUG|WARN) by default INFO
175170
--dry-run
176171
--dont-tune-pgbadger
177172
--dont-reload-postgresql
@@ -187,17 +182,17 @@ class MissOptsParser(OptionParser):
187182

188183
def print_help(self):
189184
print("""
190-
Options:
191-
-c, --config <file>
192-
-p, --pid <pid-file>
193-
-t, --template-name <template name>
194-
-a, --add-plugins <directory>
185+
195186
196187
Export example config with default variables:
197188
Command: export
198189
Examples:
199-
{prog} export config <file>
200-
--add-plugins <directory>
190+
{prog} export config <file> --add-plugins <directory>
191+
Options:
192+
-c, --config <file>
193+
-p, --pid <pid-file>
194+
-t, --template-name <template name> by default PostgresPro-<platform name>
195+
-a, --add-plugins <directory>
201196
202197
203198
Export zabbix template with additional plugins included in config file:
@@ -206,8 +201,8 @@ def print_help(self):
206201
{prog} export template <file>
207202
Options:
208203
--config <file>
209-
--template-name <template name>
210-
--application <application name in template>
204+
--template-name <template name> by default PostgresPro-<platform name>
205+
--application <application name in template> by default App-PostgresPro-<platform name>
211206
--add-plugins <directory>
212207
213208
@@ -216,18 +211,20 @@ def print_help(self):
216211
Examples:
217212
{prog} export zabbix-parameters <file>
218213
Options:
219-
--pg-version <pg_version>
214+
--pg-version <pg_version> by default 10
220215
--config <file>
221216
--add-plugins <directory>
217+
HINT: default pg-version is vanilla, but with PGEE or PGPRO before version number it can be changed (PGEE_10). Supported version
218+
numbers are 12, 10, 11, 9.6, 9.5
222219
223220
224221
Export template for native zabbix agent:
225222
Command: export zabbix-template
226223
Examples:
227224
{prog} export zabbix-template <file>
228225
Options:
229-
--template-name <template name>
230-
--application <application name in template>
226+
--template-name <template name> by default PostgresPro-<platform name>
227+
--application <application name in template> by default App-PostgresPro-<platform name>
231228
--config <file>
232229
--add-plugins <directory>
233230

mamonsu/lib/runner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def is_any_equal(iterator):
227227
# extract pg version from input
228228
def define_pg_version(version_args):
229229
if len(version_args) == 1:
230-
if version_args[0] == "11" or LooseVersion(version_args[0]) == "10" or \
230+
if version_args[0] == "11" or version_args[0] == "12" or LooseVersion(version_args[0]) == "10" or \
231231
LooseVersion(version_args[0]) == "9.6" or LooseVersion(version_args[0]) == "9.5":
232232
version_number = version_args[0].split('.')
233233
if len(version_number) > 3:
@@ -252,7 +252,7 @@ def define_pg_version(version_args):
252252
if not num.isdigit():
253253
print("Version number contains only digits. For help, see the message below")
254254
print_total_help()
255-
if version_args[1] == "11" or LooseVersion(version_args[1]) == "10" or \
255+
if version_args[1] == "11" or version_args[1] == "12" or LooseVersion(version_args[1]) == "10" or \
256256
LooseVersion(version_args[1]) == "9.6" or LooseVersion(version_args[1]) == "9.5":
257257
Plugin.VersionPG['number'] = version_args[1]
258258
Plugin.VersionPG['type'] = version_args[0]

0 commit comments

Comments
 (0)