Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11630

SNMP: isMaster status not reported on master/slave configuration

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.4
    • Affects Version/s: 2.5.3
    • Component/s: Diagnostics
    • Environment:
      * MongoDB 2.5.4-pre Ubuntu 12.04 Enterprise
      * Amazon EC2 m1.medium Ubuntu Server LTS 12.04
      * Master/Slave
    • ALL
    • Hide

      0.) Install standard pre-req packages for SNMP on Ubuntu.
      1.) Edit /etc/snmp/mongod.conf config file for subagent connection through unix socket:

      master agentx
      agentXSocket /tmp/agentx/master

      2.) Launch a master/slave pair. The master was also the SNMP master, the slave a subagent.
      3.) Run snmpwalk of master.
      snmpwalk -m MONGO-MIB -v 2c -c mongodb localhost:1161 1.3.6.1.4.1.34601

      Actual command-line flags used for each host:
      MASTER: ./bin/mongod -vvvvv --snmp-master --port 27017 --fork --dbpath data/master-0/ --logpath logs/master-0/mongod.log --smallfiles --nohttpinterface --nojournal --master

      SLAVE: ./bin/mongod -vvvvv --snmp-subagent --port 27018 --fork --dbpath data/slave-0/ --logpath logs/slave-0/mongod.log --smallfiles --nohttpinterface --nojournal --slave --source ip-internal-hostname:27017

      Show
      0.) Install standard pre-req packages for SNMP on Ubuntu. 1.) Edit /etc/snmp/mongod.conf config file for subagent connection through unix socket: master agentx agentXSocket /tmp/agentx/master 2.) Launch a master/slave pair. The master was also the SNMP master, the slave a subagent. 3.) Run snmpwalk of master. snmpwalk -m MONGO-MIB -v 2c -c mongodb localhost:1161 1.3.6.1.4.1.34601 Actual command-line flags used for each host: MASTER: ./bin/mongod -vvvvv --snmp-master --port 27017 --fork --dbpath data/master-0/ --logpath logs/master-0/mongod.log --smallfiles --nohttpinterface --nojournal --master SLAVE: ./bin/mongod -vvvvv --snmp-subagent --port 27018 --fork --dbpath data/slave-0/ --logpath logs/slave-0/mongod.log --smallfiles --nohttpinterface --nojournal --slave --source ip-internal-hostname:27017

      Example snmpwalk output:

      MONGO-MIB::replSetName."27017" = ""
      MONGO-MIB::replSetName."27018" = ""
      MONGO-MIB::replSetVersion."27017" = INTEGER: 0
      MONGO-MIB::replSetVersion."27018" = INTEGER: 0
      MONGO-MIB::replIsMaster."27017" = INTEGER: 0
      MONGO-MIB::replIsMaster."27018" = INTEGER: 0
      MONGO-MIB::replIsSecondary."27017" = INTEGER: 0
      MONGO-MIB::replIsSecondary."27018" = INTEGER: 0
      MONGO-MIB::replPrimary."27017" = ""
      MONGO-MIB::replPrimary."27018" = ""
      MONGO-MIB::replMe."27017" = ""
      MONGO-MIB::replMe."27018" = ""
      MONGO-MIB::replMe."27018" = No more variables left in this MIB View (It is past the end of the MIB tree)
      

      By comparison, db.serverStatus() is reporting a subdocument such as:

              "repl" : {
      		"ismaster" : [true|false]
      	},
      

      I would expect the isMaster/isSecondary SNMP booleans to also represent master/slave status accordingly.

            Assignee:
            james.wahlin@mongodb.com James Wahlin
            Reporter:
            john.morales@mongodb.com John Morales (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: