Auto-fix

Auto-fix

Auto-fix

I've just released an "Auto-fix" for MongoDB Ops Manager Alerts. Let me explain how it works.

I’ve been using MongoDB Ops Manager for many years. As you likely already know, it allows us to configure alerts at both the project and global levels.

For this article, I configured a project alert for a host down event.

1.00

Then, to simulate a real-world scenario, I went to the server where the instance was running and shut it down. As expected, the alert was triggered after a few minutes.

Note: It's important to mention that this instance was only monitored by the monitoring agent, not managed by the automation agent.

I previously developed a custom dashboard that allows us to monitor all of our client's Ops Managers. When an alert is triggered, it is reported directly on this dashboard, as shown in the image below.

1.00

At this point I can:

a. Click on the alert's link, which opens the project's alert page in Ops Manager.

1.00

b. Click on "Troubleshooting", which renders a step-by-step template of the fixing procedure for this specific alert event.

c. Click on "Auto-fix", which is the action I want to focus on in this article.

When you click 'Auto-fix', the app maps a template of "change" to that specific alert. It automatically pre-fills any arguments it can draw from the alert data, while letting you modify them or manually insert the rest.

For this specific case, I developed an Ansible playbook to fix the host down event. It only expects three arguments, as shown in the image below.

1.00

Note: If you are curious about the password argument: there are plenty of secure ways to handle this. I could read it from a key vault or a similar service. However, to keep things simple here, I chose to let the user input the password but I would never pass it in cleartext, so it is encrypted before moving forward.

Clicking the "Load Change" button renders the change template with the input arguments and creates the change.

1.00

At this point, the change is ready to be executed. However, I’m going to click "Edit" first to show you the details of the activity:

1.00

I can modify and save the activity's arguments here, but for now, I'll just click "Cancel" to go back.

Next, I click "Run Entire Change" to start the execution.

1.00

The change will be executed in background, and once it finishes, the details will be reported on the "Execution Output" area.

Note: I chose print the datetime in UTC, so you might notice a difference between log times.

1.00

As you can see, it took just 32 seconds to execute the change, including the time to identify and start the instance's service.

A few seconds later, the monitoring agent checks the state of the instance and closes the alert.

1.00

Behind the scenes, we can verify that the service that manages that instance was started at the exact time the change was executed.

1.00

Before concluding, you might ask: "Why do you have an instance managed by a systemctl service if you have Ops Manager?" The answer is that this was an APPDB instance. For those who aren't familiar, APPDB is the replica set of Ops Manager, and it is a best practice not to use the automation agent to manage it.

Having a well-defined "troubleshooting" procedure is very useful, specially in the era of AI agents, but having the possibility to click in an "Auto-fix" button and watch the alert disappear is even better.

One last question: "Danilo, is it possible to automatically trigger the 'Auto-fix' procedure as soon as an alert is identified?"

The answer: "Absolutely. It can be 100% automated."

By Danilo Pala, 15/07/2026

Related Posts

Storia di un successo annunciato: un upgrade epocale portato a termine!

Storia di un successo annunciato: un upgrade epocale portato a termine!

5 production databases in Dataguard**, in 3DC configuration (PRI + BC + DR), for a total of 15 databases, going from version 11.2 to 19.22, with only 4 hours of overall downtime.

MongoDB 8.0 - Another Proof of Performance. Explained!

MongoDB 8.0 - Another Proof of Performance. Explained!

MongoDB continues to prove its powerful and flexible capabilities for managing large volumes of data

MongoDB Benchmark by using YCSB

MongoDB Benchmark by using YCSB

MongoDB

That's DAS!

That's DAS!

Building Together

Performance and Tuning: The Scientific Methodology Applied to Indexing Strategies in MongoDB

Performance and Tuning: The Scientific Methodology Applied to Indexing Strategies in MongoDB

Performance and tuning

Strange case of Dr IndexAccess and Mr FullTableScan

Strange case of Dr IndexAccess and Mr FullTableScan

Searching for the potion

Use case: How much a covered query can improve performance and the turn the metrics healthy in a Replica Set MongoDB?

Use case: How much a covered query can improve performance and the turn the metrics healthy in a Replica Set MongoDB?

MongoDB

What's DAS?

What's DAS?

And what we do!