Add AlertManager bind address
[ric-plt/vespamgr.git] / cmd / vesmgr / vesmgr.go
index aeebb15..0e775f8 100755 (executable)
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
+ *
+ *  This source code is part of the near-RT RIC (RAN Intelligent Controller)
+ *  platform project (RICP).
+ *
  */
 
 package main
@@ -52,6 +56,13 @@ type subscriptionNotification struct {
 
 var logger *mdcloggo.MdcLogger
 
+// Version information, which is filled during compilation
+// Version tag of vesmgr container
+var Version string
+
+// Hash of the git commit used in building
+var Hash string
+
 const vesmgrXappNotifPort = "8080"
 const vesmgrXappNotifPath = "/vesmgr_xappnotif/"
 const timeoutPostXAppSubscriptions = 5
@@ -101,6 +112,8 @@ func (vesmgr *VesMgr) subscribeXAppNotifications() {
 // Init initializes the vesmgr
 func (vesmgr *VesMgr) Init(listenPort string) *VesMgr {
        logger.Info("vesmgrInit")
+       logger.Info("version: %s (%s)", Version, Hash)
+
        var err error
        if vesmgr.myIPAddress, err = getMyIP(); err != nil || vesmgr.myIPAddress == "" {
                logger.Error("Cannot get myIPAddress: IP %s, err %s", vesmgr.myIPAddress, err.Error())
@@ -125,7 +138,8 @@ func (vesmgr *VesMgr) Init(listenPort string) *VesMgr {
        vesmgr.httpServer.init(vesmgr.myIPAddress + ":" + listenPort)
        vesmgr.vesagent = makeRunner("ves-agent", "-i", os.Getenv("VESMGR_HB_INTERVAL"),
                "-m", os.Getenv("VESMGR_MEAS_INTERVAL"), "--Measurement.Prometheus.Address",
-               os.Getenv("VESMGR_PROMETHEUS_ADDR"))
+               os.Getenv("VESMGR_PROMETHEUS_ADDR"), "--AlertManager.Bind", os.Getenv("VESMGR_ALERTMANAGER_BIND_ADDR"),
+               "--Debug")
        return vesmgr
 }