From ac56b89c5f6f12f221b4ed772644ab74437b457d Mon Sep 17 00:00:00 2001 From: Anssi Mannila Date: Fri, 20 Nov 2020 14:50:00 +0200 Subject: [PATCH] Update RMR version, and max active and alarm history thresholds Change-Id: I7298af59f18461528e2a21df33063ff39ec86458 Signed-off-by: Anssi Mannila --- build/build_ubuntu.sh | 8 ++++---- build/container-tag.yaml | 2 +- go.mod | 2 ++ manager/cmd/manager.go | 22 ++++++++++++++++++++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/build/build_ubuntu.sh b/build/build_ubuntu.sh index 44619c4..b18b68d 100755 --- a/build/build_ubuntu.sh +++ b/build/build_ubuntu.sh @@ -22,12 +22,12 @@ echo "--> build_ubuntu.sh starts" # Install RMR from deb packages at packagecloud.io -rmr=rmr_4.1.2_amd64.deb -wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmr/download.deb +rmr=rmr_4.4.4_amd64.deb +wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/$rmr/download.deb sudo dpkg -i $rmr rm $rmr -rmrdev=rmr-dev_4.1.2_amd64.deb -wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmrdev/download.deb +rmrdev=rmr-dev_4.4.4_amd64.deb +wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/$rmrdev/download.deb sudo dpkg -i $rmrdev rm $rmrdev diff --git a/build/container-tag.yaml b/build/container-tag.yaml index 5349da6..2300e89 100644 --- a/build/container-tag.yaml +++ b/build/container-tag.yaml @@ -2,4 +2,4 @@ # By default this file is in the docker build directory, # but the location can configured in the JJB template. --- -tag: 0.5.8 +tag: 0.5.9 diff --git a/go.mod b/go.mod index b6ae937..0fb43fa 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,8 @@ require ( github.com/gorilla/mux v1.7.1 github.com/jedib0t/go-pretty v4.3.0+incompatible github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/prometheus/alertmanager v0.20.0 github.com/spf13/viper v1.6.2 github.com/stretchr/testify v1.5.1 diff --git a/manager/cmd/manager.go b/manager/cmd/manager.go index 6ccf4ac..88d90cf 100755 --- a/manager/cmd/manager.go +++ b/manager/cmd/manager.go @@ -378,7 +378,15 @@ func (a *AlarmManager) StatusCB() bool { func (a *AlarmManager) ConfigChangeCB(configparam string) { a.maxActiveAlarms = app.Config.GetInt("controls.maxActiveAlarms") + if a.maxActiveAlarms == 0 { + a.maxActiveAlarms = 5000 + } + a.maxAlarmHistory = app.Config.GetInt("controls.maxAlarmHistory") + if a.maxAlarmHistory == 0 { + a.maxAlarmHistory = 20000 + } + a.alertInterval = viper.GetInt("controls.promAlertManager.alertInterval") a.amHost = viper.GetString("controls.promAlertManager.address") @@ -493,6 +501,16 @@ func NewAlarmManager(amHost string, alertInterval int, clearAlarm bool) *AlarmMa amHost = viper.GetString("controls.promAlertManager.address") } + maxActiveAlarms := app.Config.GetInt("controls.maxActiveAlarms") + if maxActiveAlarms == 0 { + maxActiveAlarms = 5000 + } + + maxAlarmHistory := app.Config.GetInt("controls.maxAlarmHistory") + if maxAlarmHistory == 0 { + maxAlarmHistory = 20000 + } + return &AlarmManager{ rmrReady: false, postClear: clearAlarm, @@ -503,8 +521,8 @@ func NewAlarmManager(amHost string, alertInterval int, clearAlarm bool) *AlarmMa activeAlarms: make([]AlarmNotification, 0), alarmHistory: make([]AlarmNotification, 0), uniqueAlarmId: 0, - maxActiveAlarms: app.Config.GetInt("controls.maxActiveAlarms"), - maxAlarmHistory: app.Config.GetInt("controls.maxAlarmHistory"), + maxActiveAlarms: maxActiveAlarms, + maxAlarmHistory: maxAlarmHistory, exceededActiveAlarmOn: false, exceededAlarmHistoryOn: false, alarmInfoPvFile: app.Config.GetString("controls.alarmInfoPvFile"), -- 2.16.6