diff --git a/xos/PassiveTest-onboard.yaml b/xos/PassiveTest-onboard.yaml
new file mode 100644
index 0000000..5b29c3d
--- /dev/null
+++ b/xos/PassiveTest-onboard.yaml
@@ -0,0 +1,26 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Onboard the PassiveTest
+
+imports:
+   - custom_types/xos.yaml
+
+topology_template:
+  node_templates:
+    passivetest:
+      type: tosca.nodes.ServiceController
+      properties:
+          base_url: file:///opt/xos_services/PassiveTest/xos/
+          # The following will concatenate with base_url automatically, if
+          # base_url is non-null.
+          models: models.py
+          admin: admin.py
+          synchronizer: synchronizer/manifest
+          synchronizer_run: passivetest-synchronizer.py
+          tosca_custom_types: PassiveTest.yaml
+          tosca_resource: tosca/resources/passivetest.py, tosca/resources/passivetesttenant.py
+          rest_service: api/service/passivetest.py
+          rest_tenant: api/tenant/passivetesttenant.py
+          private_key: file:///opt/xos/key_import/passivetest_rsa
+          public_key: file:///opt/xos/key_import/passivetest_rsa.pub
+
diff --git a/xos/PassiveTest.m4 b/xos/PassiveTest.m4
new file mode 100644
index 0000000..a477bd4
--- /dev/null
+++ b/xos/PassiveTest.m4
@@ -0,0 +1,31 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+# compile this with "m4 PassiveTest.m4 > PassiveTest.yaml"
+
+# include macros
+include(macros.m4)
+
+node_types:
+    tosca.nodes.PassiveTest:
+        derived_from: tosca.nodes.Root
+        description: >
+            PassiveTest Service
+        capabilities:
+            xos_base_service_caps
+        properties:
+            xos_base_props
+            xos_base_service_props
+            tap_ports:
+               type: string
+               required: false
+            reset_viv:
+               type: boolean
+               required: false
+
+    tosca.nodes.PassiveTestTenant:
+        derived_from: tosca.nodes.Root
+        description: >
+            A Tenant of the PassiveTest service
+        properties:
+            xos_base_tenant_props
+
diff --git a/xos/PassiveTest.yaml b/xos/PassiveTest.yaml
new file mode 100644
index 0000000..d3eb368
--- /dev/null
+++ b/xos/PassiveTest.yaml
@@ -0,0 +1,101 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+# compile this with "m4 PassiveTest.m4 > PassiveTest.yaml"
+
+# include macros
+# Note: Tosca derived_from isn't working the way I think it should, it's not
+#    inheriting from the parent template. Until we get that figured out, use
+#    m4 macros do our inheritance
+
+
+# Service
+
+
+# Subscriber
+
+
+
+
+# end m4 macros
+
+
+
+node_types:
+    tosca.nodes.PassiveTest:
+        derived_from: tosca.nodes.Root
+        description: >
+            PassiveTest Service
+        capabilities:
+            scalable:
+                type: tosca.capabilities.Scalable
+            service:
+                type: tosca.capabilities.xos.Service
+        properties:
+            no-delete:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to delete this object
+            no-create:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to create this object
+            no-update:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to update this object
+            replaces:
+                type: string
+                required: false
+                descrption: Replaces/renames this object
+            kind:
+                type: string
+                default: generic
+                description: Type of service.
+            view_url:
+                type: string
+                required: false
+                description: URL to follow when icon is clicked in the Service Directory.
+            icon_url:
+                type: string
+                required: false
+                description: ICON to display in the Service Directory.
+            enabled:
+                type: boolean
+                default: true
+            published:
+                type: boolean
+                default: true
+                description: If True then display this Service in the Service Directory.
+            public_key:
+                type: string
+                required: false
+                description: Public key to install into Instances to allows Services to SSH into them.
+            private_key_fn:
+                type: string
+                required: false
+                description: Location of private key file
+            versionNumber:
+                type: string
+                required: false
+                description: Version number of Service.
+            tap_ports:
+               type: string
+               required: false
+            reset_viv:
+               type: boolean
+               required: false
+
+    tosca.nodes.PassiveTestTenant:
+        derived_from: tosca.nodes.Root
+        description: >
+            A Tenant of the PassiveTest service
+        properties:
+            kind:
+                type: string
+                default: generic
+                description: Kind of tenant
+            service_specific_id:
+                type: string
+                required: false
+                description: Service specific ID opaque to XOS but meaningful to service
+
diff --git a/xos/admin.py b/xos/admin.py
new file mode 100644
index 0000000..e492e58
--- /dev/null
+++ b/xos/admin.py
@@ -0,0 +1,118 @@
+# admin.py - PassiveTest Django Admin
+
+from core.admin import ReadOnlyAwareAdmin, SliceInline
+from core.middleware import get_request
+from core.models import User
+
+from django import forms
+from django.contrib import admin
+
+from services.passivetest.models import *
+
+class PassiveTestForm(forms.ModelForm):
+
+    class Meta:
+        model = PassiveTestService
+        fields = '__all__'
+
+    def __init__(self, *args, **kwargs):
+        super(PassiveTestForm, self).__init__(*args, **kwargs)
+
+        if self.instance:
+            self.fields['tap_ports'].initial = self.instance.tap_ports
+            self.fields['reset_viv'].initial = self.instance.reset_viv
+
+    def save(self, commit=True):
+        self.instance.tap_ports = self.cleaned_data.get('tap_ports')
+        self.instance.reset_viv = self.cleaned_data.get('reset_viv')
+        return super(PassiveTestForm, self).save(commit=commit)
+
+class PassiveTestAdmin(ReadOnlyAwareAdmin):
+
+    model = PassiveTestService
+    verbose_name = PASSIVETEST_SERVICE_NAME_VERBOSE
+    verbose_name_plural = PASSIVETEST_SERVICE_NAME_VERBOSE_PLURAL
+    form = PassiveTestForm
+    inlines = [SliceInline]
+
+    list_display = ('backend_status_icon', 'name', 'tap_ports', 'reset_viv', 'enabled')
+    list_display_links = ('backend_status_icon', 'name', 'tap_ports', 'reset_viv')
+
+    fieldsets = [(None, {
+        'fields': ['backend_status_text', 'name', 'enabled', 'versionNumber', 'tap_ports', 'reset_viv', 'description',],
+        'classes':['suit-tab suit-tab-general',],
+        })]
+
+    readonly_fields = ('backend_status_text', )
+    user_readonly_fields = ['name', 'enabled', 'versionNumber', 'description',]
+
+    extracontext_registered_admins = True
+
+    suit_form_tabs = (
+        ('general', 'PassiveTest Details', ),
+        ('slices', 'Slices',),
+        )
+
+    suit_form_includes = ((
+        'top',
+        'administration'),
+        )
+
+    def get_queryset(self, request):
+        return PassiveTestService.get_service_objects_by_user(request.user)
+
+admin.site.register(PassiveTestService, PassiveTestAdmin)
+
+class PassiveTestTenantForm(forms.ModelForm):
+
+    class Meta:
+        model = PassiveTestTenant
+        fields = '__all__'
+
+    creator = forms.ModelChoiceField(queryset=User.objects.all())
+
+    def __init__(self, *args, **kwargs):
+        super(PassiveTestTenantForm, self).__init__(*args, **kwargs)
+
+        self.fields['kind'].widget.attrs['readonly'] = True
+        self.fields['kind'].initial = PASSIVETEST_KIND
+
+        self.fields['provider_service'].queryset = PassiveTestService.get_service_objects().all()
+
+        if self.instance:
+            self.fields['creator'].initial = self.instance.creator
+
+        if (not self.instance) or (not self.instance.pk):
+            self.fields['creator'].initial = get_request().user
+            if PassiveTestService.get_service_objects().exists():
+                self.fields['provider_service'].initial = PassiveTestService.get_service_objects().all()[0]
+
+    def save(self, commit=True):
+        self.instance.creator = self.cleaned_data.get('creator')
+        return super(PassiveTestTenantForm, self).save(commit=commit)
+
+
+class PassiveTestTenantAdmin(ReadOnlyAwareAdmin):
+
+    verbose_name = PASSIVETEST_TENANT_NAME_VERBOSE
+    verbose_name_plural = PASSIVETEST_TENANT_NAME_VERBOSE_PLURAL
+
+    list_display = ('id', 'backend_status_icon', 'instance')
+    list_display_links = ('backend_status_icon', 'instance', 'id')
+
+    fieldsets = [(None, {
+        'fields': ['backend_status_text', 'kind', 'provider_service', 'instance', 'creator'],
+        'classes': ['suit-tab suit-tab-general'],
+        })]
+
+    readonly_fields = ('backend_status_text', 'instance',)
+
+    form = PassiveTestTenantForm
+
+    suit_form_tabs = (('general', 'Details'),)
+
+    def get_queryset(self, request):
+        return PassiveTestTenant.get_tenant_objects_by_user(request.user)
+
+admin.site.register(PassiveTestTenant, PassiveTestTenantAdmin)
+
diff --git a/xos/api/service/passivetest.py b/xos/api/service/passivetest.py
new file mode 100644
index 0000000..f5b556d
--- /dev/null
+++ b/xos/api/service/passivetest.py
@@ -0,0 +1,38 @@
+from rest_framework.response import Response
+from rest_framework import serializers
+from api.xosapi_helpers import PlusModelSerializer, XOSViewSet, ReadOnlyField
+from services.passivetest.models import PassiveTestService
+
+class PassiveTestSerializer(PlusModelSerializer):
+    id = ReadOnlyField()
+    humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+    tap_ports = serializers.CharField(required=False)
+    reset_viv = serializers.BooleanField(required=False)
+
+    class Meta:
+        model = PassiveTestService
+        fields = ('humanReadableName',
+                  'id',
+                  'tap_ports',
+                  'reset_viv')
+
+    def getHumanReadableName(self, obj):
+        return obj.__unicode__()
+
+class PassiveTestViewSet(XOSViewSet):
+    base_name = "passivetest"
+    method_name = "passivetest"
+    method_kind = "viewset"
+    queryset = PassiveTestService.get_service_objects().all()
+    serializer_class = PassiveTestSerializer
+
+    @classmethod
+    def get_urlpatterns(self, api_path="^"):
+        patterns = super(PassiveTestViewSet, self).get_urlpatterns(api_path=api_path)
+        return patterns
+
+    def list(self, request):
+        object_list = self.filter_queryset(self.get_queryset())
+        serializer = self.get_serializer(object_list, many=True)
+        return Response(serializer.data)
+
diff --git a/xos/api/tenant/passivetesttenant.py b/xos/api/tenant/passivetesttenant.py
new file mode 100644
index 0000000..21c9b1a
--- /dev/null
+++ b/xos/api/tenant/passivetesttenant.py
@@ -0,0 +1,39 @@
+from rest_framework.response import Response
+from rest_framework import serializers
+from api.xosapi_helpers import PlusModelSerializer, XOSViewSet, ReadOnlyField
+
+from services.passivetest.models import PassiveTestTenant, PassiveTestService
+
+def get_default_passivetest_service():
+    passivetest_services = PassiveTestService.get_service_objects().all()
+    if passivetest_services:
+        return passivetest_services[0]
+    return None
+
+class PassiveTestTenantSerializer(PlusModelSerializer):
+    id = ReadOnlyField()
+    provider_service = serializers.PrimaryKeyRelatedField(queryset=PassiveTestService.get_service_objects().all(), default=get_default_passivetest_service)
+    backend_status = ReadOnlyField()
+    
+    humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+
+    class Meta:
+        model = PassiveTestTenant
+        fields = ('humanReadableName', 'id', 'provider_service', 'backend_status')
+
+    def getHumanReadableName(self, obj):
+        return obj.__unicode__()
+
+class PassiveTestTenantViewSet(XOSViewSet):
+    base_name = "passivetesttenant"
+    method_name = "passivetesttenant"
+    method_kind = "viewset"
+    queryset = PassiveTestTenant.get_tenant_objects().all()
+    serializer_class = PassiveTestTenantSerializer
+
+
+    def list(self, request):
+        queryset = self.filter_queryset(self.get_queryset())
+        serializer = self.get_serializer(queryset, many=True)
+        return Response(serializer.data)
+
diff --git a/xos/macros.m4 b/xos/macros.m4
new file mode 100644
index 0000000..1f48f10
--- /dev/null
+++ b/xos/macros.m4
@@ -0,0 +1,84 @@
+# Note: Tosca derived_from isn't working the way I think it should, it's not
+#    inheriting from the parent template. Until we get that figured out, use
+#    m4 macros do our inheritance
+
+define(xos_base_props,
+            no-delete:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to delete this object
+            no-create:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to create this object
+            no-update:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to update this object
+            replaces:
+                type: string
+                required: false
+                descrption: Replaces/renames this object)
+# Service
+define(xos_base_service_caps,
+            scalable:
+                type: tosca.capabilities.Scalable
+            service:
+                type: tosca.capabilities.xos.Service)
+define(xos_base_service_props,
+            kind:
+                type: string
+                default: generic
+                description: Type of service.
+            view_url:
+                type: string
+                required: false
+                description: URL to follow when icon is clicked in the Service Directory.
+            icon_url:
+                type: string
+                required: false
+                description: ICON to display in the Service Directory.
+            enabled:
+                type: boolean
+                default: true
+            published:
+                type: boolean
+                default: true
+                description: If True then display this Service in the Service Directory.
+            public_key:
+                type: string
+                required: false
+                description: Public key to install into Instances to allows Services to SSH into them.
+            private_key_fn:
+                type: string
+                required: false
+                description: Location of private key file
+            versionNumber:
+                type: string
+                required: false
+                description: Version number of Service.)
+# Subscriber
+define(xos_base_subscriber_caps,
+            subscriber:
+                type: tosca.capabilities.xos.Subscriber)
+define(xos_base_subscriber_props,
+            kind:
+                type: string
+                default: generic
+                description: Kind of subscriber
+            service_specific_id:
+                type: string
+                required: false
+                description: Service specific ID opaque to XOS but meaningful to service)
+define(xos_base_tenant_props,
+            kind:
+                type: string
+                default: generic
+                description: Kind of tenant
+            service_specific_id:
+                type: string
+                required: false
+                description: Service specific ID opaque to XOS but meaningful to service)
+
+# end m4 macros
+
diff --git a/xos/make_synchronizer_manifest.sh b/xos/make_synchronizer_manifest.sh
new file mode 100644
index 0000000..4058982
--- /dev/null
+++ b/xos/make_synchronizer_manifest.sh
@@ -0,0 +1,2 @@
+#! /bin/bash
+find synchronizer -type f | cut -b 14- > synchronizer/manifest 
diff --git a/xos/models.py b/xos/models.py
new file mode 100644
index 0000000..53b0d0e
--- /dev/null
+++ b/xos/models.py
@@ -0,0 +1,67 @@
+# models.py -  ExampleService Models
+
+from core.models import Service, TenantWithContainer
+from django.db import models, transaction
+
+PASSIVETEST_KIND = 'PassiveTest'
+PASSIVETEST_SERVICE_NAME = 'passivetest'
+PASSIVETEST_SERVICE_NAME_VERBOSE = 'PASSIVETEST Service'
+PASSIVETEST_SERVICE_NAME_VERBOSE_PLURAL = 'PASSIVETEST Services'
+PASSIVETEST_TENANT_NAME_VERBOSE = 'PASSIVETEST Tenant'
+PASSIVETEST_TENANT_NAME_VERBOSE_PLURAL = 'PASSIVETEST Tenants'
+
+class PassiveTestService(Service):
+
+    KIND = PASSIVETEST_KIND
+
+    class Meta:
+        app_label = PASSIVETEST_SERVICE_NAME
+        verbose_name = PASSIVETEST_SERVICE_NAME_VERBOSE
+
+    tap_ports = models.CharField(max_length=254, help_text="Neutron Port ids of the ports we want to tap (comma delimited)")
+    reset_viv = models.BooleanField(default=False, help_text="Reset the VIV's input and output configurations!")
+    
+
+class PassiveTestTenant(TenantWithContainer):
+
+    KIND = PASSIVETEST_KIND
+
+    class Meta:
+        verbose_name = PASSIVETEST_TENANT_NAME_VERBOSE
+
+    def __init__(self, *args, **kwargs):
+        passivetestservice = PassiveTestService.get_service_objects().all()
+        if passivetestservice:
+            self._meta.get_field('provider_service').default = passivetestservice[0].id
+        super(PassiveTestTenant, self).__init__(*args, **kwargs)
+
+    def save(self, *args, **kwargs):
+        super(PassiveTestTenant, self).save(*args, **kwargs)
+        model_policy_passivetesttenant(self.pk)
+
+    def delete(self, *args, **kwargs):
+        self.cleanup_container()
+        super(PassiveTestTenant, self).delete(*args, **kwargs)
+
+    @property
+    def public_ip(self):
+        for port in self.instance.ports.all():
+            if "public" in port.network.name.lower():
+                return port.ip
+        return None
+
+    @property
+    def synchronizer_ip(self):
+        for port in self.instance.ports.all():
+            if "management" in port.network.name.lower():
+                return port.ip
+        return None
+
+def model_policy_passivetesttenant(pk):
+    with transaction.atomic():
+        tenant = PassiveTestTenant.objects.select_for_update().filter(pk=pk)
+        if not tenant:
+            return
+        tenant = tenant[0]
+        tenant.manage_container()
+
diff --git a/xos/synchronizer/manifest b/xos/synchronizer/manifest
new file mode 100644
index 0000000..dd23436
--- /dev/null
+++ b/xos/synchronizer/manifest
@@ -0,0 +1,20 @@
+passivetest-synchronizer.yaml
+manifest
+passivetest_config
+monitoring_stats_notifier.py
+passivetest-synchronizer.py
+steps/sync_passivetesttenant.py
+steps/passivetesttenant_playbook.yaml
+steps/sync_monitoring_agent.yaml
+steps/roles/setup_probe/tasks/main.yml
+steps/roles/setup_probe/files/README
+steps/roles/setup_probe/files/debs/docker.io_1.6.2~dfsg1-1ubuntu4~14.04.1_amd64.deb
+steps/roles/setup_probe/files/debs/cgroup-lite_1.11~ubuntu14.04.2_all.deb
+steps/roles/setup_probe/files/debs/liberror-perl_0.17-1.1_all.deb
+steps/roles/setup_probe/files/debs/aufs-tools_3.2+20130722-1.1_amd64.deb
+steps/roles/setup_probe/files/debs/git-man_1.9.1-1ubuntu0.3_all.deb
+steps/roles/setup_probe/files/debs/git_1.9.1-1ubuntu0.3_amd64.deb
+steps/roles/setup_probe/files/passivetest_rsa.pub
+steps/roles/setup_probe/files/viv
+steps/roles/setup_probe/files/xcp.docker
+model-deps
diff --git a/xos/synchronizer/model-deps b/xos/synchronizer/model-deps
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/xos/synchronizer/model-deps
@@ -0,0 +1 @@
+{}
diff --git a/xos/synchronizer/monitoring_stats_notifier.py b/xos/synchronizer/monitoring_stats_notifier.py
new file mode 100644
index 0000000..bbfc0db
--- /dev/null
+++ b/xos/synchronizer/monitoring_stats_notifier.py
@@ -0,0 +1,111 @@
+import six, uuid, csv, datetime, threading, socket, shutil, argparse, glob, os, copy, pprint, time, sys
+from kombu.connection import BrokerConnection
+from kombu.messaging import Exchange, Queue, Consumer, Producer
+
+XAGG_CSV_DIR="/xsight/var/opt/xagg/tmp"
+XAGG_CSV_PROCESSED_DIR="/xsight/var/opt/xagg/tmp/processed"
+
+class RabbitMQ:
+    def __init__(self, rabbit_host, rabbit_user, rabbit_password, exchange_name):
+        exchange = Exchange(exchange_name, "topic", durable=False)
+        connection = BrokerConnection(rabbit_host, rabbit_user, rabbit_password)
+        channel = connection.channel()
+        self.producer = Producer(channel, exchange=exchange, routing_key="notifications.info")
+
+    def publish(self, stats):
+        self.producer.publish(stats)
+
+
+class CeilometerStats:
+    def __init__(self, keystone_user_id, keystone_tenant_id):
+        self.message_template = {'publisher_id': "monitoring_on_"+socket.gethostname(),
+                                 'priority':'INFO'}
+        self.keystone_user_id = keystone_user_id
+        self.keystone_tenant_id = keystone_tenant_id
+
+    def _get_stat_template(self):
+        retval = copy.copy(self.message_template)
+        retval['message_id'] = six.text_type(uuid.uuid4())
+        retval['timestamp'] = datetime.datetime.now().isoformat()
+        retval['payload'] = {'user_id':self.keystone_user_id,'project_id':self.keystone_tenant_id}
+        return retval
+
+    def get_stat(self,name,event_type,stats={}):
+        retval = self._get_stat_template()
+        retval['event_type']=event_type
+        retval['payload']['resource_id']=name
+        for k,v in stats.iteritems():
+            retval['payload'][k]=v
+        return retval
+
+
+class XaggStatsReader:
+    XAGG_COLUMNS=[
+        {"name":"dn_thruput_min","unit":"kb/s","type":"gauge"},
+        {"name":"dn_thruput_max","unit":"kb/s","type":"gauge"},
+        {"name":"dn_thruput_avg","unit":"kb/s","type":"gauge"},
+        {"name":"up_thruput_min","unit":"kb/s","type":"gauge"},
+        {"name":"up_thruput_max","unit":"kb/s","type":"gauge"},
+        {"name":"up_thruput_avg","unit":"kb/s","type":"gauge"},
+        {"name":"up_byte","unit":"B","type":"cumulative"},
+        {"name":"dn_byte","unit":"B","type":"cumulative"},
+        {"name":"up_pkt","unit":"packet","type":"cumulative"},
+        {"name":"dn_pkt","unit":"packet","type":"cumulative"},
+        {"name":"tcp_rtt","unit":"ms","type":"gauge"},
+        {"name":"tcp_dn_retrans","unit":"packet","type":"gauge"},
+        {"name":"tcp_up_retrans","unit":"packet","type":"gauge"},
+        {"name":"tcp_attempt","unit":"attempt","type":"gauge"},
+        {"name":"tcp_success","unit":"attempt","type":"gauge"}
+    ]
+    CSV_FILE_COLUMNS=["user_src_ip","user_dst_ip","enb_id","customer_group","technology",
+                      "handset","os","apn","service_category","service_type","service_name",
+                      "application_name","app_attempt","app_success","app_response_time",
+                      "dn_byte","dn_thruput_min","dn_thruput_max","dn_thruput_avg","up_byte",
+                      "up_thruput_min","up_thruput_max","up_thruput_avg","tcp_dn_retrans",
+                      "tcp_up_retrans","dn_pkt","up_pkt","tcp_rtt","tcp_attempt","tcp_success"]
+    def __init__(self, ceilometer_stats):
+        self.stats = ceilometer_stats
+
+    def get_stats(self, csvfile):
+        fp = open(csvfile)
+        f = csv.DictReader(filter(lambda row: row[0] !='#',fp),fieldnames=self.CSV_FILE_COLUMNS)
+        retval = []
+        for row in f:
+            name=row["user_src_ip"]+"_"+row["user_dst_ip"]
+            for stat in self.XAGG_COLUMNS:
+                stat['volume'] = row[stat["name"]]
+                retval.append(self.stats.get_stat(name,"passivetest.stats",stat))
+        return retval
+
+def periodic_publish(rabbit_mq,xagg_stats_reader):
+    for stats_file in glob.glob(XAGG_CSV_DIR+"/*.csv"):
+        if not os.path.isdir(stats_file):
+            stats = xagg_stats_reader.get_stats(stats_file)
+            for stat in stats:
+                rabbit_mq.publish(stat)
+            shutil.move(stats_file,XAGG_CSV_PROCESSED_DIR)
+
+    # Publish every minute
+    threading.Timer(60, periodic_publish, args=(rabbit_mq, xagg_stats_reader)).start()
+
+def main():
+    parser = argparse.ArgumentParser(description='Process xagg telemetry and send to ceilometer/monitoring service.')
+    for arg in ["keystone-tenant-id","keystone-user-id","rabbit-host","rabbit-user","rabbit-password","rabbit-exchange-name"]:
+        parser.add_argument("--"+arg,required=True)
+
+    args = parser.parse_args()
+
+    while True:
+        try:
+            rabbit_mq = RabbitMQ(args.rabbit_host, args.rabbit_user, args.rabbit_password, args.rabbit_exchange_name)
+            ceilometer_stats = CeilometerStats(args.keystone_user_id, args.keystone_tenant_id)
+            xagg_stats_reader = XaggStatsReader(ceilometer_stats)
+            periodic_publish(rabbit_mq,xagg_stats_reader)
+        except Exception as e:
+            print(e)
+            sys.stdout.flush()
+        print("Trying again in one minute...")
+        time.sleep(60)
+
+if __name__ == "__main__":
+   exit(main())
diff --git a/xos/synchronizer/passivetest-synchronizer.py b/xos/synchronizer/passivetest-synchronizer.py
new file mode 100644
index 0000000..90d2c98
--- /dev/null
+++ b/xos/synchronizer/passivetest-synchronizer.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+# Runs the standard XOS synchronizer
+
+import importlib
+import os
+import sys
+
+synchronizer_path = os.path.join(os.path.dirname(
+    os.path.realpath(__file__)), "../../synchronizers/base")
+sys.path.append(synchronizer_path)
+mod = importlib.import_module("xos-synchronizer")
+mod.main()
+
diff --git a/xos/synchronizer/passivetest-synchronizer.yaml b/xos/synchronizer/passivetest-synchronizer.yaml
new file mode 100644
index 0000000..b1ad5d3
--- /dev/null
+++ b/xos/synchronizer/passivetest-synchronizer.yaml
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: This recipe provides additional configuration for the onboarded services.
+
+imports:
+   - custom_types/xos.yaml
+
+topology_template:
+  node_templates:
+    servicecontroller#passivetest:
+      type: tosca.nodes.ServiceController
+      properties:
+        no-create: true
+        synchronizer_config: /root/setup/files/passivetest_config
diff --git a/xos/synchronizer/passivetest_config b/xos/synchronizer/passivetest_config
new file mode 100644
index 0000000..b0f051a
--- /dev/null
+++ b/xos/synchronizer/passivetest_config
@@ -0,0 +1,30 @@
+# Required by XOS
+[db]
+name=xos
+user=postgres
+password=password
+host=xos_db
+port=5432
+
+# Required by XOS
+[api]
+nova_enabled=True
+
+# Sets options for the synchronizer
+[observer]
+name=passivetest
+dependency_graph=/opt/xos/synchronizers/passivetest/model-deps
+steps_dir=/opt/xos/synchronizers/passivetest/steps
+sys_dir=/opt/xos/synchronizers/passivetest/sys
+logfile=/var/log/xos_backend.log
+pretend=False
+backoff_disabled=True
+save_ansible_output=True
+proxy_ssh=True
+proxy_ssh_key=/root/setup/node_key
+proxy_ssh_user=root
+enable_watchers=True
+
+[networking]
+use_vtn=True
+
diff --git a/xos/synchronizer/steps/passivetesttenant_playbook.yaml b/xos/synchronizer/steps/passivetesttenant_playbook.yaml
new file mode 100644
index 0000000..6bbf222
--- /dev/null
+++ b/xos/synchronizer/steps/passivetesttenant_playbook.yaml
@@ -0,0 +1,16 @@
+---
+# passivetesttenant_playbook - sets up the controller
+
+- hosts: "{{ instance_name }}"
+  connection: ssh
+  user: root
+  sudo: yes
+  gather_facts: no
+  vars:
+    - public_ip: "{{ public_ip }}"
+    - synchronizer_ip: "{{ synchronizer_ip }}"
+    - tap_ports: "{{ tap_ports }}"
+    - reset_viv: {{ reset_viv }}
+
+  roles:
+    - setup_probe
diff --git a/xos/synchronizer/steps/roles/setup_probe/files/viv b/xos/synchronizer/steps/roles/setup_probe/files/viv
new file mode 100755
index 0000000..7cd7375
--- /dev/null
+++ b/xos/synchronizer/steps/roles/setup_probe/files/viv
@@ -0,0 +1,268 @@
+#!/usr/bin/env python
+import requests, sys, getopt, json
+ 
+COMMANDS     = [ 'show','reset', 'add','delete','deploy',"V_BUFS","NUM_BUFS", "INPUT_MODE", "TX_MODE", "QUEUE_TYPE" ]
+trafficTypes = ['TSA_CP','TSA_UP', 'TAA_CP', 'TAA_UP']
+INPUT_MODES=["mmap","pfring","pfring_zc","dpdk"]
+TX_MODES=["frp_udp","frp_tcp","viv"]
+QUEUE_TYPES=["CLFFIFO","dpdk"]
+RESOURCE_NAMES =  [ 'V_BUFS', 'NUM_BUFS', 'INPUT_MODE', 'TX_MODE', 'QUEUE_TYPE']
+
+settings = {
+             'ipAddress':'127.0.0.1',
+             'port':'8080',
+             'api_version':'v1.0',
+             'resource': 'vivs/1',
+             'operation':'GET',
+             'verbose': False,
+             'data': None
+            }
+ 
+class restClient:
+
+  def doIt( self, settings ):
+    try:
+      hdrs = { 'Accept':'application/json','content-type':'application/json' }
+      url = "http://%s:%s/%s" % ( settings['ipAddress'], settings['port'], settings['api_version'] )
+      if settings['resource']:
+        url = "%s/%s" % (url, settings['resource'])
+
+      if settings['operation'] == 'GET':
+        r = requests.get( url, headers = hdrs )
+      elif settings['operation'] == 'POST':
+        data = json.loads(settings['data'])
+        r = requests.post( url, data=json.dumps(data), headers = hdrs )
+
+      if r.status_code == requests.codes.ok:
+        if r.headers['content-type'] == 'application/json':
+          print json.dumps( r.json(), indent=4 )
+        else:
+          print "Received unexpected content type: %s" % r.headers['content-type']
+          if settings['verbose']:
+            print r.text
+
+      if settings['verbose']:
+        print "\nOperation:\n    %s"            % settings['operation']
+        print "\nURL:\n    %s"                  % r.url 
+        print "\nHeaders sent:\n    %s"         % r.request.headers
+        print "\nResponse status code:\n    %s" % r.status_code
+
+    except requests.ConnectionError as e:
+      print e
+      raise  # re-raise exception
+    except ValueError as e:
+      print "Invalid JSON: %s" % e 
+      raise # re-raise exception
+
+
+def stringFromList( p ):
+  """
+  e.g. ['a', 'b', 'c' ] becomes "[a|b|c]"
+  """
+  return str( p ).replace("'","").replace(", ","|")
+
+def usage():
+  print "Usage:"
+  print " $ %s [-i ip][-p port][-a version][-v] command" % sys.argv[0]
+  print ""
+  print "optional arguments:"
+  print "  -i <ip>          IP address of server. (Default: 127.0.0.1)"
+  print "  -p <port>        Port on server.       (Default: 8080)"
+  print "  -a <version>     API version to use.   (Default: v1.0)"
+  print "  -v               Be verbose"
+  print ""
+  print "command"
+  print "-------"
+  print " show [<path>]"
+  print " add input <device> <type> [<type> [...]]"
+  print " add output <ip_address> <port> <type>"
+  print " delete input <device> [<type> [<type> [...]]]"
+  print " delete output <ip_address>[:<port>] [<type> [<type> [...]]]"
+  print " reset"
+  print " deploy"
+  print ""
+  print " V_BUFS <value>"
+  print " NUM_BUFS <value>"
+  print " INPUT_MODE <input-mode>"
+  print " TX_MODE <tx-mode>"
+  print " QUEUE_TYPE <queue-type>"
+  print ""
+  print ""
+  print " Where:"
+  print "    <type>       = %s" % stringFromList( trafficTypes )
+  print "    <input_mode> = %s" % stringFromList(INPUT_MODES )
+  print "    <tx-mode>    = %s" % stringFromList( QUEUE_TYPES )
+  print ""
+
+
+def getTrafficTypes( args ):
+  traffic_types=[]
+  while len(args) > 0:
+    t = args.pop(0)
+    if t not in trafficTypes:
+      raise ValueError("Invalid traffic type '%s'" % t )
+    traffic_types.append( t )
+  return traffic_types
+
+def parseAddInputCommand( args ):
+  if len( args ) < 2:
+    raise ValueError("Usage: %s add input <device> <traffic_type> [<traffic_type> [...]]" % sys.argv[0] )
+
+  device = args.pop(0)
+  tt = getTrafficTypes( args )
+  data = { "inputs":[{"device":device,"traffic_types":tt}]}
+  settings['resource']='vivs/1/add'
+  settings['operation']='POST'
+  settings['data'] = json.dumps( data )
+
+def parseAddOutputCommand( args ):
+  if len( args ) != 3:
+    raise ValueError("Usage: %s add output <ip_address> <port> <traffic_type>" % sys.argv[0] )
+
+  ip_address = args.pop(0)
+  port = args.pop(0)
+  traffic_type = args.pop(0)
+  if traffic_type not in trafficTypes:
+    raise ValueError("Invalid traffic type '%s'" % traffic_type )
+
+  data = {"outputs":[{"ip_address":ip_address,"type":traffic_type,"port":port}]}
+  settings['resource']='vivs/1/add'
+  settings['operation']='POST'
+  settings['data'] = json.dumps( data )
+
+def parseDeleteInputCommand( args ):
+  if len( args ) < 1:
+    raise ValueError( "Usage: %s delete input <device> [<traffic_type> [<traffic_type> [...]]]" % sys.argv[0] )
+
+  device = args.pop(0)
+  tt = getTrafficTypes( args )
+  data = {"inputs":[{"device":device,"traffic_types":tt}]}
+  settings['resource']='vivs/1/delete'
+  settings['operation']='POST'
+  settings['data'] = json.dumps( data )
+
+def parseDeleteOutputCommand( args ):
+  if len(args) == 0:
+    raise ValueError( "Usage: %s delete output <ip_address>[:<port>] [<traffic_type> [<traffic_type> [...]]]" % sys.argv[0] )
+
+  ipp = args.pop(0).split(':')
+  ip_address = ipp[0]
+  try:
+    port = ipp[1]
+  except IndexError:
+    # No port was specified
+    # All ports with spec'd traffic types will be removed for 
+    # the IP given.
+    port = None
+
+  tt = getTrafficTypes( args )
+  data = {"outputs":[{"ip_address":ip_address,"port":port, "traffic_types":tt}]}
+  settings['resource']='vivs/1/delete'
+  settings['operation']='POST'
+  settings['data'] = json.dumps( data )
+
+def parseArgs( argv ):
+  try:
+    opts,args = getopt.getopt( argv,
+        "i:p:a:vh", ["ip=","port=","api_version="])
+  except getopt.GetoptError as e:
+    print e
+    raise    # re-raise exception
+  for opt,arg in opts:
+    if opt == '-h':
+      usage()
+      sys.exit()
+    elif opt == '-v':
+      settings['verbose'] = True
+    elif opt in ("-i","--ip"):
+      settings['ipAddress'] = arg
+    elif opt in ("-p","--port"):
+      settings['port'] = arg
+    elif opt in ("-a","--api_version"):
+      settings['api_version'] = arg
+
+  # process residual non option args
+  if len(args) == 0:
+    raise ValueError( "Expected one of: %s" % str( COMMANDS ) )
+
+  cmd = args.pop(0)
+  if cmd not in COMMANDS:
+    print 'Unknown command', cmd
+    sys.exit(1)
+
+  if cmd in ['show']:
+    if len(args) != 0:
+      settings['resource'] = args.pop(0)
+
+  elif cmd in ['reset']:
+    settings['resource']='vivs/1/reset' 
+    settings['operation'] = 'POST'
+    settings['data'] = json.dumps( {} )
+
+  elif cmd in ['add']:
+
+    if len(args) == 0:
+      raise ValueError("Expected 'input' or 'output'")
+
+    direction = args.pop(0)
+    if direction not in ['input','output']:
+      raise ValueError( "expected 'input' or 'output', found '%s'" % direction )
+ 
+    if direction == 'input':
+      parseAddInputCommand( args )
+    else:
+      parseAddOutputCommand( args )
+
+  elif cmd in ['delete']:
+    if len(args) == 0:
+      raise ValueError("Expected 'input' or 'output'" )
+
+    direction = args.pop(0)
+    if direction not in ['input','output']:
+      raise ValueError("expected 'input' or 'output', found '%s'" % direction )
+
+    if direction == 'input':
+      parseDeleteInputCommand( args )
+    else:
+      parseDeleteOutputCommand( args )
+
+  elif cmd in ['deploy']:
+    settings['resource']='vivs/1/deploy'
+    settings['operation'] = 'POST'
+    settings['data'] = '{}'
+
+  else:
+
+    if cmd in RESOURCE_NAMES:
+      if len( args ) == 0 :
+          raise ValueError( 'No value supplied' )
+
+      val = args.pop(0)
+      # The server will complain if it does not like the value.
+      settings['resource']='vivs/1/%s' % cmd
+      settings['operation'] = 'POST'
+      settings['data'] = json.dumps( { cmd : val } )
+
+
+  return settings
+
+
+def RestClient(argv):
+  settings = parseArgs( argv )
+  client = restClient()
+  client.doIt( settings )
+
+
+if __name__ == '__main__':
+  try:
+    RestClient(sys.argv[1:])
+  except ValueError as e:
+    print e
+    sys.exit(2)
+  except getopt.GetoptError as e:
+    print e
+    sys.exit(3)
+  except requests.ConnectionError as e:
+    print e
+    sys.exit(4)
+
diff --git a/xos/synchronizer/steps/roles/setup_probe/tasks/main.yml b/xos/synchronizer/steps/roles/setup_probe/tasks/main.yml
new file mode 100644
index 0000000..ae2d5fb
--- /dev/null
+++ b/xos/synchronizer/steps/roles/setup_probe/tasks/main.yml
@@ -0,0 +1,22 @@
+---
+- name: setup authorized key for user ubuntu since service chaining uses it
+  authorized_key: 
+    user: ubuntu
+    key: "{{ lookup('file', 'passivetest_rsa.pub') }}"
+    state: present
+
+- name: copy viv client
+  copy: src=viv dest=/usr/bin mode=0755
+
+- name: reset viv (if needed)
+  shell: viv -i 172.27.0.1 reset
+  when: reset_viv
+
+- name: configure input
+  shell: viv -i 172.27.0.1 add input {{ tap_ports }} TSA_CP
+  ignore_errors: True
+
+- name: register probe with viv
+  shell: viv -i 172.27.0.1 add output {{ synchronizer_ip }} 50002 TSA_CP
+  ignore_errors: True
+   
diff --git a/xos/synchronizer/steps/sync_monitoring_agent.yaml b/xos/synchronizer/steps/sync_monitoring_agent.yaml
new file mode 100644
index 0000000..93f805e
--- /dev/null
+++ b/xos/synchronizer/steps/sync_monitoring_agent.yaml
@@ -0,0 +1,36 @@
+---
+- hosts: {{ instance_name }}
+  gather_facts: False
+  connection: ssh
+  user: root
+  vars:
+      keystone_tenant_id: {{ keystone_tenant_id }}
+      keystone_user_id: {{ keystone_user_id }}
+      rabbit_user: {{ rabbit_user }}
+      rabbit_password: {{ rabbit_password }}
+      rabbit_host: {{ rabbit_host }}
+
+  tasks:
+  - name: Verify if monitoring_stats_notifier ([] is to avoid capturing the shell process)  job is already running
+    shell: pgrep -f [m]onitoring_stats_notifier | wc -l
+    register: job_pids_count
+
+  - name: make sure /usr/local/share/monitoring_agent exists
+    file: path=/usr/local/share/monitoring_agent state=directory owner=root group=root
+    when: job_pids_count.stdout == "0"
+
+  - name: make a processed file folder
+    file: path=/xsight/var/opt/xagg/tmp/processed state=directory owner=root group=root
+    when: job_pids_count.stdout == "0"
+
+  - name: Copy  job to destination
+    copy: src=/opt/xos/synchronizers/passivetest/monitoring_stats_notifier.py
+      dest=/usr/local/share/monitoring_agent/monitoring_stats_notifier.py
+    when: job_pids_count.stdout == "0"
+
+  - name: Initiate monitoring_stats_notifier job
+    command: python /usr/local/share/monitoring_agent/monitoring_stats_notifier.py --keystone-tenant-id={{ keystone_tenant_id }} --keystone-user-id={{ keystone_user_id }} --rabbit-user={{ rabbit_user }} --rabbit-password={{ rabbit_password }} --rabbit-host={{ rabbit_host }} --rabbit-exchange-name='passivetestservice'
+    async: 9999999999999999
+    poll: 0
+    when: job_pids_count.stdout == "0"
+
diff --git a/xos/synchronizer/steps/sync_passivetesttenant.py b/xos/synchronizer/steps/sync_passivetesttenant.py
new file mode 100644
index 0000000..fb60667
--- /dev/null
+++ b/xos/synchronizer/steps/sync_passivetesttenant.py
@@ -0,0 +1,95 @@
+import os
+import sys
+from django.db.models import Q, F
+from services.passivetest.models import PassiveTestService, PassiveTestTenant
+from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+from core.models import ModelLink, CoarseTenant, ServiceMonitoringAgentInfo
+from xos.logger import Logger, logging
+from urlparse import urlparse
+
+parentdir = os.path.join(os.path.dirname(__file__), "..")
+sys.path.insert(0, parentdir)
+
+logger = Logger(level=logging.INFO)
+
+class SyncPassiveTestTenant(SyncInstanceUsingAnsible):
+    provides = [PassiveTestTenant]
+    observes = PassiveTestTenant
+    requested_interval = 0
+    template_name = "passivetesttenant_playbook.yaml"
+    service_key_name = "/opt/xos/synchronizers/passivetest/passivetest_private_key"
+    watches = [ModelLink(CoarseTenant,via='coarsetenant'), 
+               ModelLink(ServiceMonitoringAgentInfo,via='monitoringagentinfo')]
+
+    def __init__(self, *args, **kwargs):
+        super(SyncPassiveTestTenant, self).__init__(*args, **kwargs)
+
+    def fetch_pending(self, deleted):
+
+        if (not deleted):
+            objs = PassiveTestTenant.get_tenant_objects().filter(
+                Q(enacted__lt=F('updated')) | Q(enacted=None), Q(lazy_blocked=False))
+        else:
+            # If this is a deletion we get all of the deleted tenants..
+            objs = PassiveTestTenant.get_deleted_tenant_objects()
+
+        return objs
+
+    def get_passivetestservice(self, o):
+        if not o.provider_service:
+            return None
+
+        passivetestservice = PassiveTestService.get_service_objects().filter(id=o.provider_service.id)
+
+        if not passivetestservice:
+            return None
+
+        return passivetestservice[0]
+
+    # Gets the attributes that are used by the Ansible template but are not
+    # part of the set of default attributes.
+    def get_extra_attributes(self, o):
+        passivetestservice = self.get_passivetestservice(o)
+        return { "public_ip": o.public_ip,
+                 "synchronizer_ip": o.synchronizer_ip,
+                 "tap_ports": passivetestservice.tap_ports,
+                 "reset_viv": passivetestservice.reset_viv}
+
+    def handle_service_monitoringagentinfo_watch_notification(self, monitoring_agent_info):
+        if not monitoring_agent_info.service:
+            logger.info("handle watch notifications for service monitoring agent info...ignoring because service attribute in monitoring agent info:%s is null" % (monitoring_agent_info))
+            return
+
+        if not monitoring_agent_info.target_uri:
+            logger.info("handle watch notifications for service monitoring agent info...ignoring because target_uri attribute in monitoring agent info:%s is null" % (monitoring_agent_info))
+            return
+
+        objs = PassiveTestTenant.get_tenant_objects().all()
+        for obj in objs:
+            if obj.provider_service.id != monitoring_agent_info.service.id:
+                logger.info("handle watch notifications for service monitoring agent info...ignoring because service attribute in monitoring agent info:%s is not matching" % (monitoring_agent_info))
+                return
+
+            instance = self.get_instance(obj)
+            if not instance:
+               logger.warn("handle watch notifications for service monitoring agent info...: No valid instance found for object %s" % (str(obj)))
+               return
+
+            logger.info("handling watch notification for monitoring agent info:%s for PassiveTestTenant object:%s" % (monitoring_agent_info, obj))
+
+            #Run ansible playbook to update the routing table entries in the instance
+            fields = self.get_ansible_fields(instance)
+            fields["ansible_tag"] =  obj.__class__.__name__ + "_" + str(obj.id) + "_service_monitoring"
+            
+            #Parse the monitoring agent target_uri
+            url = urlparse(monitoring_agent_info.target_uri)
+
+            #Assuming target_uri is rabbitmq URI
+            fields["rabbit_user"] = url.username
+            fields["rabbit_password"] = url.password
+            fields["rabbit_host"] = url.hostname
+
+            template_name = "sync_monitoring_agent.yaml"
+            super(SyncPassiveTestTenant, self).run_playbook(obj, fields, template_name)
+        pass
+
diff --git a/xos/tosca/resources/passivetest.py b/xos/tosca/resources/passivetest.py
new file mode 100644
index 0000000..9ec5d11
--- /dev/null
+++ b/xos/tosca/resources/passivetest.py
@@ -0,0 +1,30 @@
+from core.models import CoarseTenant
+from services.passivetest.models import PassiveTestService
+
+from xosresource import XOSResource
+
+class XOSPassiveTestService(XOSResource):
+    provides = "tosca.nodes.PassiveTest"
+    xos_model = PassiveTestService
+    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "private_key_fn", "versionNumber", "tap_ports", "reset_viv"]
+
+    def postprocess(self, obj):
+        for provider_service_name in self.get_requirements("tosca.relationships.TenantOfService"):
+            provider_service = self.get_xos_object(PassiveTestService, name=provider_service_name)
+
+            existing_tenancy = CoarseTenant.get_tenant_objects().filter(provider_service = provider_service, subscriber_service = obj)
+            if existing_tenancy:
+                self.info("Tenancy relationship from %s to %s already exists" % (str(obj), str(provider_service)))
+            else:
+                tenancy = CoarseTenant(provider_service = provider_service,
+                                       subscriber_service = obj)
+                tenancy.save()
+
+                self.info("Created Tenancy relationship  from %s to %s" % (str(obj), str(provider_service)))
+
+    def can_delete(self, obj):
+        if obj.slices.exists():
+            self.info("Service %s has passive slices; skipping delete" % obj.name)
+            return False
+        return super(XOSPassiveTestService, self).can_delete(obj)
+
diff --git a/xos/tosca/resources/passivetesttenant.py b/xos/tosca/resources/passivetesttenant.py
new file mode 100644
index 0000000..84ac28f
--- /dev/null
+++ b/xos/tosca/resources/passivetesttenant.py
@@ -0,0 +1,29 @@
+from core.models import Tenant, Service
+from services.passivetest.models import PassiveTestTenant
+
+from xosresource import XOSResource
+
+class XOSPassiveTestTenant(XOSResource):
+    provides = "tosca.nodes.PassiveTestTenant"
+    xos_model = PassiveTestTenant
+    name_field = "service_specific_id"
+    copyin_props = ("tenant_message",)
+
+    def get_xos_args(self, throw_exception=True):
+        args = super(XOSPassiveTestTenant, self).get_xos_args()
+
+        # PassiveTestTenant must always have a provider_service
+        provider_name = self.get_requirement("tosca.relationships.TenantOfService", throw_exception=True)
+        if provider_name:
+            args["provider_service"] = self.get_xos_object(Service, throw_exception=True, name=provider_name)
+
+        return args
+
+    def get_existing_objs(self):
+        args = self.get_xos_args(throw_exception=False)
+        return PassiveTestTenant.get_tenant_objects().filter(provider_service=args["provider_service"], service_specific_id=args["service_specific_id"])
+        return []
+
+    def can_delete(self, obj):
+        return super(XOSPassiveTestTenant, self).can_delete(obj)
+
