Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Validate the Consistency of the vCenter Server Appliance 6.5 and Newer Databases (53062)

Last Updated: 11/14/2023Categories: Best PracticesTotal Views: 11936Language:
English

19 like this article

Subscribe to get an email
newsletter with new updates

19 people found this helpful Please provide article feedback:

Purpose

The vpgsql-consistency-check.sh script, located under the Attachments section on the right side of this KB, performs a number of functions with it's primary function being a check of the selected database to ensure that all data can be read.
By reading out all of the data from the database we can verify that there are no issues present that will impede the operation of the database.

Along with checking the read consistency of the selected database(s) the vpgsql-consistency-check.sh script also does the following:

Backup selected database(s)

Vacuum the PostgreSQL database

Send an e-mail notification of the results of the selected operation(s)

Correct issue with Crontab to allow for the addition of this script to Crontab

Test SMTP settings to ensure e-mails will be received

Resolution

Configuration of the Script

Log into the vCenter Server Appliance as root via SSH or Console.Toggling the vCenter Server Appliance 6.x default shell

Make a directory for the script:

mkdir /scripts/

Copy the script to the vCenter Server Appliance under /scripts using an SCP utility.

Verify the script has proper rights:

chmod 744 /scripts/vpgsql-consistency-check.sh

(Optional): Configure SMTP to allow script to send e-mail notifications:

Follow the directions in the VMware Documentation to configure SMTP on your vCenter Server Appliance.

Log into the vCenter Server Appliance as root via SSH or Console.

Test SMTP functionality by running the following:

/scripts/vpgsql-consistency-check.sh -e e-mail -s

Note: Replace e-mail with the desired destination e-mail address

(Optional): Configure script to be run by Cron

Log into the vCenter Server Appliance as root via SSH or Console.

Then type shell.

Enable Crontab functionality:

/scripts/vpgsql-consistency-check.sh -c

Add the script to Crontab:

crontab -e

Type i to insert into file.

Copy the following into the file

00 02 * * * /scripts/vpgsql-consistency-check.sh Options

Note: Replace Options with the desired script options found in the Related Information section of this article..

Type :wq and press the Enter key to write the changes and close the file.

Note: The Crontab time format is Minutes Hour Day_of_the_Month Month Day_of_the_Week

Example: 00 02 * * * would run the script at 02:00 AM system time everyday of the month.

Execution of the Script

There are a number of options that can be simultaneously run.
For instance you can check the AFD and PostgreSQL databases, backup both databases to a defined location, and vacuum the PostgreSQL database.

Example: /scripts/vpgsql-consistency-check.sh -a -b -f /tmp/ -v
Note: In the above example; any errors will be reported to /var/log/vmware/vpostgres/VPG_Check-date/time_error.log.

The suggested execution of this script is:
/scripts/vpgsql-consistency-check.sh -a -b -f /location -v -e e-mail_address

Note: Replace location with the desired backup location and e-mail_address with the desired e-mail address.

In the above example; script messaging will be recorded to the default log file and an e-mail notification reflecting the status will be sent to the defined address.

Notes:

By default every execution of the script creates a /var/log/vmware/vpostgres/VPG_Check-date/time_error.log file.

When executing a backup of any database the script will ensure there is at least 10% of available disk space on the destination defined.  If there is not 10% free space the script will error out reporting this.

Related Information

Script Options:
-a enable backup of AFD
-b enable backup of VCDB
-f backup file location
-v vacuum VCDB DB
-e notify e-mail address
-s test SMTP (Requires -e option)
-c correct Crontab issue
-h help

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

vpgsql-consistency-check

vpgsql-consistency-check

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
VIDM 用户无法向 vRealize Log Insight 4.x 进行身份验证 (54995)

Results 1-2 of 2

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vCenter Server Appliance

VMware vCenter Server

Related Versions:

VMware vCenter Server Appliance 6.7.x

VMware vCenter Server Appliance 6.5.x

VMware vCenter Server 7.0.x

Take Our Survey

Support Assistant