From f7de093305415af1e6f4f82cd0721508f449cc86 Mon Sep 17 00:00:00 2001 From: Jorge Saffe Date: Tue, 14 Sep 2021 12:24:26 -0300 Subject: [PATCH] Fix snmp trap (Coldstart, Warmstart, or other Fault Managment alarm traps) behaviour on IPv6 environments. Modifications have been made in the containers of the snmp-armada-app, and deployment and values files of helm chart package. The following changes are made: 1. Bootstrap.sh scripts of snmp trap-subagent and sub-agent were modified to waits until the master agent container is up, to intialize them. 2. Add an environment variable to set the maxium numer or tries until raise a communication error and restart the pod. 3. Add other environment variables for testing purpose that can be modified with a helm override, like the master agent address and port. 4. Add an init_container in the snmp pod thats applies a delay when de pod starts, to solve ColdStart traps missing. Closes-Bug: 1943612 Signed-off-by: Jorge Saffe Change-Id: I2cd4a6309e99ba73257253077dc13b3b725043dd --- .../docker/stx-fm-subagent/bootstrap.sh | 28 ++++++++++++++++++- .../docker/stx-fm-trap-subagent/bootstrap.sh | 28 ++++++++++++++++++- .../snmp/templates/deployment.yaml | 13 ++++++++- .../helm-charts/snmp/values.yaml | 2 ++ 4 files changed, 68 insertions(+), 3 deletions(-) diff --git a/stx-snmp-helm/centos/docker/stx-fm-subagent/bootstrap.sh b/stx-snmp-helm/centos/docker/stx-fm-subagent/bootstrap.sh index e62e107..90a9bed 100755 --- a/stx-snmp-helm/centos/docker/stx-fm-subagent/bootstrap.sh +++ b/stx-snmp-helm/centos/docker/stx-fm-subagent/bootstrap.sh @@ -15,8 +15,34 @@ if [ "$OPTIONDEBUG" != "" ]; then esac fi +# Waiting master agent initialization +if [ "$MASTER_AGENT_HOST" == "" ]; then + MASTER_AGENT_HOST="localhost"; +fi + +if [ "$MASTER_AGENT_PORT" == "" ]; then + MASTER_AGENT_PORT=705; +fi + +if [ "$MASTER_AGENT_CONNECTION_RETRIES" == "" ]; then + MASTER_AGENT_CONNECTION_RETRIES=20; +fi + +HOST=$MASTER_AGENT_HOST +PORT=$MASTER_AGENT_PORT +RETRIES=$MASTER_AGENT_CONNECTION_RETRIES + +echo "Waiting master agent initialization ($HOST:$PORT) [MaxRetries:$RETRIES]" +counter=0 +until