From b87189f71303343806c53b5e4547a54f742e53c2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 21 May 2021 15:21:48 +0800 Subject: [PATCH] doc/mgr/influx: use :confval: directive less repeating this way Signed-off-by: Kefu Chai --- doc/mgr/influx.rst | 40 ++++++++++++++++++++------------- src/pybind/mgr/influx/module.py | 33 ++++++++++++++++++--------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/doc/mgr/influx.rst b/doc/mgr/influx.rst index 9a770530ac94b..2622d3919d08a 100644 --- a/doc/mgr/influx.rst +++ b/doc/mgr/influx.rst @@ -2,6 +2,8 @@ Influx Module ============= +.. mgr_module:: influx + The influx module continuously collects and sends time series data to an influxdb database. @@ -13,14 +15,14 @@ Enabling To enable the module, use the following command: -:: +.. prompt:: bash $ ceph mgr module enable influx If you wish to subsequently disable the module, you can use the equivalent *disable* command: -:: +.. prompt:: bash $ ceph mgr module disable influx @@ -34,29 +36,33 @@ credentials. Set configuration values using the following command: -:: +.. prompt:: bash $ ceph config set mgr mgr/influx/ -The most important settings are ``hostname``, ``username`` and ``password``. +The most important settings are :confval:`mgr/influx/hostname`, +:confval:`mgr/influx/username` and :confval:`mgr/influx/password`. For example, a typical configuration might look like this: -:: +.. prompt:: bash $ ceph config set mgr mgr/influx/hostname influx.mydomain.com ceph config set mgr mgr/influx/username admin123 ceph config set mgr mgr/influx/password p4ssw0rd -Additional optional configuration settings are: - -:interval: Time between reports to InfluxDB. Default 30 seconds. -:database: InfluxDB database name. Default "ceph". You will need to create this database and grant write privileges to the configured username or the username must have admin privileges to create it. -:port: InfluxDB server port. Default 8086 -:ssl: Use https connection for InfluxDB server. Use "true" or "false". Default false -:verify_ssl: Verify https cert for InfluxDB server. Use "true" or "false". Default true -:threads: How many worker threads should be spawned for sending data to InfluxDB. Default is 5 -:batch_size: How big batches of data points should be when sending to InfluxDB. Default is 5000 +Following is the list of all configuration settings: + +.. confval:: hostname +.. confval:: username +.. confval:: password +.. confval:: interval +.. confval:: database +.. confval:: port +.. confval:: ssl +.. confval:: verify_ssl +.. confval:: threads +.. confval:: batch_size --------- Debugging @@ -65,9 +71,11 @@ Debugging By default, a few debugging statements as well as error statements have been set to print in the log files. Users can add more if necessary. To make use of the debugging option in the module: -- Add this to the ceph.conf file.:: +- Add this to the ceph.conf file. + + .. code-block:: ini - [mgr] + [mgr] debug_mgr = 20 - Use this command ``ceph influx self-test``. diff --git a/src/pybind/mgr/influx/module.py b/src/pybind/mgr/influx/module.py index e71bfbcfdb7ff..334b6c77f9f48 100644 --- a/src/pybind/mgr/influx/module.py +++ b/src/pybind/mgr/influx/module.py @@ -21,32 +21,45 @@ except ImportError: class Module(MgrModule): MODULE_OPTIONS = [ Option(name='hostname', - default=None), + default=None, + desc='InfluxDB server hostname'), Option(name='port', type='int', - default=8086), + default=8086, + desc='InfluxDB server port'), Option(name='database', - default='ceph'), + default='ceph', + desc=('InfluxDB database name. You will need to create this ' + 'database and grant write privileges to the configured ' + 'username or the username must have admin privileges to ' + 'create it.')), Option(name='username', - default=None), + default=None, + desc='username of InfluxDB server user'), Option(name='password', - default=None), + default=None, + desc='password of InfluxDB server user'), Option(name='interval', type='secs', min=5, - default=30), + default=30, + desc='Time between reports to InfluxDB. Default 30 seconds.'), Option(name='ssl', - default='false'), + default='false', + desc='Use https connection for InfluxDB server. Use "true" or "false".'), Option(name='verify_ssl', - default='true'), + default='true', + desc='Verify https cert for InfluxDB server. Use "true" or "false".'), Option(name='threads', type='int', min=1, max=32, - default=5), + default=5, + desc='How many worker threads should be spawned for sending data to InfluxDB.'), Option(name='batch_size', type='int', - default=5000), + default=5000, + desc='How big batches of data points should be when sending to InfluxDB.'), ] @property -- 2.39.5