# Mongo Primary State Check

**URL:** https://forums.percona.com/t/mongo-primary-state-check/31017
**Category:** Percona Monitoring and Management (PMM)
**Tags:** closed-no-reply
**Created:** [June 13, 2024, 8:54pm UTC](https://forums.percona.com/t/mongo-primary-state-check/31017 "2024-06-13T20:54:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rkamath](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rkamath](https://forums.percona.com/u/rkamath)
#### Post date: [June 13, 2024, 8:54pm UTC](https://forums.percona.com/t/mongo-primary-state-check/31017/1 "2024-06-13T20:54:51Z")

</div>

## Description:

Is there a way to check if a primary got changed for a certain amount of time?  
Let’s say you have a replica set with A, B and C with A being the primary. Is there a way to alert if A got demoted to a secondary for more than a minute? This is using a grafana managed alert in pmm. Ideally this would be a generic alert so you don’t have to make a specific alert for every replica set.
