scrutinize for VerticaDB

scrutinize is a command-line utility that collects diagnostic information about a Vertica cluster and packages it in a tar file.

The command outputs the tar file in /tmp/scrutinize/VerticaScrutinize.timestamp.tar. When resolving a support case, Vertica Support might request that you run scrutinize and upload the tar file to a secure location. For details about how to upload the tar file to Amazon Web Services (AWS) S3, see Uploading Scrutinize to an Amazon S3 Bucket for Vertica Advisor Report in the Vertica Knowledge Base.

Syntax

/opt/vertica/bin/vcluster scrutinize --hosts hosts --db-user username --password password --honor-user-input

Arguments

--hosts
Comma-separated list of fully qualified domain names (FQDN) or IP addresses of hosts that run Vertica server pods.
--db-user
Superuser username.
--password
Superuser password.
--honor-user-input
Forces the command to connect to the hosts with only the values passed on the command line.

Privileges

Superuser

Example

In a containerized environment, scrutinize requires multiple deployment-specific values. The following bash script gathers these values and then uses them to execute scrutinize in a running container:

#!/bin/bash

# store array of hosts in the "host_list" variable. The "-t" option removes newline characters
mapfile -t host_list < <(kubectl get pods -n namespace --selector app.kubernetes.io/instance=cr-name -o jsonpath='{range .items[*]}{.status.podIP}{"\n"}{end}')

# convert the "host_lists" array to a comma-separated string of hosts and store in "hosts"
hosts=$(IFS=, ; echo "${host_list[*]}")

# get the superuser name
superuser_op=$(kubectl get vdb -n namespace cr-name -o jsonpath='{.metadata.annotations.vertica\.com/superuser-name}')

# if "superuser_op" is not set, set it to "dbadmin"
superuser=${superuser_op:-dbadmin}

# get the superuser password
password_secret=$(kubectl get vdb -n namespace cr-name -o jsonpath='{.spec.passwordSecret}')

# if the superuser password was set, decode it from base64 to plain text. Otherwise, leave it as an empty string
if [[ -n "$password_secret" ]]
then
  password=$(kubectl get secret -n namespace $password_secret -o jsonpath='{.data.password}' | base64 -d)
else
  password=""
fi

# get a shell in a running container and execute scrutinize
scrut_out=$(kubectl exec -t -n namespace $pod -- /opt/vertica/bin/vcluster \
        scrutinize \
        --hosts=$hosts \
        --db-user=$superuser \
        --password=$password \
        --honor-user-input)

# if a tar file was generated, copy it to the local machine for Vertica support
regex="Scrutinize final result at $scrutinizeTmp/(.+\.tar)"
if [[ $scrut_out =~ $regex ]]
then
   tarFile=${BASH_REMATCH[1]}
   kubectl cp -n namespace $pod:$scrutinizeTmp/$tarFile $tarFile
else
   echo "Could not find location of scrutinize file"
fi