diff options
Diffstat (limited to 'collectors/python.d.plugin/mongodb')
-rw-r--r-- | collectors/python.d.plugin/mongodb/README.md | 29 | ||||
-rw-r--r-- | collectors/python.d.plugin/mongodb/mongodb.chart.py | 22 | ||||
-rw-r--r-- | collectors/python.d.plugin/mongodb/mongodb.conf | 10 |
3 files changed, 42 insertions, 19 deletions
diff --git a/collectors/python.d.plugin/mongodb/README.md b/collectors/python.d.plugin/mongodb/README.md index 8e5f652c..ac8930dd 100644 --- a/collectors/python.d.plugin/mongodb/README.md +++ b/collectors/python.d.plugin/mongodb/README.md @@ -121,6 +121,33 @@ Number of charts depends on mongodb version, storage engine and other features ( 26. **Replication set member heartbeat latency** * member (time when last heartbeat was received from replica set member) +### prerequisite +Create a read-only user for the netdata in the admin database. + +1. Authenticate as the admin user. + +``` +use admin +db.auth("admin", "<MONGODB_ADMIN_PASSWORD>") +``` + +2. Create a user. + +``` +# MongoDB 2.x. +db.addUser("netdata", "<UNIQUE_PASSWORD>", true) + +# MongoDB 3.x or higher. +db.createUser({ + "user":"netdata", + "pwd": "<UNIQUE_PASSWORD>", + "roles" : [ + {role: 'read', db: 'admin' }, + {role: 'clusterMonitor', db: 'admin'}, + {role: 'read', db: 'local' } + ] +}) +``` ### configuration @@ -139,3 +166,5 @@ local: If no configuration is given, module will attempt to connect to mongodb daemon on `127.0.0.1:27017` address --- + +[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fpython.d.plugin%2Fmongodb%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]() diff --git a/collectors/python.d.plugin/mongodb/mongodb.chart.py b/collectors/python.d.plugin/mongodb/mongodb.chart.py index 10344342..92740ff8 100644 --- a/collectors/python.d.plugin/mongodb/mongodb.chart.py +++ b/collectors/python.d.plugin/mongodb/mongodb.chart.py @@ -16,10 +16,6 @@ except ImportError: from bases.FrameworkServices.SimpleService import SimpleService -# default module values (can be overridden per job in `config`) -# update_every = 2 -priority = 60000 -retries = 60 REPL_SET_STATES = [ ('1', 'primary'), @@ -209,21 +205,21 @@ CHARTS = { ] }, 'journaling_volume': { - 'options': [None, 'Volume of data written to the journal', 'MB', 'database performance', + 'options': [None, 'Volume of data written to the journal', 'MiB', 'database performance', 'mongodb.journaling_volume', 'line'], 'lines': [ ['journaledMB', 'volume', 'absolute', 1, 100] ] }, 'background_flush_average': { - 'options': [None, 'Average time taken by flushes to execute', 'ms', 'database performance', + 'options': [None, 'Average time taken by flushes to execute', 'milliseconds', 'database performance', 'mongodb.background_flush_average', 'line'], 'lines': [ ['average_ms', 'time', 'absolute', 1, 100] ] }, 'background_flush_last': { - 'options': [None, 'Time taken by the last flush operation to execute', 'ms', 'database performance', + 'options': [None, 'Time taken by the last flush operation to execute', 'milliseconds', 'database performance', 'mongodb.background_flush_last', 'line'], 'lines': [ ['last_ms', 'time', 'absolute', 1, 100] @@ -269,7 +265,7 @@ CHARTS = { ] }, 'memory': { - 'options': [None, 'Memory metrics', 'MB', 'resource utilization', 'mongodb.memory', 'stacked'], + 'options': [None, 'Memory metrics', 'MiB', 'resource utilization', 'mongodb.memory', 'stacked'], 'lines': [ ['virtual', None, 'absolute', 1, 1], ['resident', None, 'absolute', 1, 1], @@ -313,7 +309,7 @@ CHARTS = { }, 'wiredtiger_cache': { 'options': [None, 'The percentage of the wiredTiger cache that is in use and cache with dirty bytes', - 'percent', 'resource utilization', 'mongodb.wiredtiger_cache', 'stacked'], + 'percentage', 'resource utilization', 'mongodb.wiredtiger_cache', 'stacked'], 'lines': [ ['wiredTiger_percent_clean', 'inuse', 'absolute', 1, 1000], ['wiredTiger_percent_dirty', 'dirty', 'absolute', 1, 1000] @@ -333,14 +329,14 @@ CHARTS = { 'lines': [] }, 'tcmalloc_generic': { - 'options': [None, 'Tcmalloc generic metrics', 'MB', 'tcmalloc', 'mongodb.tcmalloc_generic', 'stacked'], + 'options': [None, 'Tcmalloc generic metrics', 'MiB', 'tcmalloc', 'mongodb.tcmalloc_generic', 'stacked'], 'lines': [ - ['current_allocated_bytes', 'allocated', 'absolute', 1, 1048576], - ['heap_size', 'heap_size', 'absolute', 1, 1048576] + ['current_allocated_bytes', 'allocated', 'absolute', 1, 1 << 20], + ['heap_size', 'heap_size', 'absolute', 1, 1 << 20] ] }, 'tcmalloc_metrics': { - 'options': [None, 'Tcmalloc metrics', 'KB', 'tcmalloc', 'mongodb.tcmalloc_metrics', 'stacked'], + 'options': [None, 'Tcmalloc metrics', 'KiB', 'tcmalloc', 'mongodb.tcmalloc_metrics', 'stacked'], 'lines': [ ['central_cache_free_bytes', 'central_cache_free', 'absolute', 1, 1024], ['current_total_thread_cache_bytes', 'current_total_thread_cache', 'absolute', 1, 1024], diff --git a/collectors/python.d.plugin/mongodb/mongodb.conf b/collectors/python.d.plugin/mongodb/mongodb.conf index 62faef68..f69acac7 100644 --- a/collectors/python.d.plugin/mongodb/mongodb.conf +++ b/collectors/python.d.plugin/mongodb/mongodb.conf @@ -27,11 +27,9 @@ # If unset, the default for python.d.plugin is used. # priority: 60000 -# retries sets the number of retries to be made in case of failures. -# If unset, the default for python.d.plugin is used. -# Attempts to restore the service are made once every update_every -# and only if the module has collected values in the past. -# retries: 60 +# penalty indicates whether to apply penalty to update_every in case of failures. +# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes. +# penalty: yes # autodetection_retry sets the job re-check interval in seconds. # The job is not deleted if check fails. @@ -58,7 +56,7 @@ # # JOBs sharing a name are mutually exclusive # update_every: 1 # the JOB's data collection frequency # priority: 60000 # the JOB's order on the dashboard -# retries: 60 # the JOB's number of restoration attempts +# penalty: yes # the JOB's penalty # autodetection_retry: 0 # the JOB's re-check interval in seconds # # Additionally to the above, mongodb also supports the following: |