Opsmanager API start/stop mongod process

128 views
Skip to first unread message

Alex Penazzi

unread,
Jul 13, 2016, 9:44:40 AM7/13/16
to mongodb-user
Hello fantastic people.

I wonder if someone would manage mongod process through API.

How to start/stop mongod process through opsmanager API? if possible...

I did not find much documentation on "API operations".

thanks for help.

alex

Alex Penazzi

unread,
Jul 13, 2016, 10:46:18 AM7/13/16
to mongodb-user
I found that on documentation:
processes array determines the configuration of your MongoDB instances
processes.disabledBooleanOptional. Set to true to shut down the process.
processes.manualModeBooleanOptional. Set to true to operate this process in manual mode. The Automation Agent will take no actions on the process.
I feel is worth to give a try

alex

Chris Cunningham

unread,
Jul 26, 2016, 10:23:06 AM7/26/16
to mongodb-user

Hi Alex,

As you noted, the MongoDB API can pass the processes.disabled and processes.manualMode parameters. I tested this functionality using MongoDB Ops Manager v2.0 API and MongoDB 3.2.8 without any problems.

This can be done with the curl command similar to the following:

curl -u "<us...@example.net>:<api_key>" -H "Content-Type: application/json" "http://<app-example.net>/api/public/v1.0/groups" --digest -i -X POST --data @<path_to_data_file>

Where the data file has a JSON format with the processes.disabled set to true as shown in the following example:

...
...
...
  "processes" : [ {
    "args2_6" : {
      "net" : {
        "port" : <your_port#_here>
      },
      "storage" : {
        "dbPath" : "<your_db_path_here>"
      },
      "systemLog" : {
        "destination" : "file",
        "path" : "<your_log_path_here>"
      }
    },
    "authSchemaVersion" : 5,
    "hostname" : "<your_hostname_here>",
    "logRotate" : {
      "sizeThresholdMB" : 1000.0,
      "timeThresholdHrs" : 24
    },
    "name" : "<your_deployment_name_here>",
    "numCores" : 1,
    "processType" : "mongod",
    "version" : "<your_version_here>",
    "disabled": true
  } ],
  "replicaSets" : [ ],
  "roles" : [ ],
  "sharding" : [ ],
  "uiBaseUrl" : null,
  "version" : 7
}

Please see Ops Manager v2.0 API for more information regarding the API.

It is worth noting that the OpsManager Application is part of the MongoDB Enterprise Advanced subscription, which is a commercially supported product. If your company/organisation already has a commercial subscription and you have further questions about running OpsManager, I would suggest that you consider opening a Commercial Support case.

Alternatively, if you are evaluating MongoDB Enterprise and are interested, feel free to send me a private message of your contact details and I can request a MongoDB Account Executive to reach out to you.

Thanks,

Chris

Alex Penazzi

unread,
Jul 26, 2016, 11:29:45 AM7/26/16
to mongodb-user
Hi Chris,
thanks for this.

I just finish to write a similar script in python 3 to drive exactly the same...

I confirm that works with opsmanager 2 and mongodb 2.6 -> up versions

alex
Reply all
Reply to author
Forward
0 new messages