8

I'm trying to get 10gen's MongoDB Monitoring Service monitoring my 3-node replica set. The replica set running in an AWS VPC. Each node runs on a different [virtual] machine. Assume their IPs are 192.168.1.1 (primary or secondary), 192.168.1.2 (primary or secondary), 192.168.1.3 (arbiter).

From a quick look at the source, MMS appears to get the hostname of the machine it is running on like so:

platform.uname()[1]

For my VPC EC2 instance, this returns something like

ip-192-168-1-1

MMS then tries to connect to this hostname, which does not resolve. I'd rather just use IP addresses (since they're always static), but it seems like the hardcoded use of platform.uname()[1] in mmsAgent.py precludes that.

So, what's an elegant way out of this? Hack /etc/hosts? I'm not setting up a DNS server just for this. Maybe I'm just misunderstanding how to configure MMS.

Adam Monsen
  • 725
  • 1
  • 7
  • 24

2 Answers2

3

That piece in the agent is actually what the agent reports its name as, not what it is connecting to. In terms of what it does connect to, once you run it:

  • mms.10gen.com (port 443 - SSL) - it connects here to upload data and to read its config
  • every host you configure from your MMS page (the + button)
  • any auto-discovered hosts (if you add a mongos for example)

It will connect to the hosts based on the hostname you input into MMS when you cick the add button, or it will use the host names it auto-discovers.

Note: you can add IP addresses to the MMS config instead of hostnames and the agent will pick that up just fine, you can then add aliases to improve readability on the site after the fact

Because I work for 10gen, I can take a look at your MMS group if you send me the group name separately if you like. If not then I suggest taking a look at the Agent Log tab - that will list the errors the agent has seen, assuming it can connect to mms.10gen.com at all.

Adam C
  • 5,222
  • 2
  • 30
  • 52
  • Thank you, I was able to get it working with the knowledge that I just needed to add hosts manually via the Web UI. – Adam Monsen Jun 20 '12 at 16:33
1

I always set a hosts entry like this:

1.2.3.4 host.domain.com host

Precisely for this. As far as I know, there is no other way the FQDN can be obtained on the host itself.

Halfgaar
  • 8,084
  • 6
  • 45
  • 86