forked from newrelic/nri-flex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmongodb.yml
21 lines (21 loc) · 1.28 KB
/
mongodb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# This custom integration uses flex to query MongoDB for custom metrics. Notes are below.
#
# Permissions required for this integration include the cluster monitor role:
## Link here: https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-clusterMonitor
# If running this integration from a Windows machine uncomment the shell: powershell lines so the integration will use powershell. Cmd shell will not work.
integrations:
- name: nri-flex
interval: 30s
config:
name: MongoDBFlex
custom_attributes:
label.db_hostname: Enter-MongoDB-Hostname-Here
apis:
- event_type: MongoDBFlex
commands:
- run: mongo --username MongoUser --password 'MongoPassword' --authenticationDatabase admin --host 127.0.0.1 --port 27017 -quiet -eval "JSON.stringify(db.currentOp(true))"
# shell: powershell
- run: mongo --username MongoUser --password 'MongoPassword' --authenticationDatabase admin --host 127.0.0.1 --port 27017 -quiet -eval "JSON.stringify(db.hostInfo())"
# shell: powershell
- run: mongo --username MongoUser --password 'MongoPassword' --authenticationDatabase admin --host 127.0.0.1 --port 27017 -quiet -eval "JSON.stringify(db.serverStatus())"
# shell: powershell