Merge pull request #8 from tcpcloud/collectd_update

Global collectd update
diff --git a/linux/files/collectd_df.conf b/linux/files/collectd_df.conf
index b7ac768..c0460eb 100644
--- a/linux/files/collectd_df.conf
+++ b/linux/files/collectd_df.conf
@@ -1,9 +1,10 @@
-LoadPlugin df
+<LoadPlugin df>
+  Globals false
+</LoadPlugin>
+
 <Plugin df>
   {%- for fs_type in plugin.get('fs_types', []) %}
   FSType {{ fs_type }}
   {%- endfor %}
-  {%- if plugin.get('ignore_selected', False) %}
-  IgnoreSelected true
-  {%- endif %}
+  IgnoreSelected {{ plugin.get('ignore_selected', False)|lower }}
 </Plugin>
diff --git a/linux/files/collectd_disk.conf b/linux/files/collectd_disk.conf
index 50c5288..4dac534 100644
--- a/linux/files/collectd_disk.conf
+++ b/linux/files/collectd_disk.conf
@@ -1,6 +1,7 @@
-LoadPlugin disk
+<LoadPlugin disk>
+  Globals false
+</LoadPlugin>
+
 <Plugin disk>
-  {%- if plugin.get('ignore_selected', False) %}
-  IgnoreSelected true
-  {%- endif %}
+  IgnoreSelected {{ plugin.get('ignore_selected', True)|lower }}
 </Plugin>
diff --git a/linux/meta/collectd.yml b/linux/meta/collectd.yml
index 8c0382a..e40f45a 100644
--- a/linux/meta/collectd.yml
+++ b/linux/meta/collectd.yml
@@ -1,33 +1,33 @@
 plugin:
   linux_network_interface:
     plugin: interface
-    interval: 60
+    execution: local
   linux_system_cpu:
     plugin: cpu
-    interval: 60
+    execution: local
   linux_system_entropy:
     plugin: entropy
-    interval: 60
+    execution: local
   linux_system_load:
     plugin: load
-    interval: 60
+    execution: local
   linux_system_contextswitch:
     plugin: contextswitch
-    interval: 60
+    execution: local
   linux_system_memory:
     plugin: memory
-    interval: 60
+    execution: local
   linux_system_uptime:
     plugin: uptime
-    interval: 60
+    execution: local
   linux_system_users:
     plugin: users
-    interval: 60
+    execution: local
   linux_storage_df:
     plugin: df
-    interval: 60
+    execution: local
     template: linux/files/collectd_df.conf
-    ignore_selected: true
+    ignore_selected: True
     fs_types:
     - rootfs
     - sysfs
@@ -39,9 +39,9 @@
     - cgroup
   linux_storage_disk:
     plugin: disk
-    interval: 60
+    execution: local
     template: linux/files/collectd_disk.conf
-    ignore_selected: true
+    ignore_selected: True
   linux_storage_swap:
     plugin: swap
-    interval: 60
+    execution: local
diff --git a/linux/meta/heka.yml b/linux/meta/heka.yml
index 7157ca3..52ebf36 100644
--- a/linux/meta/heka.yml
+++ b/linux/meta/heka.yml
@@ -1,19 +1,68 @@
-input:
-  linux_rsyslog_syslog:
-    engine: logstreamer
-    log_directory: /var/log
-    file_match: syslog\.?(?P<Index>\d+)?(.gz)?
-    priority: ["^Index"]
-    decoder: RsyslogDecoder
-  linux_rsyslog_auth:
-    engine: logstreamer
-    log_directory: /var/log
-    file_match: auth\.log\.?(?P<Index>\d+)?(.gz)?
-    priority: ["^Index"]
-    decoder: RsyslogDecoder
-  linux_rsyslog_kern:
-    engine: logstreamer
-    log_directory: /var/log
-    file_match: kern\.log\.?(?P<Index>\d+)?(.gz)?
-    priority: ["^Index"]
-    decoder: RsyslogDecoder
+log_collector:
+  decoder:
+    linux_syslog:
+      engine: sandbox
+      module_file: /usr/share/lma_collector/decoders/generic_syslog.lua
+      module_dir: /usr/share/lma_collector_modules;/usr/share/heka/lua_modules
+      config:
+        syslog_pattern: '<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n'
+        fallback_syslog_pattern: '%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n'
+  input:
+    linux_log_stream:
+      engine: logstreamer
+      log_directory: "/var/log"
+      file_match: '(?P<Service>daemon\.log|cron\.log|haproxy\.log|kern\.log|auth\.log|syslog|messages|debug)'
+      differentiator: [ 'system.', 'Service' ]
+      decoder: "system_decoder"
+      splitter: "TokenSplitter"
+  filter:
+    linux_hdd_errors:
+      engine: sandbox
+      module_file: /usr/share/lma_collector/filters/hdd_errors_counter.lua
+      module_dir: /usr/share/lma_collector_modules;/usr/share/heka/lua_modules
+      preserve_data: false
+      message_matcher: "Type == 'log' && Logger == 'system.kern'"
+      ticker_interval: 10
+      config:
+        grace_interval: 10
+        patterns: "/error%s.+([sv]d[a-z][a-z]?)%d?/ /([sv]d[a-z][a-z]?)%d?.+%serror/"
+    linux_logs_counter:
+      engine: sandbox
+      module_file: /usr/share/lma_collector/filters/logs_counter.lua
+      module_dir: /usr/share/lma_collector_modules;/usr/share/heka/lua_modules
+      preserve_data: true
+      message_matcher: "Type == 'log' && Logger =~ /^openstack\\\\./"
+      ticker_interval: 1
+      config:
+        interval: 60
+        grace_interval: 30
+metric_collector:
+  filter:
+    linux_cpu_utilization:
+      engine: sandbox
+      module_file: /usr/share/lma_collector/filters/afd.lua
+      module_dir: /usr/share/lma_collector_modules;/usr/share/heka/lua_modules
+      preserve_data: false
+      message_matcher: "(Type == 'metric' || Type == 'heka.sandbox.metric') && (Fields[name] == 'cpu_idle' || Fields[name] == 'cpu_wait')"
+      ticker_interval: 10
+      config:
+        afd_type: 'node'
+        afd_file: 'lma_alarms_controller_cpu'
+        afd_cluster_name: 'controller'
+        afd_logical_name: 'cpu'
+        activate_alerting: true
+        enable_notification: false
+    linux_swap_utilization:
+      engine: sandbox
+      module_file: /usr/share/lma_collector/filters/afd.lua
+      module_dir: /usr/share/lma_collector_modules;/usr/share/heka/lua_modules
+      preserve_data: false
+      message_matcher: "(Type == 'metric' || Type == 'heka.sandbox.metric') && (Fields[name] == 'swap_free' || Fields[name] == 'swap_io_in' || Fields[name] == 'swap_io_out' || Fields[name] == 'swap_percent_used')"
+      ticker_interval: 10
+      config:
+        afd_type: 'node'
+        afd_file: 'lma_alarms_controller_swap'
+        afd_cluster_name: 'controller'
+        afd_logical_name: 'swap'
+        activate_alerting: true
+        enable_notification: false
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 55cb43b..cc40765 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -4,7 +4,7 @@
       collectd:
         enabled: true
       heka:
-        enabled: false
+        enabled: true
       sensu:
         enabled: true
       sphinx: