blob: 00fc529a699a586b019ec4f7cfbdd8de5e412ab9 [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
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +000033 os_monitoring_agent_head_node:
34 description: Openstack Monitoring agent info
35 type: tosca.nodes.InfraMonitoringAgentInfo
36 properties:
37 start_url: http://ceilometer-1.cord.lab:5004/monitoring/agent/openstack/start
38 stop_url: http://ceilometer-1.cord.lab:5004/monitoring/agent/openstack/stop
39
40EOF
41
42NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
43I=0
44for NODE in $NODES; do
45 echo $I - $NODE
46 I=$(( I+1 ))
47 cat >> $FN <<EOF
48 os_monitoring_agent_cp_${I}:
49 description: Openstack Monitoring agent info for ${NODE}
50 type: tosca.nodes.InfraMonitoringAgentInfo
51 properties:
52 start_url: http://$NODE.cord.lab:5004/monitoring/agent/openstack/start
53 stop_url: http://$NODE.cord.lab:5004/monitoring/agent/openstack/stop
54
55EOF
56done
57
58cat >> $FN <<EOF
59 os_monitoring_collector_plugin:
60 description: Infra Monitoring collector plugin info
61 type: tosca.nodes.MonitoringCollectorPluginInfo
62 properties:
63 plugin_folder_path: /opt/xos/synchronizers/monitoring/ceilometer/ceilometer-plugins/network/ext_services/openstack_infra/
64 plugin_rabbit_exchange: openstack_infra
65
66 openstack_monitoring_publisher_tenant:
67 description: OpenStack Monitoring Publisher Tenant
68 type: tosca.nodes.OpenStackMonitoringPublisher
69 requirements:
70 - provider_service:
71 node: service_ceilometer
72 relationship: tosca.relationships.TenantOfService
73 - monitoring_collector_plugin:
74 node: os_monitoring_collector_plugin
75 relationship: tosca.relationships.ProvidesMonitoringCollectorPluginInfo
76 - monitoring_agent_1:
77 node: os_monitoring_agent_head_node
78 relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo
Srikanth Vavilapalli6594b752016-12-13 00:31:13 +000079 - monitoring_agent_2:
80 node: onos_monitoring_agent_head_node
81 relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +000082EOF
83I=0
84for NODE in $NODES; do
85 I=$(( I+1 ))
Srikanth Vavilapalli6594b752016-12-13 00:31:13 +000086 J=$(( I+2 ))
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +000087 cat >> $FN <<EOF
88 - monitoring_agent_${J}:
89 node: os_monitoring_agent_cp_${I}
90 relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo
91EOF
92done
93