echo "--> build_adapter_ubuntu.sh starts"
# Install RMR from deb packages at packagecloud.io
-rmr=rmr_3.7.2_amd64.deb
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/$rmr/download.deb
+rmr=rmr_4.0.2_amd64.deb
+wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmr/download.deb
sudo dpkg -i $rmr
rm $rmr
-rmrdev=rmr-dev_3.7.2_amd64.deb
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/$rmrdev/download.deb
+rmrdev=rmr-dev_4.0.2_amd64.deb
+wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmrdev/download.deb
sudo dpkg -i $rmrdev
rm $rmrdev
go build -a -installsuffix cgo -ldflags "-X main.Version=$tag -X main.Hash=$hash" -o alarm-adapter ./cmd/*.go
# Execute UT and measure coverage for the Alarm Library
-#cd ../alarm && go test . -v -coverprofile cover.out
+cd ../alarm && go test . -v -coverprofile cover.out
# And for the Alarm Adapter
cd ../adapter && go test -v -p 1 -coverprofile cover.out ./cmd/ -c -o ./adapter_test && ./adapter_test
"alertname": alarmDef.AlarmText,
"severity": string(newAlarm.PerceivedSeverity),
"service": fmt.Sprintf("%s:%s", newAlarm.ManagedObjectId, newAlarm.ApplicationId),
- "system_name": "RIC",
+ "system_name": fmt.Sprintf("RIC:%s:%s", newAlarm.ManagedObjectId, newAlarm.ApplicationId),
}
amAnnotations := models.LabelSet{
- "alarm_id": string(alarmDef.AlarmId),
- "description": newAlarm.IdentifyingInfo,
+ "alarm_id": fmt.Sprintf("%d", alarmDef.AlarmId),
+ "description": fmt.Sprintf("%d:%s:%s", newAlarm.SpecificProblem, newAlarm.IdentifyingInfo, newAlarm.AdditionalInfo),
"additional_info": newAlarm.AdditionalInfo,
"summary": alarmDef.EventType,
"instructions": alarmDef.OperationInstructions,
}
alertParams := alert.NewPostAlertsParams().WithAlerts(models.PostableAlerts{pa})
- app.Logger.Info("Posting alerts: labels: %v, annotations: %v", amLabels, amAnnotations)
+ app.Logger.Info("Posting alerts: labels: %+v, annotations: %+v", amLabels, amAnnotations)
ok, err := a.NewAlertmanagerClient().Alert.PostAlerts(alertParams)
if err != nil {
app.Logger.Error("Posting alerts to '%s/%s' failed with error: %v", a.amHost, a.amBaseUrl, err)