Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Commit

Permalink
Improving mms agent config : #34
Browse files Browse the repository at this point in the history
Supporting all the configurations which described in MongoDB documentation for automation and monitoring agent.
https://docs.opsmanager.mongodb.com/current/reference/automation-agent
https://docs.opsmanager.mongodb.com/current/reference/monitoring-agent
  • Loading branch information
sunggun-yu committed Apr 5, 2016
1 parent 95395b2 commit 7d83e07
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 11 deletions.
115 changes: 111 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,44 @@ default['mongodb3']['config']['mongos']['sharding']['configDB'] = nil
default['mongodb3']['config']['mongos']['sharding']['chunkSize'] = 64 # default : 64
```

### MMS Automation Agent
### MMS Automation/Monitoring Agent

* This cookbook is not manage the `mmsBaseUrl`, `logFile` and `mmsConfigBackup` configuration.
#### Common configuration attributes for both automation and monitoring agent.
```
default['mongodb3']['config']['mms']['mmsApiKey'] = nil
default['mongodb3']['config']['mms']['mmsBaseUrl'] = 'https://api-agents.mongodb.com'
default['mongodb3']['config']['mms']['httpProxy'] = nil
default['mongodb3']['config']['mms']['krb5ConfigLocation'] = nil
default['mongodb3']['config']['mms']['sslTrustedMMSServerCertificate'] = nil
default['mongodb3']['config']['mms']['sslRequireValidMMSServerCertificates'] = nil
```

#### Attributes for automation agent.
https://docs.opsmanager.mongodb.com/current/reference/automation-agent
```
default['mongodb3']['config']['mms']['mmsGroupId'] = nil
default['mongodb3']['config']['mms']['mmsApiKey'] = nil
default['mongodb3']['config']['mms']['logFile'] = '/var/log/mongodb-mms-automation/automation-agent.log'
default['mongodb3']['config']['mms']['mmsConfigBackup'] = '/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json'
default['mongodb3']['config']['mms']['logLevel'] = 'INFO'
default['mongodb3']['config']['mms']['maxLogFiles'] = 10
default['mongodb3']['config']['mms']['maxLogFileSize'] = 268435456
default['mongodb3']['config']['mms']['httpProxy'] = nil
```

#### Attributes for monitoring agent.
https://docs.opsmanager.mongodb.com/current/reference/monitoring-agent
```
default['mongodb3']['config']['mms']['useSslForAllConnections'] = nil
default['mongodb3']['config']['mms']['sslClientCertificate'] = nil
default['mongodb3']['config']['mms']['sslClientCertificatePassword'] = nil
default['mongodb3']['config']['mms']['sslTrustedServerCertificates'] = nil
default['mongodb3']['config']['mms']['sslRequireValidServerCertificates'] = nil
default['mongodb3']['config']['mms']['krb5Principal'] = nil
default['mongodb3']['config']['mms']['krb5Keytab'] = nil
default['mongodb3']['config']['mms']['gsappiServiceName'] = nil
default['mongodb3']['config']['mms']['enableMunin'] = nil
```


## Usage

Expand Down Expand Up @@ -738,9 +763,25 @@ maxLogFileSize=268435456
#
#httpProxy=
#
# The absolute path to an non-system-standard location for the Kerberos configuration file
#
#krb5ConfigLocation=
#
# The path on disk that contains the trusted certificate authority certificates in PEM format.
#
#sslTrustedMMSServerCertificate=
#
# Use this option to disable certificate verification by setting this value to false.
#
#sslRequireValidMMSServerCertificates=
# For additional optional settings, please see
# https://docs.cloud.mongodb.com/reference/automation-agent/
```

### MMS Monitoring agent
Expand Down Expand Up @@ -790,6 +831,72 @@ mmsApiKey=apikeykekekekeke
#
mmsBaseUrl=https://api-agents.mongodb.com
#
# URL to proxy all HTTP requests through
#
#httpProxy=
#
# Set to true to enable SSL support globally and to use SSL for all MongoDB connections.
#
#useSslForAllConnections=
#
# The path to the private key, client certificate, and optional intermediate certificates in PEM format
#
#sslClientCertificate=
#
# The password needed to decrypt the private key in the file specified in sslClientCertificate.
#
#sslClientCertificatePassword=
#
# The path on disk that contains the trusted certificate authority certificates in PEM format.
#
#sslTrustedServerCertificates=
#
# Use this option to disable certificate verification by setting this value to false.
#
#sslRequireValidServerCertificates=
#
# The Kerberos principal used by the agent.
#
#krb5Principal=
#
# The absolute path to Kerberos principal’s keytab file.
#
#krb5Keytab=
#
# The absolute path to an non-system-standard location for the Kerberos configuration file.
#
#krb5ConfigLocation=
#
# The default service name used by MongoDB is mongodb can specify a custom service name with the gssapiServiceName option.
#
#gsappiServiceName=
#
# By default the Monitoring Agent will use the trusted root CAs installed on the system. If the agent cannot find the trusted root CAs, configure these settings manually.
#
#sslTrustedMMSServerCertificate=
#
# You can disable certificate verification by setting this value to false.
#
#sslRequireValidMMSServerCertificates=
#
# Set to false if you do not with the Monitoring Agent to collect hardware statistics via Munin-node.
#
#enableMunin=
# For additional optional settings, please see
# https://docs.cloud.mongodb.com/reference/monitoring-agent/
Expand Down
26 changes: 23 additions & 3 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,30 @@
default['mongodb3']['config']['mongos']['sharding']['configDB'] = nil
default['mongodb3']['config']['mongos']['sharding']['chunkSize'] = 64 # default : 64

# MMS automation agent config attribute
default['mongodb3']['config']['mms']['mmsGroupId'] = nil
# MMS automation and monitoring agent config attributes
## common attributes for both automation and monitoring agent
default['mongodb3']['config']['mms']['mmsApiKey'] = nil
default['mongodb3']['config']['mms']['mmsBaseUrl'] = 'https://api-agents.mongodb.com'
default['mongodb3']['config']['mms']['httpProxy'] = nil
default['mongodb3']['config']['mms']['krb5ConfigLocation'] = nil
default['mongodb3']['config']['mms']['sslTrustedMMSServerCertificate'] = nil
default['mongodb3']['config']['mms']['sslRequireValidMMSServerCertificates'] = nil

## Attributes for automation agent
default['mongodb3']['config']['mms']['mmsGroupId'] = nil
default['mongodb3']['config']['mms']['logFile'] = '/var/log/mongodb-mms-automation/automation-agent.log'
default['mongodb3']['config']['mms']['mmsConfigBackup'] = '/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json'
default['mongodb3']['config']['mms']['logLevel'] = 'INFO'
default['mongodb3']['config']['mms']['maxLogFiles'] = 10
default['mongodb3']['config']['mms']['maxLogFileSize'] = 268435456
default['mongodb3']['config']['mms']['httpProxy'] = nil

## Attributes for monitoring agent
default['mongodb3']['config']['mms']['useSslForAllConnections'] = nil
default['mongodb3']['config']['mms']['sslClientCertificate'] = nil
default['mongodb3']['config']['mms']['sslClientCertificatePassword'] = nil
default['mongodb3']['config']['mms']['sslTrustedServerCertificates'] = nil
default['mongodb3']['config']['mms']['sslRequireValidServerCertificates'] = nil
default['mongodb3']['config']['mms']['krb5Principal'] = nil
default['mongodb3']['config']['mms']['krb5Keytab'] = nil
default['mongodb3']['config']['mms']['gsappiServiceName'] = nil
default['mongodb3']['config']['mms']['enableMunin'] = nil
34 changes: 31 additions & 3 deletions templates/default/automation-agent.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ mmsApiKey=<%= @config['mmsApiKey'] %>
#
# Base url of the MMS web server.
#
mmsBaseUrl=https://api-agents.mongodb.com
mmsBaseUrl=<%= @config['mmsBaseUrl'] %>

#
# Path to log file
#
logFile=/var/log/mongodb-mms-automation/automation-agent.log
logFile=<%= @config['logFile'] %>

#
# Path to backup cluster config to
#
mmsConfigBackup=/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json
mmsConfigBackup=<%= @config['mmsConfigBackup'] %>

#
# Lowest log level to log. Can be (in order): DEBUG, ROUTINE, INFO, WARN, ERROR, DOOM
Expand All @@ -50,5 +50,33 @@ maxLogFileSize=<%= @config['maxLogFileSize'] %>
<% else %>
httpProxy=<%= @config['httpProxy'] %>
<% end %>

#
# The absolute path to an non-system-standard location for the Kerberos configuration file
#
<% if @config['krb5ConfigLocation'].to_s.empty? %>
#krb5ConfigLocation=
<% else %>
krb5ConfigLocation=<%= @config['krb5ConfigLocation'] %>
<% end %>

#
# The path on disk that contains the trusted certificate authority certificates in PEM format.
#
<% if @config['sslTrustedMMSServerCertificate'].to_s.empty? %>
#sslTrustedMMSServerCertificate=
<% else %>
sslTrustedMMSServerCertificate=<%= @config['sslTrustedMMSServerCertificate'] %>
<% end %>

#
# Use this option to disable certificate verification by setting this value to false.
#
<% if @config['sslTrustedMMSServerCertificate'].to_s.empty? %>
#sslRequireValidMMSServerCertificates=
<% else %>
sslRequireValidMMSServerCertificates=<%= @config['sslRequireValidMMSServerCertificates'] %>
<% end %>

# For additional optional settings, please see
# https://docs.cloud.mongodb.com/reference/automation-agent/
120 changes: 119 additions & 1 deletion templates/default/monitoring-agent.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,125 @@ mmsApiKey=<%= @config['mmsApiKey'] %>
#
# Hostname of the MMS monitoring web server.
#
mmsBaseUrl=https://api-agents.mongodb.com
mmsBaseUrl=<%= @config['mmsBaseUrl'] %>

#
# URL to proxy all HTTP requests through
#
<% if @config['httpProxy'].to_s.empty? %>
#httpProxy=
<% else %>
httpProxy=<%= @config['httpProxy'] %>
<% end %>

#
# Set to true to enable SSL support globally and to use SSL for all MongoDB connections.
#
<% if @config['useSslForAllConnections'].to_s.empty? %>
#useSslForAllConnections=
<% else %>
useSslForAllConnections=<%= @config['useSslForAllConnections'] %>
<% end %>

#
# The path to the private key, client certificate, and optional intermediate certificates in PEM format
#
<% if @config['sslClientCertificate'].to_s.empty? %>
#sslClientCertificate=
<% else %>
sslClientCertificate=<%= @config['sslClientCertificate'] %>
<% end %>

#
# The password needed to decrypt the private key in the file specified in sslClientCertificate.
#
<% if @config['sslClientCertificatePassword'].to_s.empty? %>
#sslClientCertificatePassword=
<% else %>
sslClientCertificatePassword=<%= @config['sslClientCertificatePassword'] %>
<% end %>

#
# The path on disk that contains the trusted certificate authority certificates in PEM format.
#
<% if @config['sslTrustedServerCertificates'].to_s.empty? %>
#sslTrustedServerCertificates=
<% else %>
sslTrustedServerCertificates=<%= @config['sslTrustedServerCertificates'] %>
<% end %>

#
# Use this option to disable certificate verification by setting this value to false.
#
<% if @config['sslRequireValidServerCertificates'].to_s.empty? %>
#sslRequireValidServerCertificates=
<% else %>
sslRequireValidServerCertificates=<%= @config['sslRequireValidServerCertificates'] %>
<% end %>

#
# The Kerberos principal used by the agent.
#
<% if @config['krb5Principal'].to_s.empty? %>
#krb5Principal=
<% else %>
krb5Principal=<%= @config['krb5Principal'] %>
<% end %>

#
# The absolute path to Kerberos principal’s keytab file.
#
<% if @config['krb5Keytab'].to_s.empty? %>
#krb5Keytab=
<% else %>
krb5Keytab=<%= @config['krb5Keytab'] %>
<% end %>

#
# The absolute path to an non-system-standard location for the Kerberos configuration file.
#
<% if @config['krb5ConfigLocation'].to_s.empty? %>
#krb5ConfigLocation=
<% else %>
krb5ConfigLocation=<%= @config['krb5ConfigLocation'] %>
<% end %>

#
# The default service name used by MongoDB is mongodb can specify a custom service name with the gssapiServiceName option.
#
<% if @config['gsappiServiceName'].to_s.empty? %>
#gsappiServiceName=
<% else %>
gsappiServiceName=<%= @config['gsappiServiceName'] %>
<% end %>

#
# By default the Monitoring Agent will use the trusted root CAs installed on the system. If the agent cannot find the trusted root CAs, configure these settings manually.
#
<% if @config['sslTrustedMMSServerCertificate'].to_s.empty? %>
#sslTrustedMMSServerCertificate=
<% else %>
sslTrustedMMSServerCertificate=<%= @config['sslTrustedMMSServerCertificate'] %>
<% end %>

#
# You can disable certificate verification by setting this value to false.
#
<% if @config['sslRequireValidMMSServerCertificates'].to_s.empty? %>
#sslRequireValidMMSServerCertificates=
<% else %>
sslRequireValidMMSServerCertificates=<%= @config['sslRequireValidMMSServerCertificates'] %>
<% end %>

#
# Set to false if you do not with the Monitoring Agent to collect hardware statistics via Munin-node.
#
<% if @config['enableMunin'].to_s.empty? %>
#enableMunin=
<% else %>
enableMunin=<%= @config['enableMunin'] %>
<% end %>


# For additional optional settings, please see
# https://docs.cloud.mongodb.com/reference/monitoring-agent/

0 comments on commit 7d83e07

Please sign in to comment.