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

SNMP: snmp-master when master/slave throws exception during snmpwalk

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: 2.5.3
    • Component/s: Diagnostics
    • Environment:
      * MongoDB 2.5.4-pre Ubuntu 12.04 Enterprise
      * Build version: enterprise-97c3a3d2b487e9376d484d33ede2895e379a3033-2013-10-29
      * 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

      Given a MongoDB master/slave configured on the same host configured with --snmp-master and --snmp-subagent, the snmpwalk fails with an exceptions in the master's log. E.g.,

      2013-10-29T22:50:47.616+0000 [SnmpAgent] ServerStatusClient::load { host: "ip-10-239-24-41", version: "2.5.4-pre-", process: "mongod", pid: 9557, uptime: 22.0, uptimeMillis: 22070, uptimeEstimate: 21.0, localTime: new Date(1383087047615), repl: { ismaster: true, s
      ources: [] }, ok: 1.0 }
      2013-10-29T22:50:47.616+0000 [SnmpAgent] warning: repl.setName is not a string
      2013-10-29T22:50:47.616+0000 [SnmpAgent] ServerStatusClient::getElement: repl.setVersion
      2013-10-29T22:50:47.617+0000 [SnmpAgent] Assertion: 13111:field not found, expected type 16
      2013-10-29T22:50:47.624+0000 [SnmpAgent] 0xe361b3 0xdeba45 0xdd3951 0xdd39fc 0xacfc27 0xad10ab 0xadb964 0xad2216 0x7fc75ab31f7c 0x7fc75a8fe3e5 0x7fc75ab31f7c 0x7fc75a9024a5 0x7fc75ab319df 0x7fc75ab27441 0x7fc75ab27870 0x7fc75ab282e0 0x7fc75ab287ca 0x7fc75a660d86 0
      x7fc75a661ecb 0x7fc75a6625b9 
       ./bin/mongod(_ZN5mongo15printStackTraceERSo+0x23) [0xe361b3]
       ./bin/mongod(_ZN5mongo10logContextEPKc+0x1a5) [0xdeba45]
       ./bin/mongod(_ZN5mongo11msgassertedEiPKc+0x91) [0xdd3951]
       ./bin/mongod() [0xdd39fc]
       ./bin/mongod() [0xacfc27]
       ./bin/mongod(_ZN5mongo18ServerStatusClient11getIntFieldERKNS_10StringDataE+0x2b) [0xad10ab]
       ./bin/mongod(_ZN5mongo9callbacks20ServerStatusCallback7respondEP13variable_list+0x2a4) [0xadb964]
       ./bin/mongod(_ZN5mongo16my_snmp_callbackEP21netsnmp_mib_handler_sP30netsnmp_handler_registration_sP28netsnmp_agent_request_info_sP22netsnmp_request_info_s+0x206) [0xad2216]
       /usr/lib/libnetsnmpagent.so.15(netsnmp_call_next_handler+0x1ac) [0x7fc75ab31f7c]
       /usr/lib/libnetsnmphelpers.so.15(netsnmp_instance_helper_handler+0x2c5) [0x7fc75a8fe3e5]
       /usr/lib/libnetsnmpagent.so.15(netsnmp_call_next_handler+0x1ac) [0x7fc75ab31f7c]
       /usr/lib/libnetsnmphelpers.so.15(netsnmp_serialize_helper_handler+0x55) [0x7fc75a9024a5]
       /usr/lib/libnetsnmpagent.so.15(netsnmp_call_handlers+0xdf) [0x7fc75ab319df]
       /usr/lib/libnetsnmpagent.so.15(handle_var_requests+0x91) [0x7fc75ab27441]
       /usr/lib/libnetsnmpagent.so.15(handle_getnext_loop+0x20) [0x7fc75ab27870]
       /usr/lib/libnetsnmpagent.so.15(netsnmp_handle_request+0x90) [0x7fc75ab282e0]
       /usr/lib/libnetsnmpagent.so.15(handle_snmp_packet+0x1ca) [0x7fc75ab287ca]
       /usr/lib/libnetsnmp.so.15(+0x38d86) [0x7fc75a660d86]
       /usr/lib/libnetsnmp.so.15(_sess_read+0x8db) [0x7fc75a661ecb]
       /usr/lib/libnetsnmp.so.15(snmp_sess_read+0x9) [0x7fc75a6625b9]
      

      Log level 5 mongod logs are attached.

        1. mongod.master.log
          214 kB
        2. mongod.slave.log
          173 kB

            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: