I was asked to find a way to alert if the PRIMARY server in our mongodb replicaset changed… I found check_mongodb.py from the mongodb documentation and google search. Grab the check_mongodb.py file from https://github.com/mzupan/nagios-plugin-mongodb. Also here are the install instructions and the nagios configurations. I installed the check_mongodb.py file and tried it: ./check_mongodb.py No module…
Continue Readingnagios
finding mongodb primary server
I found a monitor for when the PRIMARY of a mongodb replica set changes – but how to determine which server actually is primary? Well, this can be done on the command line… root@server:/opt/mongodb/bin# ./mongo 192.168.1.1 –eval “printjson(rs.status())” MongoDB shell version: 2.0.4 connecting to: 192.168.108.161/test { “set” : “px_mongo”, “date” : ISODate(“2013-04-01T21:13:56Z”), “myState” : 2,…
Continue Reading