diff --git a/attributes/default.rb b/attributes/default.rb index 32e208f1..d377d3fb 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -360,6 +360,13 @@ default['datadog']['process_agent']['container_interval'] = nil default['datadog']['process_agent']['rtcontainer_interval'] = nil +# Logs functionality settings +# Set `enable_log_agent` to: +# * `true` to explicitly enable the log agent +# * `false` to explicitly disable it +# Leave it to `nil` to let the agent's default behavior decide whether to run the log-agent +default['datadog']['enable_logs_agent'] = nil + # For custom gem servers on restricted networks # This attribute only works on Chef >= 12.3 # Change false to the URL of your custom gem server diff --git a/providers/monitor.rb b/providers/monitor.rb index 91ba8d6b..046cb8d6 100644 --- a/providers/monitor.rb +++ b/providers/monitor.rb @@ -25,7 +25,8 @@ def whyrun_supported? variables( init_config: new_resource.init_config, instances: new_resource.instances, - version: new_resource.version + version: new_resource.version, + logs: new_resource.logs ) cookbook new_resource.cookbook sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) diff --git a/recipes/activemq.rb b/recipes/activemq.rb index 34cc9018..a934ee6b 100644 --- a/recipes/activemq.rb +++ b/recipes/activemq.rb @@ -22,4 +22,5 @@ datadog_monitor 'activemq' do instances node['datadog']['activemq']['instances'] + logs node['datadog']['activemq']['logs'] end diff --git a/recipes/apache.rb b/recipes/apache.rb index 1668c098..9fb31573 100644 --- a/recipes/apache.rb +++ b/recipes/apache.rb @@ -19,4 +19,5 @@ datadog_monitor 'apache' do instances node['datadog']['apache']['instances'] + logs node['datadog']['apache']['logs'] end diff --git a/recipes/cacti.rb b/recipes/cacti.rb index 896d58b5..55a977f3 100644 --- a/recipes/cacti.rb +++ b/recipes/cacti.rb @@ -40,4 +40,5 @@ datadog_monitor 'cacti' do instances node['datadog']['cacti']['instances'] + logs node['datadog']['cacti']['logs'] end diff --git a/recipes/cassandra.rb b/recipes/cassandra.rb index 4174b965..ad553cfd 100644 --- a/recipes/cassandra.rb +++ b/recipes/cassandra.rb @@ -38,4 +38,5 @@ datadog_monitor 'cassandra' do instances node['datadog']['cassandra']['instances'] version node['datadog']['cassandra']['version'] + logs node['datadog']['cassandra']['logs'] end diff --git a/recipes/consul.rb b/recipes/consul.rb index e73453f2..d771c50d 100644 --- a/recipes/consul.rb +++ b/recipes/consul.rb @@ -30,4 +30,5 @@ datadog_monitor 'consul' do instances node['datadog']['consul']['instances'] + logs node['datadog']['consul']['logs'] end diff --git a/recipes/couchbase.rb b/recipes/couchbase.rb index 37fad393..897944b9 100644 --- a/recipes/couchbase.rb +++ b/recipes/couchbase.rb @@ -18,4 +18,5 @@ datadog_monitor 'couchbase' do instances node['datadog']['couchbase']['instances'] + logs node['datadog']['couchbase']['logs'] end diff --git a/recipes/couchdb.rb b/recipes/couchdb.rb index 5e63dfda..95eb287a 100644 --- a/recipes/couchdb.rb +++ b/recipes/couchdb.rb @@ -20,4 +20,5 @@ datadog_monitor 'couch' do init_config nil instances node['datadog']['couch']['instances'] + logs node['datadog']['couch']['logs'] end diff --git a/recipes/directory.rb b/recipes/directory.rb index 63da793e..fee67eca 100644 --- a/recipes/directory.rb +++ b/recipes/directory.rb @@ -13,4 +13,5 @@ datadog_monitor 'directory' do instances node['datadog']['directory']['instances'] + logs node['datadog']['directory']['logs'] end diff --git a/recipes/disk.rb b/recipes/disk.rb index 8dee315c..fa1e93cd 100644 --- a/recipes/disk.rb +++ b/recipes/disk.rb @@ -32,4 +32,5 @@ datadog_monitor 'disk' do instances node['datadog']['disk']['instances'] init_config nil + logs node['datadog']['disk']['logs'] end diff --git a/recipes/dns_check.rb b/recipes/dns_check.rb index 6374050e..ac2e46d2 100644 --- a/recipes/dns_check.rb +++ b/recipes/dns_check.rb @@ -30,4 +30,5 @@ datadog_monitor 'dns_check' do instances node['datadog']['dns_check']['instances'] + logs node['datadog']['dns_check']['logs'] end diff --git a/recipes/docker.rb b/recipes/docker.rb index bef0fea0..4e1b6c5e 100644 --- a/recipes/docker.rb +++ b/recipes/docker.rb @@ -46,4 +46,5 @@ datadog_monitor 'docker' do init_config node['datadog']['docker']['init_config'] instances node['datadog']['docker']['instances'] + logs node['datadog']['docker']['logs'] end diff --git a/recipes/docker_daemon.rb b/recipes/docker_daemon.rb index cdf95bb6..268f167b 100644 --- a/recipes/docker_daemon.rb +++ b/recipes/docker_daemon.rb @@ -76,4 +76,5 @@ datadog_monitor 'docker_daemon' do init_config node['datadog']['docker_daemon']['init_config'] instances node['datadog']['docker_daemon']['instances'] + logs node['datadog']['docker_daemon']['logs'] end diff --git a/recipes/elasticsearch.rb b/recipes/elasticsearch.rb index 348ba35e..17914e75 100644 --- a/recipes/elasticsearch.rb +++ b/recipes/elasticsearch.rb @@ -57,4 +57,5 @@ datadog_monitor 'elastic' do instances node['datadog']['elasticsearch']['instances'] + logs node['datadog']['elasticsearch']['logs'] end diff --git a/recipes/etcd.rb b/recipes/etcd.rb index 653f05cd..55da864d 100644 --- a/recipes/etcd.rb +++ b/recipes/etcd.rb @@ -21,4 +21,5 @@ datadog_monitor 'etcd' do instances node['datadog']['etcd']['instances'] + logs node['datadog']['etcd']['logs'] end diff --git a/recipes/fluentd.rb b/recipes/fluentd.rb index dfeb0e16..f904da10 100644 --- a/recipes/fluentd.rb +++ b/recipes/fluentd.rb @@ -12,4 +12,5 @@ datadog_monitor 'fluentd' do instances node['datadog']['fluentd']['instances'] + logs node['datadog']['fluentd']['logs'] end diff --git a/recipes/go-metro.rb b/recipes/go-metro.rb index 75fc0557..d2afdcfb 100644 --- a/recipes/go-metro.rb +++ b/recipes/go-metro.rb @@ -78,4 +78,5 @@ datadog_monitor 'go-metro' do init_config node['datadog']['go-metro']['init_config'] instances node['datadog']['go-metro']['instances'] + logs node['datadog']['go-metro']['logs'] end diff --git a/recipes/go_expvar.rb b/recipes/go_expvar.rb index 35a744ed..a7cdec34 100644 --- a/recipes/go_expvar.rb +++ b/recipes/go_expvar.rb @@ -21,4 +21,5 @@ datadog_monitor 'go_expvar' do init_config node['datadog']['go_expvar']['init_config'] instances node['datadog']['go_expvar']['instances'] + logs node['datadog']['go_expvar']['logs'] end diff --git a/recipes/gunicorn.rb b/recipes/gunicorn.rb index ffdfd52d..f9a3e6b8 100644 --- a/recipes/gunicorn.rb +++ b/recipes/gunicorn.rb @@ -27,4 +27,5 @@ datadog_monitor 'gunicorn' do instances node['datadog']['gunicorn']['instances'] + logs node['datadog']['gunicorn']['logs'] end diff --git a/recipes/haproxy.rb b/recipes/haproxy.rb index 4028a816..34afa8ba 100644 --- a/recipes/haproxy.rb +++ b/recipes/haproxy.rb @@ -16,4 +16,5 @@ datadog_monitor 'haproxy' do instances node['datadog']['haproxy']['instances'] + logs node['datadog']['haproxy']['logs'] end diff --git a/recipes/hdfs.rb b/recipes/hdfs.rb index cb6a6ba5..f171e2da 100644 --- a/recipes/hdfs.rb +++ b/recipes/hdfs.rb @@ -26,4 +26,5 @@ datadog_monitor 'hdfs' do instances node['datadog']['hdfs']['instances'] + logs node['datadog']['hdfs']['logs'] end diff --git a/recipes/http_check.rb b/recipes/http_check.rb index 43f9df64..621646b7 100644 --- a/recipes/http_check.rb +++ b/recipes/http_check.rb @@ -21,4 +21,5 @@ datadog_monitor 'http_check' do instances node['datadog']['http_check']['instances'] + logs node['datadog']['http_check']['logs'] end diff --git a/recipes/iis.rb b/recipes/iis.rb index e955998d..ec639a05 100644 --- a/recipes/iis.rb +++ b/recipes/iis.rb @@ -21,4 +21,5 @@ datadog_monitor 'iis' do instances node['datadog']['iis']['instances'] + logs node['datadog']['iis']['logs'] end diff --git a/recipes/integrations.rb b/recipes/integrations.rb index 1841c710..87bf340e 100644 --- a/recipes/integrations.rb +++ b/recipes/integrations.rb @@ -38,6 +38,7 @@ datadog_monitor name do init_config node['datadog'][name]['init_config'] instances node['datadog'][name]['instances'] + logs node['datadog'][name]['logs'] use_integration_template true end end diff --git a/recipes/jenkins.rb b/recipes/jenkins.rb index d8e3693d..78a0a249 100644 --- a/recipes/jenkins.rb +++ b/recipes/jenkins.rb @@ -20,4 +20,5 @@ datadog_monitor 'jenkins' do instances node['datadog']['jenkins']['instances'] + logs node['datadog']['jenkins']['logs'] end diff --git a/recipes/jmx.rb b/recipes/jmx.rb index 2e353ba4..3a260af3 100644 --- a/recipes/jmx.rb +++ b/recipes/jmx.rb @@ -19,4 +19,5 @@ # ] datadog_monitor 'jmx' do instances node['datadog']['jmx']['instances'] + logs node['datadog']['jmx']['logs'] end diff --git a/recipes/kafka.rb b/recipes/kafka.rb index cdd6e97e..0e1fbd22 100644 --- a/recipes/kafka.rb +++ b/recipes/kafka.rb @@ -38,4 +38,5 @@ datadog_monitor 'kafka' do instances node['datadog']['kafka']['instances'] version node['datadog']['kafka']['version'] + logs node['datadog']['kafka']['logs'] end diff --git a/recipes/kafka_consumer.rb b/recipes/kafka_consumer.rb index d5fb83c2..c9832d9f 100644 --- a/recipes/kafka_consumer.rb +++ b/recipes/kafka_consumer.rb @@ -13,4 +13,5 @@ datadog_monitor 'kafka_consumer' do instances node['datadog']['kafka_consumer']['instances'] + logs node['datadog']['kafka_consumer']['logs'] end diff --git a/recipes/kubernetes.rb b/recipes/kubernetes.rb index e0b18f4b..ce61d5d5 100644 --- a/recipes/kubernetes.rb +++ b/recipes/kubernetes.rb @@ -27,4 +27,5 @@ datadog_monitor 'kubernetes' do instances node['datadog']['kubernetes']['instances'] + logs node['datadog']['kubernetes']['logs'] end diff --git a/recipes/kyototycoon.rb b/recipes/kyototycoon.rb index aeb63622..6d3f19a1 100644 --- a/recipes/kyototycoon.rb +++ b/recipes/kyototycoon.rb @@ -19,4 +19,5 @@ datadog_monitor 'kyototycoon' do instances node['datadog']['kyototycoon']['instances'] + logs node['datadog']['kyototycoon']['logs'] end diff --git a/recipes/lighttpd.rb b/recipes/lighttpd.rb index f6b40813..16b58d03 100644 --- a/recipes/lighttpd.rb +++ b/recipes/lighttpd.rb @@ -2,4 +2,5 @@ datadog_monitor 'lighttpd' do instances node['datadog']['lighttpd']['instances'] + logs node['datadog']['lighttpd']['logs'] end diff --git a/recipes/memcache.rb b/recipes/memcache.rb index 1362b8ff..dd5a6cbe 100644 --- a/recipes/memcache.rb +++ b/recipes/memcache.rb @@ -16,4 +16,5 @@ datadog_monitor 'mcache' do instances node['datadog']['memcache']['instances'] + logs node['datadog']['memcache']['logs'] end diff --git a/recipes/mesos.rb b/recipes/mesos.rb index e8da1865..04b49d05 100644 --- a/recipes/mesos.rb +++ b/recipes/mesos.rb @@ -36,4 +36,5 @@ datadog_monitor 'mesos' do init_config node['datadog']['mesos']['init_config'] instances node['datadog']['mesos']['instances'] + logs node['datadog']['mesos']['logs'] end diff --git a/recipes/mongo.rb b/recipes/mongo.rb index 10cccad8..bc91ca6e 100644 --- a/recipes/mongo.rb +++ b/recipes/mongo.rb @@ -11,4 +11,5 @@ datadog_monitor 'mongo' do instances node['datadog']['mongo']['instances'] + logs node['datadog']['mongo']['logs'] end diff --git a/recipes/mysql.rb b/recipes/mysql.rb index 70b6bdf9..bbcff534 100644 --- a/recipes/mysql.rb +++ b/recipes/mysql.rb @@ -31,4 +31,5 @@ datadog_monitor 'mysql' do instances node['datadog']['mysql']['instances'] + logs node['datadog']['mysql']['logs'] end diff --git a/recipes/network.rb b/recipes/network.rb index 5e84aab1..04b314be 100644 --- a/recipes/network.rb +++ b/recipes/network.rb @@ -13,4 +13,5 @@ datadog_monitor 'network' do instances node['datadog']['network']['instances'] + logs node['datadog']['network']['logs'] end diff --git a/recipes/nginx.rb b/recipes/nginx.rb index 2b842fb9..d20b7342 100644 --- a/recipes/nginx.rb +++ b/recipes/nginx.rb @@ -22,4 +22,5 @@ datadog_monitor 'nginx' do instances node['datadog']['nginx']['instances'] + logs node['datadog']['nginx']['logs'] end diff --git a/recipes/ntp.rb b/recipes/ntp.rb index 32737a94..c68bd6e5 100644 --- a/recipes/ntp.rb +++ b/recipes/ntp.rb @@ -15,4 +15,5 @@ # ] datadog_monitor 'ntp' do instances node['datadog']['ntp']['instances'] + logs node['datadog']['ntp']['logs'] end diff --git a/recipes/pgbouncer.rb b/recipes/pgbouncer.rb index 7bcfe6be..f04a17dc 100644 --- a/recipes/pgbouncer.rb +++ b/recipes/pgbouncer.rb @@ -36,4 +36,5 @@ datadog_monitor 'pgbouncer' do instances node['datadog']['pgbouncer']['instances'] + logs node['datadog']['pgbouncer']['logs'] end diff --git a/recipes/php_fpm.rb b/recipes/php_fpm.rb index 9e4f2b17..5aef1aed 100644 --- a/recipes/php_fpm.rb +++ b/recipes/php_fpm.rb @@ -15,4 +15,5 @@ # ] datadog_monitor 'php_fpm' do instances node['datadog']['php_fpm']['instances'] + logs node['datadog']['php_fpm']['logs'] end diff --git a/recipes/postfix.rb b/recipes/postfix.rb index 22dc0227..9e882aa2 100644 --- a/recipes/postfix.rb +++ b/recipes/postfix.rb @@ -42,4 +42,5 @@ datadog_monitor 'postfix' do instances postfix_instances + logs node['datadog']['postfix']['logs'] end diff --git a/recipes/postgres.rb b/recipes/postgres.rb index 0a81840f..bad46f4a 100644 --- a/recipes/postgres.rb +++ b/recipes/postgres.rb @@ -25,4 +25,5 @@ datadog_monitor 'postgres' do instances node['datadog']['postgres']['instances'] + logs node['datadog']['postgres']['logs'] end diff --git a/recipes/process.rb b/recipes/process.rb index 5db38b0a..36d30aca 100644 --- a/recipes/process.rb +++ b/recipes/process.rb @@ -26,4 +26,5 @@ datadog_monitor 'process' do instances node['datadog']['process']['instances'] + logs node['datadog']['process']['logs'] end diff --git a/recipes/rabbitmq.rb b/recipes/rabbitmq.rb index 166df7bd..52adc374 100644 --- a/recipes/rabbitmq.rb +++ b/recipes/rabbitmq.rb @@ -19,4 +19,5 @@ datadog_monitor 'rabbitmq' do instances node['datadog']['rabbitmq']['instances'] + logs node['datadog']['rabbitmq']['logs'] end diff --git a/recipes/redisdb.rb b/recipes/redisdb.rb index 3a8dc0a3..04796c8d 100644 --- a/recipes/redisdb.rb +++ b/recipes/redisdb.rb @@ -13,4 +13,5 @@ # ] datadog_monitor 'redisdb' do instances node['datadog']['redisdb']['instances'] + logs node['datadog']['redisdb']['logs'] end diff --git a/recipes/riak.rb b/recipes/riak.rb index 65f74b7a..7e9df8c6 100644 --- a/recipes/riak.rb +++ b/recipes/riak.rb @@ -10,4 +10,5 @@ datadog_monitor 'riak' do instances node['datadog']['riak']['instances'] + logs node['datadog']['riak']['logs'] end diff --git a/recipes/snmp.rb b/recipes/snmp.rb index d6fcbda6..c6111289 100644 --- a/recipes/snmp.rb +++ b/recipes/snmp.rb @@ -112,4 +112,5 @@ datadog_monitor 'snmp' do init_config node['datadog']['snmp']['init_config'] instances node['datadog']['snmp']['instances'] + logs node['datadog']['snmp']['logs'] end diff --git a/recipes/solr.rb b/recipes/solr.rb index bf3d622d..e8673831 100644 --- a/recipes/solr.rb +++ b/recipes/solr.rb @@ -7,4 +7,5 @@ datadog_monitor 'solr' do instances node['datadog']['solr']['instances'] + logs node['datadog']['solr']['logs'] end diff --git a/recipes/sqlserver.rb b/recipes/sqlserver.rb index 920f2b47..68306b90 100644 --- a/recipes/sqlserver.rb +++ b/recipes/sqlserver.rb @@ -63,4 +63,5 @@ datadog_monitor 'sqlserver' do init_config node['datadog']['sqlserver']['init_config'] instances node['datadog']['sqlserver']['instances'] + logs node['datadog']['sqlserver']['logs'] end diff --git a/recipes/ssh_check.rb b/recipes/ssh_check.rb index 0a0e81fd..34cc3672 100644 --- a/recipes/ssh_check.rb +++ b/recipes/ssh_check.rb @@ -21,4 +21,5 @@ datadog_monitor 'ssh_check' do instances node['datadog']['ssh_check']['instances'] + logs node['datadog']['ssh_check']['logs'] end diff --git a/recipes/supervisord.rb b/recipes/supervisord.rb index b9840783..cdcb4e09 100644 --- a/recipes/supervisord.rb +++ b/recipes/supervisord.rb @@ -41,4 +41,5 @@ datadog_monitor 'supervisord' do instances node['datadog']['supervisord']['instances'] + logs node['datadog']['supervisord']['logs'] end diff --git a/recipes/tcp_check.rb b/recipes/tcp_check.rb index a1463034..1d5b9de7 100644 --- a/recipes/tcp_check.rb +++ b/recipes/tcp_check.rb @@ -15,4 +15,5 @@ datadog_monitor 'tcp_check' do instances node['datadog']['tcp_check']['instances'] + logs node['datadog']['tcp_check']['logs'] end diff --git a/recipes/tokumx.rb b/recipes/tokumx.rb index 84facba9..7e281ea1 100644 --- a/recipes/tokumx.rb +++ b/recipes/tokumx.rb @@ -11,4 +11,5 @@ datadog_monitor 'tokumx' do instances node['datadog']['tokumx']['instances'] + logs node['datadog']['tokumx']['logs'] end diff --git a/recipes/tomcat.rb b/recipes/tomcat.rb index 86a0221b..0701d1e4 100644 --- a/recipes/tomcat.rb +++ b/recipes/tomcat.rb @@ -22,4 +22,5 @@ datadog_monitor 'tomcat' do instances node['datadog']['tomcat']['instances'] + logs node['datadog']['tomcat']['logs'] end diff --git a/recipes/varnish.rb b/recipes/varnish.rb index 7e823c8e..5477d2d5 100644 --- a/recipes/varnish.rb +++ b/recipes/varnish.rb @@ -23,4 +23,5 @@ datadog_monitor 'varnish' do instances node['datadog']['varnish']['instances'] + logs node['datadog']['varnish']['logs'] end diff --git a/recipes/win32_event_log.rb b/recipes/win32_event_log.rb index 4586597f..470a8ca6 100644 --- a/recipes/win32_event_log.rb +++ b/recipes/win32_event_log.rb @@ -20,4 +20,5 @@ datadog_monitor 'win32_event_log' do init_config node['datadog']['win32_event_log']['init_config'] instances node['datadog']['win32_event_log']['instances'] + logs node['datadog']['win32_event_log']['logs'] end diff --git a/recipes/windows_service.rb b/recipes/windows_service.rb index 08a0ad6b..ae1ba459 100644 --- a/recipes/windows_service.rb +++ b/recipes/windows_service.rb @@ -57,4 +57,5 @@ datadog_monitor 'windows_service' do instances node['datadog']['windows_service']['instances'] + logs node['datadog']['windows_service']['logs'] end diff --git a/recipes/zookeeper.rb b/recipes/zookeeper.rb index 3078ab73..1145319c 100644 --- a/recipes/zookeeper.rb +++ b/recipes/zookeeper.rb @@ -7,4 +7,5 @@ datadog_monitor 'zk' do instances node['datadog']['zookeeper']['instances'] + logs node['datadog']['zookeeper']['logs'] end diff --git a/resources/monitor.rb b/resources/monitor.rb index 4837bb0f..7bb87078 100644 --- a/resources/monitor.rb +++ b/resources/monitor.rb @@ -6,10 +6,11 @@ attribute :name, :kind_of => String, :name_attribute => true attribute :cookbook, :kind_of => String, :default => 'datadog' -# checks have 2 sections: init_config and instances +# checks have 3 sections: init_config, instances, logs # we mimic these here, no validation is performed until the template # is evaluated. attribute :init_config, :kind_of => Hash, :required => false, :default => {} attribute :instances, :kind_of => Array, :required => false, :default => [] +attribute :logs, :kind_of => Array, :required => false, :default => [] attribute :version, :kind_of => Integer, :required => false, :default => nil attribute :use_integration_template, :kind_of => [TrueClass, FalseClass], :required => false, :default => false diff --git a/spec/integrations/activemq_spec.rb b/spec/integrations/activemq_spec.rb index 068bbb0c..7229a3ec 100644 --- a/spec/integrations/activemq_spec.rb +++ b/spec/integrations/activemq_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::activemq' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 1099 diff --git a/spec/integrations/cassandra_spec.rb b/spec/integrations/cassandra_spec.rb index 0e5003f0..c235d809 100644 --- a/spec/integrations/cassandra_spec.rb +++ b/spec/integrations/cassandra_spec.rb @@ -1,6 +1,7 @@ describe 'datadog::cassandra' do context 'version 1 (default)' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 7199 @@ -164,6 +165,7 @@ context 'version 2' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 7199 diff --git a/spec/integrations/couchbase_spec.rb b/spec/integrations/couchbase_spec.rb index abbfe194..2f863695 100644 --- a/spec/integrations/couchbase_spec.rb +++ b/spec/integrations/couchbase_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::couchbase' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/directory_spec.rb b/spec/integrations/directory_spec.rb index ad5ca84e..771f62b2 100644 --- a/spec/integrations/directory_spec.rb +++ b/spec/integrations/directory_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::directory' do expected_yaml = <<-EOF + logs: ~ init_config: instances: - directory: "/path/to/directory" diff --git a/spec/integrations/disk_spec.rb b/spec/integrations/disk_spec.rb index 685a1aab..5017f050 100644 --- a/spec/integrations/disk_spec.rb +++ b/spec/integrations/disk_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::disk' do expected_yaml = <<-EOF + logs: ~ init_config: ~ instances: diff --git a/spec/integrations/dns_check_spec.rb b/spec/integrations/dns_check_spec.rb index fd94194f..70ddde5d 100644 --- a/spec/integrations/dns_check_spec.rb +++ b/spec/integrations/dns_check_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::dns_check' do expected_yaml = <<-EOF + logs: ~ init_config: default_timeout: 4 diff --git a/spec/integrations/docker_daemon_spec.rb b/spec/integrations/docker_daemon_spec.rb index 4b6ab632..99bd328f 100644 --- a/spec/integrations/docker_daemon_spec.rb +++ b/spec/integrations/docker_daemon_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::docker_daemon' do expected_yaml = <<-EOF + logs: ~ init_config: docker_root: / timeout: 10 diff --git a/spec/integrations/elasticsearch_spec.rb b/spec/integrations/elasticsearch_spec.rb index b5debcda..64ed7eb2 100644 --- a/spec/integrations/elasticsearch_spec.rb +++ b/spec/integrations/elasticsearch_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::elasticsearch' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/etcd_spec.rb b/spec/integrations/etcd_spec.rb index ebf0554e..a44148bc 100644 --- a/spec/integrations/etcd_spec.rb +++ b/spec/integrations/etcd_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::etcd' do expected_yaml = <<-EOF + logs: ~ instances: - url: localhost ssl_keyfile: key_path diff --git a/spec/integrations/go-metro_spec.rb b/spec/integrations/go-metro_spec.rb index 31a5829e..d2d8cf0f 100644 --- a/spec/integrations/go-metro_spec.rb +++ b/spec/integrations/go-metro_spec.rb @@ -1,6 +1,7 @@ describe 'datadog::go-metro' do context 'with default init_config and libcap package on RHEL7' do expected_yaml = <<-EOF + logs: ~ init_config: snaplen: 512 idle_ttl: 300 @@ -91,6 +92,7 @@ context 'with modified init_config, libcap package on Ubuntu 16.04' do expected_yaml = <<-EOF + logs: ~ init_config: snaplen: 1024 idle_ttl: 300 diff --git a/spec/integrations/go_expvar_spec.rb b/spec/integrations/go_expvar_spec.rb index d3dc91c9..033144f1 100644 --- a/spec/integrations/go_expvar_spec.rb +++ b/spec/integrations/go_expvar_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::go_expvar' do expected_yaml = <<-EOF + logs: ~ init_config: ~ instances: - expvar_url: http://localhost:8080/debug/vars diff --git a/spec/integrations/gunicorn_spec.rb b/spec/integrations/gunicorn_spec.rb index 9381cb1f..92d4649d 100644 --- a/spec/integrations/gunicorn_spec.rb +++ b/spec/integrations/gunicorn_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::gunicorn' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/iis_spec.rb b/spec/integrations/iis_spec.rb index ac451999..c0df3a3e 100644 --- a/spec/integrations/iis_spec.rb +++ b/spec/integrations/iis_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::iis' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/integrations_spec.rb b/spec/integrations/integrations_spec.rb index e09e7a25..9f178f85 100644 --- a/spec/integrations/integrations_spec.rb +++ b/spec/integrations/integrations_spec.rb @@ -3,6 +3,7 @@ instances: - url: 'http://localhost:22222' init_config: ~ + logs: ~ EOF cached(:chef_run) do diff --git a/spec/integrations/jmx_spec.rb b/spec/integrations/jmx_spec.rb index 4da9096e..e0c83eb7 100644 --- a/spec/integrations/jmx_spec.rb +++ b/spec/integrations/jmx_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::jmx' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/kafka_spec.rb b/spec/integrations/kafka_spec.rb index 6af14f93..592768ef 100644 --- a/spec/integrations/kafka_spec.rb +++ b/spec/integrations/kafka_spec.rb @@ -1,6 +1,7 @@ describe 'datadog::kafka' do context 'version 1 (default)' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 7199 @@ -191,6 +192,7 @@ context 'version 2' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 7199 diff --git a/spec/integrations/kubernetes_spec.rb b/spec/integrations/kubernetes_spec.rb index 6dcf9bbf..4848807b 100644 --- a/spec/integrations/kubernetes_spec.rb +++ b/spec/integrations/kubernetes_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::kubernetes' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 4194 diff --git a/spec/integrations/mongo_spec.rb b/spec/integrations/mongo_spec.rb index 0a565959..8150d344 100644 --- a/spec/integrations/mongo_spec.rb +++ b/spec/integrations/mongo_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::mongo' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/nginx_spec.rb b/spec/integrations/nginx_spec.rb index b609ac42..5df47486 100644 --- a/spec/integrations/nginx_spec.rb +++ b/spec/integrations/nginx_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::nginx' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/php_fpm_spec.rb b/spec/integrations/php_fpm_spec.rb index 427b9c76..572fb08b 100644 --- a/spec/integrations/php_fpm_spec.rb +++ b/spec/integrations/php_fpm_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::php_fpm' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/postfix_spec.rb b/spec/integrations/postfix_spec.rb index 089e1a70..ff85c31f 100644 --- a/spec/integrations/postfix_spec.rb +++ b/spec/integrations/postfix_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::postfix' do expected_yaml = <<-EOF + logs: ~ instances: - directory: /var/spool/postfix queues: diff --git a/spec/integrations/postgres_spec.rb b/spec/integrations/postgres_spec.rb index 0b066516..2c92a954 100644 --- a/spec/integrations/postgres_spec.rb +++ b/spec/integrations/postgres_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::postgres' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 5432 @@ -110,6 +111,7 @@ describe 'datadog::postgres' do context 'default settings' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 5432 @@ -152,6 +154,7 @@ context 'relations' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 5432 @@ -206,6 +209,7 @@ context 'descriptors' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 5432 diff --git a/spec/integrations/rabbitmq_spec.rb b/spec/integrations/rabbitmq_spec.rb index f4feb3cc..4782af02 100644 --- a/spec/integrations/rabbitmq_spec.rb +++ b/spec/integrations/rabbitmq_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::rabbitmq' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/redis_spec.rb b/spec/integrations/redis_spec.rb index dd6d7ce4..6d55e83d 100644 --- a/spec/integrations/redis_spec.rb +++ b/spec/integrations/redis_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::redisdb' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/snmp_spec.rb b/spec/integrations/snmp_spec.rb index 35df2092..5dc5d078 100644 --- a/spec/integrations/snmp_spec.rb +++ b/spec/integrations/snmp_spec.rb @@ -44,6 +44,7 @@ metric_tags: - tag: ipversion index: 1 + logs: ~ EOF cached(:chef_run) do @@ -168,6 +169,7 @@ symbol: udpInDatagrams - MIB: TCP-MIB symbol: tcpActiveOpens + logs: ~ EOF cached(:chef_run) do diff --git a/spec/integrations/solr_spec.rb b/spec/integrations/solr_spec.rb index 754cfd2d..068b28e9 100644 --- a/spec/integrations/solr_spec.rb +++ b/spec/integrations/solr_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::solr' do expected_yaml = <<-EOF + logs: ~ instances: - host: localhost port: 9999 diff --git a/spec/integrations/sqlserver_spec.rb b/spec/integrations/sqlserver_spec.rb index 4d5db908..46f18656 100644 --- a/spec/integrations/sqlserver_spec.rb +++ b/spec/integrations/sqlserver_spec.rb @@ -1,6 +1,7 @@ describe 'datadog::sqlserver' do context 'config 1' do expected_yaml = <<-EOF + logs: ~ init_config: custom_metrics: - name: sqlserver.clr.execution @@ -86,6 +87,7 @@ context 'config 2' do expected_yaml = <<-EOF init_config: ~ + logs: ~ instances: - host: fakehostname,1433 diff --git a/spec/integrations/system_core_spec.rb b/spec/integrations/system_core_spec.rb index c8b37347..fb2f9b56 100644 --- a/spec/integrations/system_core_spec.rb +++ b/spec/integrations/system_core_spec.rb @@ -2,6 +2,8 @@ expected_yaml = <<-EOF # Generated by Chef, local modifications will be overwritten + logs: [] + init_config: instances: diff --git a/spec/integrations/system_swap_spec.rb b/spec/integrations/system_swap_spec.rb index 21428f91..79ff31e0 100644 --- a/spec/integrations/system_swap_spec.rb +++ b/spec/integrations/system_swap_spec.rb @@ -3,6 +3,8 @@ # Generated by Chef, local modifications will be overwritten # This check takes no initial configuration + logs: [] + init_config: instances: diff --git a/spec/integrations/tokumx_spec.rb b/spec/integrations/tokumx_spec.rb index 4bf83417..58f2da0e 100644 --- a/spec/integrations/tokumx_spec.rb +++ b/spec/integrations/tokumx_spec.rb @@ -1,5 +1,6 @@ describe 'datadog::tokumx' do expected_yaml = <<-EOF + logs: ~ init_config: instances: diff --git a/spec/integrations/win32_event_log_spec.rb b/spec/integrations/win32_event_log_spec.rb index 53dac684..225e8c54 100644 --- a/spec/integrations/win32_event_log_spec.rb +++ b/spec/integrations/win32_event_log_spec.rb @@ -3,6 +3,7 @@ init_config: tag_event_id: yes + logs: ~ instances: - log_file: - Application diff --git a/spec/integrations/windows_service_spec.rb b/spec/integrations/windows_service_spec.rb index 29e517c8..296a2eff 100644 --- a/spec/integrations/windows_service_spec.rb +++ b/spec/integrations/windows_service_spec.rb @@ -8,6 +8,7 @@ - RemoteService1 - RemoteService2 + logs: ~ init_config: EOF @@ -56,6 +57,7 @@ - LocalService2 init_config: + logs: ~ EOF diff --git a/templates/default/activemq.yaml.erb b/templates/default/activemq.yaml.erb index 98b88062..6b001e0e 100644 --- a/templates/default/activemq.yaml.erb +++ b/templates/default/activemq.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # List of metrics to be collected by the integration # You should not have to modify this. diff --git a/templates/default/apache.yaml.erb b/templates/default/apache.yaml.erb index a4abdcfe..6af28d1a 100644 --- a/templates/default/apache.yaml.erb +++ b/templates/default/apache.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - apache_status_url: <%= i['status_url'] %> diff --git a/templates/default/cacti.yaml.erb b/templates/default/cacti.yaml.erb index 1871c668..1a73bb39 100644 --- a/templates/default/cacti.yaml.erb +++ b/templates/default/cacti.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - mysql_host: <%= i['mysql_host'] %> diff --git a/templates/default/cassandra.yaml.erb b/templates/default/cassandra.yaml.erb index d491723d..daf91319 100644 --- a/templates/default/cassandra.yaml.erb +++ b/templates/default/cassandra.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i['server'] || i['host'] %> diff --git a/templates/default/consul.yaml.erb b/templates/default/consul.yaml.erb index 6faa0ad3..345bb875 100644 --- a/templates/default/consul.yaml.erb +++ b/templates/default/consul.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i['url'] %> diff --git a/templates/default/couch.yaml.erb b/templates/default/couch.yaml.erb index ea2ac05d..d4987a07 100644 --- a/templates/default/couch.yaml.erb +++ b/templates/default/couch.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: <%= i['server'] %> diff --git a/templates/default/couchbase.yaml.erb b/templates/default/couchbase.yaml.erb index 9d381159..4010a711 100644 --- a/templates/default/couchbase.yaml.erb +++ b/templates/default/couchbase.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({ 'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: <%= i['server'] %> diff --git a/templates/default/datadog.yaml.erb b/templates/default/datadog.yaml.erb index 6dd96d03..8d995bc7 100644 --- a/templates/default/datadog.yaml.erb +++ b/templates/default/datadog.yaml.erb @@ -78,7 +78,10 @@ agent_config = @extra_config.merge({ histogram_percentiles: string_list_to_array(node['datadog']['histogram_percentiles']), # TODO: check that the value works with agent6 use_dogstatsd: node['datadog']['dogstatsd'], log_level: node['datadog']['log_level'], # TODO: make sure it's a seelog-compatible log level - log_file: ::File.join(node['datadog']['log_file_directory'], "agent.log") + log_file: ::File.join(node['datadog']['log_file_directory'], "agent.log"), + + # log agent options + log_enabled: node['datadog']['enable_logs_agent'] }) if node['datadog']['use_v2_api'] diff --git a/templates/default/directory.yaml.erb b/templates/default/directory.yaml.erb index 9569422b..26413d4f 100644 --- a/templates/default/directory.yaml.erb +++ b/templates/default/directory.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - directory: "<%= i['directory'] %>" diff --git a/templates/default/disk.yaml.erb b/templates/default/disk.yaml.erb index 0a47c395..70a04547 100644 --- a/templates/default/disk.yaml.erb +++ b/templates/default/disk.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config, 'logs' => @logs }).to_json).to_yaml %> diff --git a/templates/default/dns_check.yaml.erb b/templates/default/dns_check.yaml.erb index a5198850..62207e78 100644 --- a/templates/default/dns_check.yaml.erb +++ b/templates/default/dns_check.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - hostname: <%= i["hostname"] %> diff --git a/templates/default/docker.yaml.erb b/templates/default/docker.yaml.erb index 03b15149..3b2d3b1e 100644 --- a/templates/default/docker.yaml.erb +++ b/templates/default/docker.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: <% if @init_config %> diff --git a/templates/default/docker_daemon.yaml.erb b/templates/default/docker_daemon.yaml.erb index 32812bc0..1b3b8c08 100644 --- a/templates/default/docker_daemon.yaml.erb +++ b/templates/default/docker_daemon.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> diff --git a/templates/default/elastic.yaml.erb b/templates/default/elastic.yaml.erb index 0aef3ad9..37e077e2 100644 --- a/templates/default/elastic.yaml.erb +++ b/templates/default/elastic.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i["url"] %> diff --git a/templates/default/etcd.yaml.erb b/templates/default/etcd.yaml.erb index 5c359a51..8473daa4 100644 --- a/templates/default/etcd.yaml.erb +++ b/templates/default/etcd.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i['url'] %> diff --git a/templates/default/fluentd.yaml.erb b/templates/default/fluentd.yaml.erb index 9600bb80..f09867a7 100644 --- a/templates/default/fluentd.yaml.erb +++ b/templates/default/fluentd.yaml.erb @@ -1,4 +1,4 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/templates/default/go-metro.yaml.erb b/templates/default/go-metro.yaml.erb index 6ea38f80..7351b887 100644 --- a/templates/default/go-metro.yaml.erb +++ b/templates/default/go-metro.yaml.erb @@ -1,4 +1,4 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs}).to_json).to_yaml %> diff --git a/templates/default/go_expvar.yaml.erb b/templates/default/go_expvar.yaml.erb index 32812bc0..1b3b8c08 100644 --- a/templates/default/go_expvar.yaml.erb +++ b/templates/default/go_expvar.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> diff --git a/templates/default/gunicorn.yaml.erb b/templates/default/gunicorn.yaml.erb index 94c65e0e..2b40a714 100644 --- a/templates/default/gunicorn.yaml.erb +++ b/templates/default/gunicorn.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - proc_name: <%= i['proc_name'] %> diff --git a/templates/default/haproxy.yaml.erb b/templates/default/haproxy.yaml.erb index 7636be0a..1afb3916 100644 --- a/templates/default/haproxy.yaml.erb +++ b/templates/default/haproxy.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + <% excluded_keys = ["url", "username", "password"] -%> instances: <% @instances.each do |i| -%> diff --git a/templates/default/hdfs.yaml.erb b/templates/default/hdfs.yaml.erb index 9a16c5a5..9643fb11 100644 --- a/templates/default/hdfs.yaml.erb +++ b/templates/default/hdfs.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # Each instance requires a namenode hostname. # Port defaults to 8020. instances: diff --git a/templates/default/http_check.yaml.erb b/templates/default/http_check.yaml.erb index af4872f1..5f39a4d5 100644 --- a/templates/default/http_check.yaml.erb +++ b/templates/default/http_check.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/templates/default/iis.yaml.erb b/templates/default/iis.yaml.erb index 7942b422..8176b70c 100644 --- a/templates/default/iis.yaml.erb +++ b/templates/default/iis.yaml.erb @@ -8,6 +8,8 @@ # instance per host. Note: If you also want to check the counters on the # current machine, you will have to create an instance with empty params. +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> <% if i['host'] == 'localhost' -%> diff --git a/templates/default/integration.yaml.erb b/templates/default/integration.yaml.erb index 0a47c395..70a04547 100644 --- a/templates/default/integration.yaml.erb +++ b/templates/default/integration.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config, 'logs' => @logs }).to_json).to_yaml %> diff --git a/templates/default/jenkins.yaml.erb b/templates/default/jenkins.yaml.erb index e9274568..3f81fdfd 100644 --- a/templates/default/jenkins.yaml.erb +++ b/templates/default/jenkins.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - name: <%= i['name'] %> diff --git a/templates/default/jmx.yaml.erb b/templates/default/jmx.yaml.erb index af4872f1..5f39a4d5 100644 --- a/templates/default/jmx.yaml.erb +++ b/templates/default/jmx.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/templates/default/kafka.yaml.erb b/templates/default/kafka.yaml.erb index 1153a001..45bb4ef3 100644 --- a/templates/default/kafka.yaml.erb +++ b/templates/default/kafka.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i['host'] %> diff --git a/templates/default/kafka_consumer.yaml.erb b/templates/default/kafka_consumer.yaml.erb index 8489eead..68c6d23b 100644 --- a/templates/default/kafka_consumer.yaml.erb +++ b/templates/default/kafka_consumer.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - kafka_connect_str: <%= i['kafka_connect_str'] %> diff --git a/templates/default/kubernetes.yaml.erb b/templates/default/kubernetes.yaml.erb index 9600bb80..f09867a7 100644 --- a/templates/default/kubernetes.yaml.erb +++ b/templates/default/kubernetes.yaml.erb @@ -1,4 +1,4 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/templates/default/kyototycoon.yaml.erb b/templates/default/kyototycoon.yaml.erb index d7adf234..3d9caa30 100644 --- a/templates/default/kyototycoon.yaml.erb +++ b/templates/default/kyototycoon.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # Add one or more instances, which accept report_url, # name, and optionally tags keys. The report URL should # be a URL to the Kyoto Tycoon "report" RPC endpoint. diff --git a/templates/default/lighttpd.yaml.erb b/templates/default/lighttpd.yaml.erb index 4315d7f0..e2ab2f02 100644 --- a/templates/default/lighttpd.yaml.erb +++ b/templates/default/lighttpd.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - lighttpd_status_url: <%= i['status_url'] %> diff --git a/templates/default/mcache.yaml.erb b/templates/default/mcache.yaml.erb index 33693ac7..c64cca96 100644 --- a/templates/default/mcache.yaml.erb +++ b/templates/default/mcache.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i['url'] %> diff --git a/templates/default/mesos.yaml.erb b/templates/default/mesos.yaml.erb index 290db592..88097d78 100644 --- a/templates/default/mesos.yaml.erb +++ b/templates/default/mesos.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: <% if @init_config.key?('default_timeout') -%> diff --git a/templates/default/mongo.yaml.erb b/templates/default/mongo.yaml.erb index cf00897e..cd45bae7 100644 --- a/templates/default/mongo.yaml.erb +++ b/templates/default/mongo.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: mongodb://<%= i['host']%>:<%= i['port'] %> @@ -29,4 +31,5 @@ instances: <% end -%> init_config: -# No init_config details needed \ No newline at end of file +# No init_config details needed + diff --git a/templates/default/mysql.yaml.erb b/templates/default/mysql.yaml.erb index 65c779ef..e7cc4672 100644 --- a/templates/default/mysql.yaml.erb +++ b/templates/default/mysql.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: <%= i['server'] %> diff --git a/templates/default/network.yaml.erb b/templates/default/network.yaml.erb index a97b1212..8646ba6c 100644 --- a/templates/default/network.yaml.erb +++ b/templates/default/network.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + init_config: # Network check supports only one configured instance diff --git a/templates/default/nginx.yaml.erb b/templates/default/nginx.yaml.erb index 252beb8a..bda9413a 100644 --- a/templates/default/nginx.yaml.erb +++ b/templates/default/nginx.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - nginx_status_url: <%= i['nginx_status_url'] %> diff --git a/templates/default/ntp.yaml.erb b/templates/default/ntp.yaml.erb index af4872f1..5f39a4d5 100644 --- a/templates/default/ntp.yaml.erb +++ b/templates/default/ntp.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/templates/default/pgbouncer.yaml.erb b/templates/default/pgbouncer.yaml.erb index 511b75ee..d6f4ae3c 100644 --- a/templates/default/pgbouncer.yaml.erb +++ b/templates/default/pgbouncer.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/templates/default/php_fpm.yaml.erb b/templates/default/php_fpm.yaml.erb index a90a865b..c4b509c7 100644 --- a/templates/default/php_fpm.yaml.erb +++ b/templates/default/php_fpm.yaml.erb @@ -1,4 +1,4 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # nothing to add here diff --git a/templates/default/postfix.yaml.erb b/templates/default/postfix.yaml.erb index fd2bf6a5..ead1e879 100644 --- a/templates/default/postfix.yaml.erb +++ b/templates/default/postfix.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # Each instance requires a directory and an array of queues. # Tags are optional. instances: diff --git a/templates/default/postgres.yaml.erb b/templates/default/postgres.yaml.erb index 3f5935b6..0ad4a4f0 100644 --- a/templates/default/postgres.yaml.erb +++ b/templates/default/postgres.yaml.erb @@ -15,7 +15,7 @@ instance['port'] = 5432 if instance['port'].nil? end -%> -<%= JSON.parse(({'instances' => instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/templates/default/process.yaml.erb b/templates/default/process.yaml.erb index 6095215e..6d65c5a2 100644 --- a/templates/default/process.yaml.erb +++ b/templates/default/process.yaml.erb @@ -1,3 +1,3 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: \ No newline at end of file diff --git a/templates/default/rabbitmq.yaml.erb b/templates/default/rabbitmq.yaml.erb index a5c984ca..b6f9f59c 100644 --- a/templates/default/rabbitmq.yaml.erb +++ b/templates/default/rabbitmq.yaml.erb @@ -1,4 +1,5 @@ # Generated by Chef, local modifications will be overwritten +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> instances: # for every instance a 'rabbitmq_api_url' must be provided, pointing to the api diff --git a/templates/default/redisdb.yaml.erb b/templates/default/redisdb.yaml.erb index af341a8f..706064bc 100644 --- a/templates/default/redisdb.yaml.erb +++ b/templates/default/redisdb.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> <% if i.key?("unix_socket_path") -%> diff --git a/templates/default/riak.yaml.erb b/templates/default/riak.yaml.erb index df59a292..9f5f1958 100644 --- a/templates/default/riak.yaml.erb +++ b/templates/default/riak.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i["url"] %> diff --git a/templates/default/snmp.yaml.erb b/templates/default/snmp.yaml.erb index 72abd894..11b348e0 100644 --- a/templates/default/snmp.yaml.erb +++ b/templates/default/snmp.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs}).to_json).to_yaml %> diff --git a/templates/default/solr.yaml.erb b/templates/default/solr.yaml.erb index 742e222d..f4e6cd90 100644 --- a/templates/default/solr.yaml.erb +++ b/templates/default/solr.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # List of metrics to be collected by the integration # Read http://docs.datadoghq.com/integrations/java/ to learn how to customize it diff --git a/templates/default/sqlserver.yaml.erb b/templates/default/sqlserver.yaml.erb index 72abd894..e44ccc5f 100644 --- a/templates/default/sqlserver.yaml.erb +++ b/templates/default/sqlserver.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> diff --git a/templates/default/ssh_check.yaml.erb b/templates/default/ssh_check.yaml.erb index 02b048d3..daf37dbc 100644 --- a/templates/default/ssh_check.yaml.erb +++ b/templates/default/ssh_check.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i['host'] %> diff --git a/templates/default/supervisord.yaml.erb b/templates/default/supervisord.yaml.erb index 7ea0666b..ab6c4d5b 100644 --- a/templates/default/supervisord.yaml.erb +++ b/templates/default/supervisord.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/templates/default/system_core.yaml.erb b/templates/default/system_core.yaml.erb index 6857cc4c..5f7e3d4c 100644 --- a/templates/default/system_core.yaml.erb +++ b/templates/default/system_core.yaml.erb @@ -1,4 +1,5 @@ # Generated by Chef, local modifications will be overwritten +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> init_config: diff --git a/templates/default/system_swap.yaml.erb b/templates/default/system_swap.yaml.erb index 8ac3de8b..489e2bb4 100644 --- a/templates/default/system_swap.yaml.erb +++ b/templates/default/system_swap.yaml.erb @@ -1,5 +1,7 @@ # Generated by Chef, local modifications will be overwritten +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # This check takes no initial configuration init_config: diff --git a/templates/default/tcp_check.yaml.erb b/templates/default/tcp_check.yaml.erb index af4872f1..5f39a4d5 100644 --- a/templates/default/tcp_check.yaml.erb +++ b/templates/default/tcp_check.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/templates/default/tokumx.yaml.erb b/templates/default/tokumx.yaml.erb index cf00897e..a7fbcb3a 100644 --- a/templates/default/tokumx.yaml.erb +++ b/templates/default/tokumx.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({ 'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: mongodb://<%= i['host']%>:<%= i['port'] %> @@ -29,4 +31,4 @@ instances: <% end -%> init_config: -# No init_config details needed \ No newline at end of file +# No init_config details needed diff --git a/templates/default/tomcat.yaml.erb b/templates/default/tomcat.yaml.erb index c4bfaa0e..17f4c729 100644 --- a/templates/default/tomcat.yaml.erb +++ b/templates/default/tomcat.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i["server"] %> diff --git a/templates/default/varnish.yaml.erb b/templates/default/varnish.yaml.erb index cadc60f0..512bbce5 100644 --- a/templates/default/varnish.yaml.erb +++ b/templates/default/varnish.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - varnishstat: <%= i["varnishstat"] || "/usr/bin/varnishstat" %> diff --git a/templates/default/win32_event_log.yaml.erb b/templates/default/win32_event_log.yaml.erb index 72abd894..11b348e0 100644 --- a/templates/default/win32_event_log.yaml.erb +++ b/templates/default/win32_event_log.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs}).to_json).to_yaml %> diff --git a/templates/default/windows_service.yaml.erb b/templates/default/windows_service.yaml.erb index 7ea0666b..ab6c4d5b 100644 --- a/templates/default/windows_service.yaml.erb +++ b/templates/default/windows_service.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/templates/default/wmi_check.yaml.erb b/templates/default/wmi_check.yaml.erb index 70ebf5e5..a80c523a 100644 --- a/templates/default/wmi_check.yaml.erb +++ b/templates/default/wmi_check.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + init_config: instances: diff --git a/templates/default/zk.yaml.erb b/templates/default/zk.yaml.erb index 382e3c4e..c5ee8f83 100644 --- a/templates/default/zk.yaml.erb +++ b/templates/default/zk.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + <% excluded_keys = ["host", "port", "timeout", "tags"] -%> instances: <% @instances.each do |instance| -%>