Update RMR version, and max active and alarm history thresholds 30/5130/1
authorAnssi Mannila <anssi.mannila@nokia.com>
Fri, 20 Nov 2020 12:50:00 +0000 (14:50 +0200)
committerAnssi Mannila <anssi.mannila@nokia.com>
Fri, 20 Nov 2020 12:50:20 +0000 (14:50 +0200)
Change-Id: I7298af59f18461528e2a21df33063ff39ec86458
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
build/build_ubuntu.sh
build/container-tag.yaml
go.mod
manager/cmd/manager.go

index 44619c4..b18b68d 100755 (executable)
 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
 
index 5349da6..2300e89 100644 (file)
@@ -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 (file)
--- 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
index 6ccf4ac..88d90cf 100755 (executable)
@@ -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"),