Add a tokumx recipe, which about three people will use.
ADD
recipes/tokumx.rb
+include_recipe 'datadog::dd-agent'
+
+# Monitor tokumx
+#
+# node.set['datadog']['tokumx']['instances'] = [
+# {
+# 'host' => 'localhost',
+# 'port' => '27017'
+# }
+# ]
+
+datadog_monitor 'tokumx' do
+ instances node['datadog']['tokumx']['instances']
+end

ADD
spec/integrations/tokumx_spec.rb
+describe 'datadog::tokumx' do
+ expected_yaml = <<-EOF
+ init_config:
+
+ instances:
+ - server: mongodb://localhost:27017
+ tags:
+ - 'env:test'
+
+ EOF
+
+ cached(:chef_run) do
+ ChefSpec::SoloRunner.new(step_into: ['datadog_monitor']) do |node|
+ node.automatic['languages'] = { 'python' => { 'version' => '2.7.2' } }
+ node.set['datadog'] = {
+ api_key: 'someapikey',
+ tokumx: {
+ instances: [
+ {
+ host: 'localhost',
+ port: '27017',
+ tags: ['env:test']
+ }
+ ]
+ }
+ }
+ end.converge(described_recipe)
+ end
+
+ subject { chef_run }
+
+ it_behaves_like 'datadog-agent'
+
+ it { is_expected.to include_recipe('datadog::dd-agent') }
+
+ it { is_expected.to add_datadog_monitor('tokumx') }
+
+ it 'renders expected YAML config file' do
+ expect(chef_run).to(render_file('/etc/dd-agent/conf.d/tokumx.yaml').with_content { |content|
+ expect(YAML.safe_load(content).to_json).to be_json_eql(YAML.safe_load(expected_yaml).to_json)
+ })
+ end
+end

ADD
templates/default/tokumx.yaml.erb
+instances:
+ <% @instances.each do |i| -%>
+ - server: mongodb://<%= i['host']%>:<%= i['port'] %>
+ <% if i.key?('tags') -%>
+ tags:
+ <% i['tags'].each do |t| -%>
+ - <%= t %>
+ <% end -%>
+ <% end -%>
+ <% if i.key?('ssl') -%>
+ ssl: <%= i['ssl'] %>
+ ssl_ca_certs: <%= i['ssl_ca_certs'] %>
+ ssl_cert_reqs: <%= i['ssl_cert_reqs'] %>
+ ssl_certfile: <%= i['ssl_certfile'] %>
+ ssl_keyfile: <%= i['ssl_keyfile'] %>
+ <% end %>
+ <% if i.key?('additional_metrics') -%>
+ additional_metrics:
+ <% i['additional_metrics'].each do |t| %>
+ - <%= t %>
+ <%end -%>
+ <% end %>
+ <% if i.key?('collections') -%>
+ collections:
+ <% i['collections'].each do |t| %>
+ - <%= t %>
+ <%end -%>
+ <% end %>
+ <% end -%>
+
+init_config:
+# No init_config details needed
\ No newline at end of file

Add a tokumx recipe, which about three people will use. (#486)