Hello All,
I need to monitor MongoDB Replica set for its status.
For this I have to run rs.status command in admin DB for MongoDB, this will give me JSON output and i need to look for status for ...
See more...
Hello All,
I need to monitor MongoDB Replica set for its status.
For this I have to run rs.status command in admin DB for MongoDB, this will give me JSON output and i need to look for status for replica set in that out and trigger the alert.
Appreciate any pointers on this and if someone could take a look at below code provide the feedback that will be helpful, this one is for triggering the alert based on condition, I am trying to use case for this.
index =XXXX | eval rs_status=case(status == "Primary", "OK", status =="ARBITER", "OK", status == "SECONDARY", "OK", status == "STARTUP", "KO", status == "RECOVERING", "KO" status == "STARTUP2", "KO", status == "UNKNOWN", "KO", status == "DOWN", "KO", status == "ROLLBACK", "KO", status == "REMOVED", "KO") | sort - _time | where status="KO"
Let me know if you see any issues here.
Regards
Amit