[SERVER-11630] SNMP: isMaster status not reported on master/slave configuration Created: 07/Nov/13  Updated: 11/Jul/16  Resolved: 12/Nov/13

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.5.3
Fix Version/s: 2.5.4

Type: Bug Priority: Minor - P4
Reporter: John Morales Assignee: James Wahlin
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:
  • MongoDB 2.5.4-pre Ubuntu 12.04 Enterprise
  • Amazon EC2 m1.medium Ubuntu Server LTS 12.04
  • Master/Slave

Issue Links:
Related
Operating System: ALL
Steps To Reproduce:

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

Participants:

 Description   

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.



 Comments   
Comment by auto [ 12/Nov/13 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: Merge pull request #16 from jameswahlin/SERVER-11630

SERVER-11630 return correct metric for replIsMaster when slave
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/4e4b80ff707c0d47dce5d2c1bab7251f8abc0cb6

Comment by auto [ 12/Nov/13 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: Merge pull request #16 from jameswahlin/SERVER-11630

SERVER-11630 return correct metric for replIsMaster when slave
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/4e4b80ff707c0d47dce5d2c1bab7251f8abc0cb6

Comment by auto [ 12/Nov/13 ]

Author:

{u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}

Message: SERVER-11630 return correct metric for replIsMaster when slave
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/5c8c22a8cc1beba7c512cf0e4dd7cec54b92e705

Generated at Thu Feb 08 03:26:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.