Split plugins
diff --git a/collectd/client.sls b/collectd/client.sls
index 9b93af6..3e6c456 100644
--- a/collectd/client.sls
+++ b/collectd/client.sls
@@ -55,13 +55,19 @@
   file.recurse:
   - source: salt://collectd/files/plugin
 
-{%- set service_grains = {'collectd': {'plugin': {}}} %}
+{%- set service_grains = {'collectd': {'remote_plugin': {}, 'local_plugin': {}}} %}
+
 {%- for service_name, service in pillar.items() %}
 {%- if service.get('_support', {}).get('collectd', {}).get('enabled', False) %}
+
 {%- set grains_fragment_file = service_name+'/meta/collectd.yml' %}
-{%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %}
+{%- macro load_grains_file() %}{% include grains_fragment_file ignore missing %}{% endmacro %}
 {%- set grains_yaml = load_grains_file()|load_yaml %}
-{%- set _dummy = service_grains.collectd.plugin.update(grains_yaml.plugin) %}
+
+{%- if grains_yaml is mapping %}
+{%- set service_grains = salt['grains.filter_by']({'default': {'collectd': service_grains}}, merge=grains_yaml) %}
+{%- endif %}
+
 {%- endif %}
 {%- endfor %}
 
@@ -86,7 +92,7 @@
   - watch:
     - file: collectd_client_grain
 
-{%- for plugin_name, plugin in service_grains.collectd.plugin.iteritems() %}
+{%- for plugin_name, plugin in service_grains.collectd.local_plugin.iteritems() %}
 
 {%- if (plugin.get('execution', 'local') == 'local' or client.remote_collector) and plugin.get('plugin', 'native') not in ['python'] %}
 
diff --git a/collectd/files/collectd_check_local_endpoint.conf b/collectd/files/collectd_check_local_endpoint.conf
index 4144e96..b154564 100644
--- a/collectd/files/collectd_check_local_endpoint.conf
+++ b/collectd/files/collectd_check_local_endpoint.conf
@@ -1,6 +1,4 @@
-
 {%- if plugin.get('endpoint', {})|length > 0 %}
-
 Import "check_local_endpoint"
 
 <Module "check_local_endpoint">
@@ -13,5 +11,4 @@
   Url "{{ endpoint_name }}" "{{ endpoint.url }}"
   {%- endfor %}
 </Module>
-
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/collectd/meta/collectd.yml b/collectd/meta/collectd.yml
index 98d6ee1..a529942 100644
--- a/collectd/meta/collectd.yml
+++ b/collectd/meta/collectd.yml
@@ -1,30 +1,24 @@
-plugin:
+local_plugin:
   collectd_processes:
     plugin: processes
-    execution: local
     template: collectd/files/collectd_processes.conf
     process:
       collectdmon: {}
-  collectd_check_local_endpoint:
-    plugin: python
-    execution: local
-    template: collectd/files/collectd_check_local_endpoint.conf
-    endpoint: {}
-{%- if pillar.collectd.client.get('check', {}).curl is defined %}
+  {%- if pillar.collectd.client.get('check', {}).curl is defined %}
   collectd_curl:
     plugin: curl
     execution: local
     template: collectd/files/collectd_curl.conf
     data: {{ pillar.collectd.client.check.curl|yaml }}
-{%- endif %}
-{%- if pillar.collectd.client.get('check', {}).ping is defined %}
+  {%- endif %}
+  {%- if pillar.collectd.client.get('check', {}).ping is defined %}
   collectd_ping:
     plugin: ping
     execution: local
     template: collectd/files/collectd_ping.conf
     data: {{ pillar.collectd.client.check.ping|yaml }}
-{%- endif %}
-{%- if pillar.get('external', {}).network_device is defined %}
+  {%- endif %}
+  {%- if pillar.get('external', {}).network_device is defined %}
   collectd_network_device:
     plugin: snmp
     execution: local
@@ -45,4 +39,10 @@
         - 1.3.6.1.2.1.31.1.1.1.7
         - 1.3.6.1.2.1.31.1.1.1.11
     host: {{ pillar.external.network_device|yaml }}
-{%- endif %}
\ No newline at end of file
+  {%- endif %}
+remote_plugin:
+  collectd_check_local_endpoint:
+    plugin: python
+    execution: remote
+    template: collectd/files/collectd_check_local_endpoint.conf
+    endpoint: {}