8.26. The tungsten_health_check Script

The tungsten_health_check may be used less frequently than Section 8.27, “The tungsten_monitor Script” to check the cluster against known best practices. It implements the Tungsten Script Interface as well as these additional options.

tungsten_health_check [ --dataservices ] [ --diagnostic-package  ] [ --directory ] [ --email ] [ --force  ] [ --from ] [ --help, -h ] [ --ignore ] [ --info, -i ] [ --json ] [ --lock-dir ] [ --lock-timeout  ] [ --mail  ] [ --net-ssh-option=key=value ] [ --notice, -n ] [ --show-differences  ] [ --subject ] [ --test-failover  ] [ --test-recover  ] [ --test-switch  ] [ --validate  ] [ --verbose, -v ]

Where:

Table 8.51. tungsten_health_check Command-line Options

OptionDescription
--dataservicesThis list of dataservices to monitoring to
--diagnostic-packageCreate a diagnostic package if any issues are found
--directoryThe $CONTINUENT_ROOT directory to use for running this command. It will default to the directory you use to run the script.
--emailEmail address to send to when mailing any notifications
--forceContinue operation even if script validation fails
--fromThe from address for sending messages
--help, -hShow help text
--ignoreIgnore notices that use this key
--info, -iDisplay info, notice, warning, and error messages
--jsonOutput all messages and the return code as a JSON object
--lock-dirDirectory to store log and lock files in
--lock-timeoutThe number of minutes to sleep a notice after sending it
--mailPath to the mail program to use for sending messages
--net-ssh-option=key=valueProvide custom SSH options to use for SSH communication to other hosts.
--notice, -nDisplay notice, warning, and error messages
--show-differencesShow any differences in Tungsten configuration
--subjectEmail subject line
--test-failoverTest failover for each managed dataservice
--test-recoverTest recover for each managed dataservice
--test-switchTest the switch command for each managed dataservice
--validateOnly run script validation
--verbose, -vVerbose

Each time the tungsten_health_check runs, it will run a standard set of checks. Additional checks may be turned on using command line options.

  • Check for errors using tpm validate

  • Check that all servers in the dataservice are running the same version of Continuent Tungsten

The script can be run manually:

shell> tungsten_health_check

All messages will be sent to /opt/continuent/share/tungsten_health_check/lastrun.log.

Sending results via email

The tungsten_health_check is able to send you an email when problems are found. It is suggested that you run the script as root so it is able to use the mail program without warnings.

Alerts are cached to prevent them from being sent multiple times and flooding your inbox. You may pass --reset to clear out the cache or --lock-timeout to adjust the amount of time this cache is kept. The default is 3 hours.

shell> tungsten_health_check --from=you@yourcompany.com --to=group@yourcompany.com

Showing manual configuration file changes

The tpm validate command will fail if you have manually changed a configuration file. The file differences may be added if you include the --show-differences argument.

Testing Continuent Tungsten functionality

Continuent Tungsten includes a testing infrastructure that you can use at any time. By adding the --test-switch, --test-failover or --test-recover arguments to the command, we will test these operations on each database server.

Caution

This will have an impact on dataservice availability. Limit this operation to maintenance windows or times when you can experience managed outages.

Compatibility

The script only works with MySQL at this time.