MongoDB
The MongoDB plugin allow you to monitor a number of metrics on the Mongo database on your server. If you have not installed MongoDB and you would like to install it go to https://docs.mongodb.com/manual/installation/ for instructions. If you can not find this plugin in the /usr/lib/fm-agent/plugins folder, then your version of the Agent is out of date and you should update it to gain access to this feature.
Agent Configuration
Once the agent is installed, you will need to add the following information to the agent config file (/etc/fm-agent/fm_agent.cfg):
[mongo]
hostname = 10.10.10.100
port = 27017
username = mongo_username
password = mongo_password
database = optional_specific_database_to_access
authenticationdb = optional_db_used_for_authentication
Control Panel Configuration
To add a MongoDB Agent resource to your server first see Add FortiMonitor Agent checks if you have not already.
First select “MongoDB” from the monitoring catalog.
There are a number of metrics available to monitor.
Metric |
---|
Available connections |
Current connections |
Difference - member's ping ms from primary node's ping ms |
Difference - primary node optime date and realtime |
Is replica set PRIMARY member |
MongoDB replica set member health |
MongoDB replica set member state |
Number of operations queued waiting for read lock |
Number of operations queued waiting for write lock |
Open cursors |
Timed out cursors |
Total number of operations queued waiting for lock |
The number that this resource returns is defined by the above options, please take this into account if you choose to change your alert thresholds.
If you would like to inspect the MongoDB plugin in more detail you can find the python script for it in /usr/lib/fm-agent/plugins/mongo.py.