Navigation
You were redirected from a different version of the documentation. Click here to go back.

Hosts

Base URL: https://<ops-manager-host>/

The hosts resource defines the mongod and mongos processes in your deployment. Each process is identified by a unique hostname and port combination. When you add a mongod or mongos to Ops Manager, Ops Manager automatically discovers various valid hostname and port combinations for the process. DNS records the names you can use to access a given host. Ops Manager ranks the hostnames to choose a “primary” hostname. Hostnames with the most periods rank highest, while the loopback address (127.0.0.1) and localhost lowest. Ops Manager treats the “losing” hostnames as host aliases.

When Ops Manager processes a ping from the Monitoring agent, the algorithm for assigning a primary hostname repeats. As a result, the primary hostname may change over time. You can also specify preferred hostnames in Ops Manager‘s group settings to override the hostname algorithm.

Endpoints

The following endpoints are available for hosts.

Method Endpoint Description
GET /api/public/v1.0/groups/{GROUP-ID}/hosts Get all MongoDB processes in a group.
GET /api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID} Get a MongoDB process by host ID.
GET /api/public/v1.0/groups/{GROUP-ID}/hosts/byName/{HOSTNAME:PORT} Get a MongoDB process by its hostname and port.
POST /api/public/v1.0/groups/{GROUP-ID}/hosts Start monitoring a new MongoDB process.
PATCH /api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID} Update a MongoDB process.
DELETE /api/public/v1.0/groups/{GROUP-ID}/hosts/{HOST-ID} Stop monitoring a MongoDB host.