Skip to content

Commit cc99233

Browse files
author
alexander popov
committed
fix, help, PGPRO-3797
1 parent a1774df commit cc99233

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

mamonsu/lib/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self, cfg_file=None, plugin_directories=[]):
7070
self._apply_default_config()
7171

7272
if cfg_file and not os.path.isfile(cfg_file):
73-
sys.stderr.write('Can\'t found file: {0}'.format(cfg_file))
73+
sys.stderr.write('Can\'t found file: {0}\n'.format(cfg_file))
7474
sys.exit(1)
7575
else:
7676
if cfg_file is not None:

mamonsu/lib/parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ def print_help(self):
204204
--template-name <template name> by default PostgresPro-<platform name>
205205
--application <application name in template> by default App-PostgresPro-<platform name>
206206
--add-plugins <directory>
207-
207+
--pg-version <pg_version> by default 10
208+
HINT: default pg-version is vanilla, but with PGEE or PGPRO before version number it can be changed (PGEE_10). Supported version
209+
numbers are 12, 10, 11, 9.6, 9.5, PGEE_9.6, PGEE_10, PGEE_11, PGEE_12, PGPRO_9.6, PGPRO_10, PGPRO_11, PGPRO_12
208210
209211
Export zabbix keys for native zabbix-agent:
210212
Command: export zabbix-parameters
@@ -215,7 +217,7 @@ def print_help(self):
215217
--config <file>
216218
--add-plugins <directory>
217219
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
220+
numbers are 12, 10, 11, 9.6, 9.5, PGEE_9.6, PGEE_10, PGEE_11, PGEE_12, PGPRO_9.6, PGPRO_10, PGPRO_11, PGPRO_12
219221
220222
221223
Export template for native zabbix agent:
@@ -254,7 +256,7 @@ def parse_args():
254256
usage=usage_msg,
255257
version='%prog {0}'.format(__version__))
256258
parser.add_option(
257-
'-c', '--config', dest='config_file', default=None)
259+
'-c', '--config', dest='config_file', default='/etc/mamonsu/agent.conf')
258260
# pid
259261
parser.add_option(
260262
'-p', '--pid', dest='pid', default=None)

mamonsu/lib/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def quit_handler(_signo=None, _stack_frame=None):
141141
plugins = []
142142
if len(commands) == 2:
143143
commands.append('postgrespro.xml')
144-
print('Template for mamonsu have been saved in postgrespro.conf file')
145144
for klass in Plugin.only_child_subclasses():
146145
if klass.__name__ == "PgWaitSampling" or klass.__name__ == "Cfs" : # check if plugin is for EE
147146
if Plugin.VersionPG['type'] == 'PGEE':
@@ -155,6 +154,7 @@ def quit_handler(_signo=None, _stack_frame=None):
155154
with codecs.open(commands[2], 'w', 'utf-8') as f:
156155
# template for mamonsu (zabbix-trapper) is generated for all available plugins
157156
f.write(template.xml("all", plugins)) # set type to 'all' for mamonsu
157+
print('Configuration file for mamonsu have been saved in {file} file'.format(file=commands[2]))
158158
sys.exit(0)
159159
elif commands[1] == 'zabbix-template':
160160
Plugin.Type = 'agent' # change plugin type for template generator

mamonsu/tools/agent/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def print_help():
3535
usage=usage_msg,
3636
version='%prog agent {0}'.format(__version__))
3737
parser.add_option(
38-
'-c', '--config', dest='config',
38+
'-c', '--config', dest='config', default='/etc/mamonsu/agent.conf',
3939
help=optparse.SUPPRESS_HELP)
4040
args, commands = parser.parse_args()
4141

0 commit comments

Comments
 (0)