2

I would like to know if there is a way to get the hostname of the server which has the problem through MongoDB MMS. By default they give only following details.

{
    u'status': u'OPEN',
    u'updated': u'2015-04-14T03: 24: 33Z',
    u'links': [
    {
        u'href': u'https: //mms.mongodb.com/api/public/v1.0/groups/9b5ba/alerts/5521',
        u'rel': u'self'
    }
    ],
    u'created': u'2015-04-14T03: 24: 33Z',
    u'lastNotified': u'2015-04-14T03: 24: 41Z',
    u'alertConfigId': u'0927',
    u'eventTypeName': u'HOST_DOWN',
    u'groupId': u'5baa',
    u'typeName': u'HOST',
    u'id': u'1012'
}
Neo-coder
  • 7,715
  • 4
  • 33
  • 52
Lakal Malimage
  • 205
  • 2
  • 6

2 Answers2

1

Try this:

curl -u "username:apiKey" --digest -i "https://mms.mongodb.com/api/public/v1.0/groups/533c5895b91030606f21033a/hosts/56e9378f601dc49360a40949c8a6df6c"

Founded this code from this link: https://docs.mms.mongodb.com/reference/api/hosts/

See, if that helps.

Gaurav Dave
  • 6,838
  • 9
  • 25
  • 39
  • Thanks Dave. Actually I'm trying to display Mongo DB alerts in a custom dashboard. So when I query the open alerts feom their API, it will not send which server has an issue. For an example , take above result. It says "HOST DOWN". it is not much informative. I want to display which host is down . at least hostname. – Lakal Malimage Apr 14 '15 at 10:25
0

Please find this link as well : http://www.litixsoft.de/english/mms/

Hope below will make sense to your question

casinomongodb:PRIMARY> db.isMaster(); {
        "setName" : "casinomongodb",
        "setVersion" : 31173,
        "ismaster" : true,
        "secondary" : false,
        "hosts" : [
                "10.1.243.66:27017",
                "10.1.243.62:27017",
                "10.1.243.61:27017"
        ],
        "primary" : "10.1.243.62:27017",
        "me" : "10.1.243.62:27017",
        "electionId" : ObjectId("56c5657c8994dff92e8996fa"),
        "maxBsonObjectSize" : 16777216,
        "maxMessageSizeBytes" : 48000000,
        "maxWriteBatchSize" : 1000,
        "localTime" : ISODate("2016-04-06T09:19:03.077Z"),
        "maxWireVersion" : 3,
        "minWireVersion" : 0,
        "ok" : 1 }
Panky031
  • 425
  • 1
  • 5
  • 14