2 ################################################################################
4 # Copyright 2022 highstreet technologies GmbH and others
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # https://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 ################################################################################
19 # Script to send an VES Message Event to DCAE
27 # exception for controller alarms
28 if [ "${pnfType^^}" == "SDNR" ]
30 eventType="ONAP_SDNR_Controller";
35 [controllerName]=$(hostname --fqdn)
36 [pnfId]=${pnfIdByType[$pnfType]}
37 [eventId]="${pnfIdByType[$pnfType]}_${interfaceByType[$pnfType]}_${alarmType}"
38 [eventType]=${eventType}
40 [interface]=${interfaceByType[$pnfType]}
42 [severity]=${severity}
43 [timestamp]=${timestamp}
44 [eventTime]=${eventTime}
45 [vendor]=${vendorsByType[$pnfType]^^}
46 [model]=${modelByType[$pnfType]}
49 echo "################################################################################";
50 echo "# send NotifyNewAlarm";
52 for key in "${!mapping[@]}"
54 #label=${${"$spaces$i"}:(-14)};
57 echo "$label: ${mapping[$key]}";
58 if [ $key = "timestamp" ]; then
59 sequence="$sequence s/\"@$key@\"/${mapping[$key]}/g; "
61 sequence="$sequence s/@$key@/${mapping[$key]}/g; "
66 body="./json/examples/${pnfType^^}-${alarmType}-${severity}-${domain}.json"
67 sed -e "$sequence" ./json/templates/$domain-notifyNewAlarm.json > $body;
69 curl -i -k -u $basicAuthVes -X POST -d @${body} --header "Content-Type: application/json" $urlVes