blob: 21409314a073b630d204130d13babe9417f36148 [file] [log] [blame]
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +00001FN=$SETUPDIR/inframonitoring.yaml
2
3rm -f $FN
4
5cat >> $FN <<EOF
6tosca_definitions_version: tosca_simple_yaml_1_0
7
8description: Auto generated file to enable monitoring of infrastructure services (OpenStack, ONOS...etc).
9
10imports:
11 - custom_types/xos.yaml
12 - custom_types/monitoring_tosca_types.yaml
13
14topology_template:
15 node_templates:
16 service_ceilometer:
17 type: tosca.nodes.CeilometerService
18 properties:
19 no-create: true
20 no-update: true
21 no-delete: true
22
23 onos_monitoring_agent_head_node:
24 description: Monitoring agent info
25 type: tosca.nodes.InfraMonitoringAgentInfo
26 properties:
27 start_url: http://ceilometer-1.cord.lab:5004/monitoring/agent/onos/start
28 start_url_json_data: { get_artifact: [ SELF, onos_monitoring_service_endpoints, LOCAL_FILE] }
29 stop_url: http://ceilometer-1.cord.lab:5004/monitoring/agent/onos/stop
30 artifacts:
31 onos_monitoring_service_endpoints: /root/setup/onos_monitoring_service_endpoints.json
32
33 onos_monitoring_publisher_tenant:
34 description: ONOS Monitoring Publisher Tenant
35 type: tosca.nodes.ONOSMonitoringPublisher
36 requirements:
37 - provider_service:
38 node: service_ceilometer
39 relationship: tosca.relationships.TenantOfService
40 - monitoring_agent_1:
41 node: onos_monitoring_agent_head_node
42 relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo
43
44 os_monitoring_agent_head_node:
45 description: Openstack Monitoring agent info
46 type: tosca.nodes.InfraMonitoringAgentInfo
47 properties:
48 start_url: http://ceilometer-1.cord.lab:5004/monitoring/agent/openstack/start
49 stop_url: http://ceilometer-1.cord.lab:5004/monitoring/agent/openstack/stop
50
51EOF
52
53NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
54I=0
55for NODE in $NODES; do
56 echo $I - $NODE
57 I=$(( I+1 ))
58 cat >> $FN <<EOF
59 os_monitoring_agent_cp_${I}:
60 description: Openstack Monitoring agent info for ${NODE}
61 type: tosca.nodes.InfraMonitoringAgentInfo
62 properties:
63 start_url: http://$NODE.cord.lab:5004/monitoring/agent/openstack/start
64 stop_url: http://$NODE.cord.lab:5004/monitoring/agent/openstack/stop
65
66EOF
67done
68
69cat >> $FN <<EOF
70 os_monitoring_collector_plugin:
71 description: Infra Monitoring collector plugin info
72 type: tosca.nodes.MonitoringCollectorPluginInfo
73 properties:
74 plugin_folder_path: /opt/xos/synchronizers/monitoring/ceilometer/ceilometer-plugins/network/ext_services/openstack_infra/
75 plugin_rabbit_exchange: openstack_infra
76
77 openstack_monitoring_publisher_tenant:
78 description: OpenStack Monitoring Publisher Tenant
79 type: tosca.nodes.OpenStackMonitoringPublisher
80 requirements:
81 - provider_service:
82 node: service_ceilometer
83 relationship: tosca.relationships.TenantOfService
84 - monitoring_collector_plugin:
85 node: os_monitoring_collector_plugin
86 relationship: tosca.relationships.ProvidesMonitoringCollectorPluginInfo
87 - monitoring_agent_1:
88 node: os_monitoring_agent_head_node
89 relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo
90EOF
91I=0
92for NODE in $NODES; do
93 I=$(( I+1 ))
94 J=$(( I+1 ))
95 cat >> $FN <<EOF
96 - monitoring_agent_${J}:
97 node: os_monitoring_agent_cp_${I}
98 relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo
99EOF
100done
101