In the previous recipe, we saw how to monitor various metrics from MMS console. This is a great way to see all the stats in one place and get an overview of the health of the MongoDB instances and cluster. However, it is not possible to monitor the system continuously, 24/7, for the support personnel and there has to be some mechanism to automatically send out alerts in case some threshold is exceeded. In this recipe we will set up an alert whenever the page faults exceeds 1000.
Refer to the previous recipe to set up Monitoring Mongo Instances using MMS. That is the only prerequisite for this recipe.
The steps were pretty simple and we were successful in setting up MMS alerts when the page faults exceeded 1000 per minute. As we saw in the previous recipe, no fixed value is classified as high or low. It is something that is acceptable for your system, which comes with benchmarking the system during the testing phases in your environment. Similar to page faults, there is a vast array of alerts that can be set up. Once an alert is raised, it will be sent every 10 minutes, as we have set, until the condition for sending the alerts is not met. In this case, if the number of page faults falls below 1000 or somebody manually acknowledges the alert, no further alerts will be sent further for that incident.
As we see in the following screenshot, the alert is open and we can acknowledge the alert:
On clicking on Acknowledge, the following popup will let us choose the duration for which we will acknowledge:
This means that for this particular incident, no more alerts will be sent out until the selected time period elapses.
The Open alerts can be viewed by clicking on the Activities menu option on the left.