You can update the packages using one of the following methods:

  • Method 1: Using OpsRamp Agent Remote Script (Recommended)
  • Method 2: Manual Execution

Method 1: Using OpsRamp Agent Remote Script

  1. Navigate to Automation > Scripts v2.
  2. Create a Script Category (Global, Partner-specific, or Client-specific).
  3. Click the Add to create a new script. Provide the following script details:
    • Name: Package Upgrade (Example)
    • Description: Patch script
    • Execution Time: 60 seconds
    • Platform: Linux
  4. Paste this following script in the script content:
    #!/bin/bash
    set -x
    export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
    
    # Version thresholds
    MIN_VERSION="18.0.0"
    MAX_VERSION="20.1.2"
    
    # Usage:
    #   $0 <registry-url> [repo-user] [repo-pass]
    #   $0 <namespace> <registry-url> [repo-user] [repo-pass]
    if [[ -z "$1" ]]; then
      echo "Usage: $0 [namespace] <registry-url> [repo-user] [repo-pass]"
      echo "Example (default ns): $0 us-central1-docker.pkg.dev"
      echo "Example (explicit ns): $0 default us-central1-docker.pkg.dev"
      exit 1
    fi
    
    # Namespace is optional; defaults to "default" when not provided
    if [[ -z "$2" ]]; then
      # $1 = registry, $2/$3 = optional creds
      NAMESPACE="default"
      REGISTRY="$1"
      REPO_USER="$2"
      REPO_PASS="$3"
    else
      # $1 = namespace, $2 = registry, $3/$4 = optional creds
      NAMESPACE="$1"
      REGISTRY="$2"
      REPO_USER="$3"
      REPO_PASS="$4"
    fi
    
    # Chart path (with runtime registry)
    CHART_PATH="oci://$REGISTRY/opsramp-registry/gateway-cluster-charts/webprobe"
    
    # Version comparison helpers
    version_gte() {
      [ "$1" = "$(printf "%s\n%s" "$2" "$1" | sort -V | tail -n1)" ]
    }
    
    version_lt() {
      [ "$1" != "$2" ] && [ "$1" = "$(printf "%s\n%s" "$1" "$2" | sort -V | head -n1)" ]
    }
    
    # Check if webprobe is installed in the namespace
    if ! helm list -n "$NAMESPACE" --filter '^webprobe$' --no-headers | awk '{print $1}' | grep -qx 'webprobe'; then
      echo "webprobe is not installed in namespace '$NAMESPACE' — skipping helm upgrade."
    else
      # Get current deployed chart/app version (kept similar to original logic)
      CURRENT_VERSION="$(helm list --filter '^webprobe$' -n "$NAMESPACE" | awk 'NR==2 {print $9}' | awk -F '-' '{print $NF}')"
    
      if [[ -z "$CURRENT_VERSION" ]]; then
        echo "Unable to determine current webprobe version in namespace '$NAMESPACE' — skipping helm upgrade."
      else
        # Only upgrade if: CURRENT_VERSION >= 18.0.0 AND CURRENT_VERSION < 20.1.2
        if version_gte "$CURRENT_VERSION" "$MIN_VERSION" && version_lt "$CURRENT_VERSION" "$MAX_VERSION"; then
          echo "Version $CURRENT_VERSION is >= $MIN_VERSION and < $MAX_VERSION — proceeding with repo login and upgrade..."
    
          # Only login if creds are provided, and only in the eligible upgrade path
          if [[ -n "$REPO_USER" && -n "$REPO_PASS" ]]; then
            helm registry login "$REGISTRY" -u "$REPO_USER" -p "$REPO_PASS"
          fi
    
          helm upgrade webprobe \
            "$CHART_PATH" \
            --version 20.1.2 -n "$NAMESPACE"
    
          helm list --filter '^webprobe$' -n "$NAMESPACE"
        else
          echo "Version $CURRENT_VERSION is not in the eligible range (>= $MIN_VERSION and < $MAX_VERSION) — skipping helm upgrade."
        fi
      fi
    fi
    
    #--------------------------------
    
    # Define working directory
    WORKDIR="/tmp"
    PATCH_ARCHIVE="2012-nextgenpatch.tar.gz"
    PATCH_FOLDER="2012patch"
    
    cd "$WORKDIR"
    
    wget -q "https://opsramp-gateway.s3.us-east-2.amazonaws.com/NextgenGW/PatchFiles/Patch-2000/$PATCH_ARCHIVE"
    
    mkdir -p "$PATCH_FOLDER"
    tar -xzf "$PATCH_ARCHIVE" -C "$PATCH_FOLDER"
    
    cd "$PATCH_FOLDER"
    
    if [ -f build.sh ]; then
      sh build.sh
    else
      echo "Error: build.sh not found in $PATCH_FOLDER"
      exit 1
    fi
  5. Click on Parameters and add the following parameters to the script.
    ISO download
  6. Save the script
  7. Schedule the script execution:
    • Select the script
    • Click Schedule (right panel)
    • Fill in details:
      • Schedule Name
      • Target Resource(s)
      • Schedule Type: One-time
  8. Ensure all parameter values are correctly set.
  9. Click Save.
  10. Run the Scheduled Script from the Scheduled Script section.
  11. Review Execution Logs from the right-side panel for the status.

Method 2: Manual Execution

Use this if Agent based execution isn’t possible.

Prerequisites

  • Access to the gateway system
  • Appropriate user credentials

Steps for Manual Execution:

  1. Login to Gateway using: gateway-admin if nextgen gateway running with Ubuntu 22 only.
  2. Take root access by using the following command and enter password:

sudo su -
3. Create a new file named update.sh and add the following shell script to it.

#!/bin/bash
set -x
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

# Version thresholds
MIN_VERSION="18.0.0"
MAX_VERSION="20.1.2"

# Usage:
#   $0 <registry-url> [repo-user] [repo-pass]
#   $0 <namespace> <registry-url> [repo-user] [repo-pass]
if [[ -z "$1" ]]; then
  echo "Usage: $0 [namespace] <registry-url> [repo-user] [repo-pass]"
  echo "Example (default ns): $0 us-central1-docker.pkg.dev"
  echo "Example (explicit ns): $0 default us-central1-docker.pkg.dev"
  exit 1
fi

# Namespace is optional; defaults to "default" when not provided
if [[ -z "$2" ]]; then
  # $1 = registry, $2/$3 = optional creds
  NAMESPACE="default"
  REGISTRY="$1"
  REPO_USER="$2"
  REPO_PASS="$3"
else
  # $1 = namespace, $2 = registry, $3/$4 = optional creds
  NAMESPACE="$1"
  REGISTRY="$2"
  REPO_USER="$3"
  REPO_PASS="$4"
fi

# Chart path (with runtime registry)
CHART_PATH="oci://$REGISTRY/opsramp-registry/gateway-cluster-charts/webprobe"

# Version comparison helpers
version_gte() {
  [ "$1" = "$(printf "%s\n%s" "$2" "$1" | sort -V | tail -n1)" ]
}

version_lt() {
  [ "$1" != "$2" ] && [ "$1" = "$(printf "%s\n%s" "$1" "$2" | sort -V | head -n1)" ]
}

# Check if webprobe is installed in the namespace
if ! helm list -n "$NAMESPACE" --filter '^webprobe$' --no-headers | awk '{print $1}' | grep -qx 'webprobe'; then
  echo "webprobe is not installed in namespace '$NAMESPACE' — skipping helm upgrade."
else
  # Get current deployed chart/app version (kept similar to original logic)
  CURRENT_VERSION="$(helm list --filter '^webprobe$' -n "$NAMESPACE" | awk 'NR==2 {print $9}' | awk -F '-' '{print $NF}')"

  if [[ -z "$CURRENT_VERSION" ]]; then
    echo "Unable to determine current webprobe version in namespace '$NAMESPACE' — skipping helm upgrade."
  else
    # Only upgrade if: CURRENT_VERSION >= 18.0.0 AND CURRENT_VERSION < 20.1.2
    if version_gte "$CURRENT_VERSION" "$MIN_VERSION" && version_lt "$CURRENT_VERSION" "$MAX_VERSION"; then
      echo "Version $CURRENT_VERSION is >= $MIN_VERSION and < $MAX_VERSION — proceeding with repo login and upgrade..."

      # Only login if creds are provided, and only in the eligible upgrade path
      if [[ -n "$REPO_USER" && -n "$REPO_PASS" ]]; then
        helm registry login "$REGISTRY" -u "$REPO_USER" -p "$REPO_PASS"
      fi

      helm upgrade webprobe \
        "$CHART_PATH" \
        --version 20.1.2 -n "$NAMESPACE"

      helm list --filter '^webprobe$' -n "$NAMESPACE"
    else
      echo "Version $CURRENT_VERSION is not in the eligible range (>= $MIN_VERSION and < $MAX_VERSION) — skipping helm upgrade."
    fi
  fi
fi

#--------------------------------

# Define working directory
WORKDIR="/tmp"
PATCH_ARCHIVE="2012-nextgenpatch.tar.gz"
PATCH_FOLDER="2012patch"

cd "$WORKDIR"

wget -q "https://opsramp-gateway.s3.us-east-2.amazonaws.com/NextgenGW/PatchFiles/Patch-2000/$PATCH_ARCHIVE"

mkdir -p "$PATCH_FOLDER"
tar -xzf "$PATCH_ARCHIVE" -C "$PATCH_FOLDER"

cd "$PATCH_FOLDER"

if [ -f build.sh ]; then
  sh build.sh
else
  echo "Error: build.sh not found in $PATCH_FOLDER"
  exit 1
fi
  1. Save the file.

  2. Grant permission to the file using the following command:

     
      chmod +x update.sh
      

  3. Run the script using the following command:

    a. Command with namespace and reposiotry

    ./updater.sh <namespace> <repository>
    Examples:

    • With default namespace and default repository
      ./updater.sh <namespace> <repository>
    • With custom namespace and default repository
      ./updater.sh <namespace> <repository>
    • With custom namespace and custom repository with no credentials
      ./updater.sh <namespace> <repository>

    b. Command with namespace and custom repository with authorization

    ./updater.sh <namespace> <repository_name> < repository_username < repository_password>
    Example
    sh updater.sh gateway-namespace custom-repository repository_username repository_password

  4. Verify the Webprobe Helm version (should be 20.0.1).

    helm list | grep webprobe

  5. Access the Webprobe container:

    kubectl exec -it -n <namespace> webprobe-0 -- bash

  6. Check the installed browser/driver versions:

    msedgedriver --version
    google-chrome --version
    chromedriver --version
    dpkg -l | grep -E "chrome|edge"

  7. Exit the webprobe pod by running:

    exit

  8. To verify the updated kernel and open-vm-tools versions, run the following commands:

    uname -r
    dpkg -l | grep "open-vm-tools"

Expected Versions:

PackageExpected Version
Google Chrome144.0.7559.96
Microsoft Edge144.0.3719.82
Open-vm-tools2:12.3.5-3~ubuntu0.22.04.3
Linux Kernels5.15.0-164-generic

Note: Make sure to reboot the gateway to reflect the updated kernel version.