Last active
April 2, 2016 15:59
-
-
Save fancyremarker/331c526618065f719a6acbeec7055a8d to your computer and use it in GitHub Desktop.
Template repo for deploying MongoDB Cloud Monitoring (MMS) agent on Aptible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM quay.io/aptible/ubuntu:14.04 | |
WORKDIR /tmp | |
RUN apt-install curl | |
RUN curl -OL https://cloud.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent_4.1.0.251-1_amd64.deb && \ | |
dpkg -i mongodb-mms-monitoring-agent_4.1.0.251-1_amd64.deb && \ | |
rm -rf mongodb-mms-monitoring-agent_4.1.0.251-1_amd64.deb | |
ADD start-monitoring-agent /usr/local/bin/ | |
WORKDIR / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monitoring: /usr/local/bin/start-monitoring-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# chmod 0755 | |
CONF_FILE=/etc/mongodb-mms/monitoring-agent.config | |
sed -i s/mmsApiKey=/mmsApiKey=$MMS_API_KEY/ $CONF_FILE | |
echo sslRequireValidServerCertificates=false >> $CONF_FILE | |
if [ -n "$MMS_GROUP_ID" ]; then | |
echo mmsGroupId=$MMS_GROUP_ID >> $CONF_FILE | |
fi | |
mongodb-mms-monitoring-agent -conf $CONF_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use, follow these steps:
Create a new app in Aptible. It must reside in the same environment as the database(s) you wish to monitor. We refer to this app's handle as
$APP_HANDLE
below.Configure your MMS API key for the app:
Clone this Gist and push it back to Aptible:
From the Cloud Manager Web UI, confirm that the new agent appears under "Deployment" –> "Agents." Then, Click "+ Add" –> "Existing MongoDB Deployment," and enter the credentials for your Aptible MongoDB database. Set the following SSL-related values:
/etc/ssl/certs/ca-certificates.crt