Srikanth Vavilapalli | 7da3c5e | 2016-10-13 17:50:21 +0000 | [diff] [blame] | 1 | FN=$SETUPDIR/inframonitoring.yaml |
| 2 | |
| 3 | rm -f $FN |
| 4 | |
| 5 | cat >> $FN <<EOF |
| 6 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 7 | |
| 8 | description: Auto generated file to enable monitoring of infrastructure services (OpenStack, ONOS...etc). |
| 9 | |
| 10 | imports: |
| 11 | - custom_types/xos.yaml |
| 12 | - custom_types/monitoring_tosca_types.yaml |
| 13 | |
| 14 | topology_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 Vavilapalli | 7da3c5e | 2016-10-13 17:50:21 +0000 | [diff] [blame] | 33 | 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 | |
| 40 | EOF |
| 41 | |
| 42 | NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' ) |
| 43 | I=0 |
| 44 | for 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 | |
| 55 | EOF |
| 56 | done |
| 57 | |
| 58 | cat >> $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 Vavilapalli | 6594b75 | 2016-12-13 00:31:13 +0000 | [diff] [blame] | 79 | - monitoring_agent_2: |
| 80 | node: onos_monitoring_agent_head_node |
| 81 | relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo |
Srikanth Vavilapalli | 7da3c5e | 2016-10-13 17:50:21 +0000 | [diff] [blame] | 82 | EOF |
| 83 | I=0 |
| 84 | for NODE in $NODES; do |
| 85 | I=$(( I+1 )) |
Srikanth Vavilapalli | 6594b75 | 2016-12-13 00:31:13 +0000 | [diff] [blame] | 86 | J=$(( I+2 )) |
Srikanth Vavilapalli | 7da3c5e | 2016-10-13 17:50:21 +0000 | [diff] [blame] | 87 | cat >> $FN <<EOF |
| 88 | - monitoring_agent_${J}: |
| 89 | node: os_monitoring_agent_cp_${I} |
| 90 | relationship: tosca.relationships.ProvidesInfraMonitoringAgentInfo |
| 91 | EOF |
| 92 | done |
| 93 | |