Configure the Resource Monitor Using staresmonadm

Use the staresmonadm utility to configure the resource monitor (Resmon).

Prerequisites

Parameters

The staresmonadm utility uses the parameters listed in the table below. To enable, you must specify all required parameters. You can submit as many parameters as you want in each staresmonadm command line. The utility only updates the parameters you specify. The unspecified parameters remain at their current value.

Some settings (denoted by * in the table) require you to stop and restart the Services Daemon if you want the setting to take effect immediately. Otherwise these changes take effect as soon as the backup service wakes from its current sleep interval. See Services Daemon - Stop, Restart, or Show Status.

A value of "-1" indicates the parameter is not configured.

Table 4-2 staresmonadm Parameters

Name Parameter Description Default Value

Query

-Q, --query

Display the current Resmon settings.

None

Clear

-C, --clear

Clear all Resmon settings and disable the service.

None

Verbose

-v, --verbose

Enables verbose mode, which displays detailed progress information for the command.

None

Help

-h, --help

Displays complete syntax information for the command.

None

Daily report time (required)

-T, --time

Time of day Resmon sends the Resource Report. Format is hh:mm, using 24-hour time.

The report is sent automatically every 24 hours at approximately this time. The actual time is immediately after the first server scan performed after this time.

00:00

Scan Interval* (required)

-i, --interval

Time in seconds Resmon waits between scans. Valid entries: integers greater than 0.

300

Alert nagging*

-n, --nag

Indicates whether Resmon sends alerts if it finds that any high-water marks have been reached. Valid entries: on|off, yes|no, true|false, 1|0.

When enabled, Resmon sends alert reports whenever it performs a periodic scan and detects a resource has exceeded its high-water mark (as opposed to just sending during the daily report).

off

Database username* (required)

-U, --dbusr

Database username that the Resmon service uses to perform queries against the information_schema tables and the MySQL server internal system global variables.

This must be a user with full access to the STA database, either the STA database root user or the STA database administrator.

blank

Database password* (required)

-P, --dbpwd

Password assigned to the database username.

blank

Database tablespace HWM* (required)

-t, --tblsphwm

High-water mark for the database tablespace, entered as a percentage of the total allocated. Valid entries: integers 0–100

Oracle recommends that usage never exceeds 80 percent.

-1

Local backup HWM* (required)

-b, --backvolhwm

High-water mark for the STA database local backups volume (for example, /dbbackup), entered as a percentage of the total allocated. Valid entries: integers 0 –100

Oracle recommends that usage never exceeds 80 percent.

-1

Database disk volume HWM* (required)

-d, --dbvolhwm

High-water mark for the STA database volume (for example, /dbdata/mysql ), entered as a percentage of the total allocated. Valid entries: integers 0 –100

Oracle recommends that usage never exceeds 80 percent.

-1

Logging disk volume HWM* (required)

-l, --logvolhwm

High-water mark for the STA database logs volume (default is /var/log/tbi), entered as a percentage of the total allocated. Valid entries: integers 0 –100

Oracle recommends that usage never exceeds 80 percent.

-1

Root volume HWM* (required)

-z, --rootvolhwm

High-water mark for the root volume (/), entered as a percentage of the total allocated. Valid entries: integers 0 –100

Oracle recommends that usage never exceeds 80 percent.

-1

Tmp volume HWM* (required)

-x, --tmpvolhwm

High-water mark for the temporary directory volume (default is /tmp), entered as a percentage of the total allocated. Valid entries: integers 0 –100

Oracle recommends that usage never exceeds 80 percent.

-1

Physical memory (RAM) HWM*

-m, --memhwm

High-water mark for the total system memory (except virtual memory), entered as a percentage of the total allocated. Valid entries: integers 0 –100

Oracle recommends that usage never exceeds 80 percent.

-1

Email from*

-f, --from

Name or email address that appears in the "From" field of emails sent by the Resmon service.

StaResMon@localhost

Email recipients* (required)

-r, --recips

Email addresses to which Resmon sends the daily Resource Report and periodic Resource Depletion Alert Report. Entered as a colon-delimited list (such as .

blank

Email subject*

-s, --subject

Text string that appears in the "Subject" field of the standard daily report email, up to 128 characters. Enclose the text string in single-quotes (') or double-quotes (") if it contains spaces.

A time stamp in yyyy-mm-dd hh:mm:ss form is appended to your entry when the email is sent.

STA Resource Monitor Report

Output data file

-o, --outfile

Absolute path of the Resource Report data file. The file name must end in .csv. The database user must have privileges to the directory.

/var/log/tbi/db/staresmon.csv


Display Current Resmon Settings

Display the current settings for the Resmon service to determine if it is enabled.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. Display the current Resmon settings.

    $ staresmonadm -Q
    

    In this example, the Resmon service is enabled and configured.

    $ staresmonadm –Q
    Contacting daemon...connected.
    Querying Preferences.
     Current STA Resource Monitor Service Settings:
       Configured                        [yes]
       Send Reports                   -T [23:05]
       Sleep Interval                 -i [3600 sec]
       Alert Nagging                  -n [off]
       DB Username                    -U [stadba]
       DB Password                    -P [********]
       DB Tablespace hwm              -t [80%]
       DB Backup hwm   (/dbbackup)    -b [70%]
       DB Data hwm     (/dbdata)      -d [75%]
       Log Volume hwm  (/var/log/tbi) -l [75%]
       Root Volume hwm (/)            -z [75%]
       Tmp Volume hwm  (/tmp)         -x [75%]
       System Memory hwm              -m [80%]
       Email 'From:'                  -f [STAResmon@staserver.mycompany.com]
       Email 'To:'                    -r [charlie@mycompany.com:lucy@mycompany.com]
       Email 'Subject:'               -s [STA Resource Monitor Report <staserver>]
       Output File                    -o [/var/log/tbi/db/staresmon.csv]
    

Enable the Resmon Service

Enable the Resmon service by defining required parameters. The Resmon service is disabled by default. Once enabled, the service scans the monitored resources on the STA server according to the defined settings.

  1. On the STA server, open a terminal session. Log in as the Oracle user.

  2. To enable the service, define the required parameters in one or more commands.

    For a list of all parameters, see the table in Configure the Resource Monitor Using staresmonadm.

    You must define at least the following settings:

    • All high-water marks, except system memory

    • Email 'To:'

    • Daily report send time

    • Sleep Interval

    • DB Username and Password—this is the database administrator user created during STA installation.

    For example:

    $ staresmonadm -t 80 -b 70 -d 75 -l 75 -z 75 -x 75 -m 80 -r charlie@mycompany.com -T 23:05 -i 3600 -U stadba -P
    
  3. Resmon will run its first scan at the time you have specified; you do not have to stop and restart the STA services daemon.

  4. If the utility fails with:

    Error: java.util.prefs.BackingStoreException: Couldn't get file lock.
    

    See ISSUE: Backup Service or Resource Monitor Fails.

Disable the Resmon Service

Disable the Resmon service by clearing all settings. When disabled, the service does not perform scans, send alerts, or produce reports.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. Clear all Resmon settings.

    $ staresmonadm -C
    
  3. The service is disabled immediately; you do not have to stop and restart the STA services daemon.

  4. If the utility fails with:

    Error: java.util.prefs.BackingStoreException: Couldn't get file lock.
    

    See ISSUE: Backup Service or Resource Monitor Fails.

Define Resmon Email Settings

Define email addresses to receive the daily Resource Report and periodic Resource Depletion Report. Define an email sender and subject line to help recipients identify and organize emails from the Resmon service.

Note:

The email server and sender address used by the Resmon service may be different than those used by the STA application. See the STA User's Guide for details about STA application emails.
  1. On the STA server, open a terminal session. Log in as the Oracle user.

  2. Define email information.

    • To specify multiple recipients, separate the email addresses by a colon (:).

    • If the subject text includes spaces, enclose the text line in double-quotes (") or single-quotes (').

    This example defines two email recipients, the email sender, and a subject line.

    $ staresmonadm -r charlie@mycompany.com:lucy@mycompany.com -f STAResmon@staserver.mycompany.com -s "STA Resource Monitor Report for staserver"
    
  3. If you want the new settings to take effect immediately, you must stop and restart the STA services daemon. See Services Daemon - Stop, Restart, or Show Status.

  4. If the utility fails with:

    Error: java.util.prefs.BackingStoreException: Couldn't get file lock.
    

    See ISSUE: Backup Service or Resource Monitor Fails.

Troubleshoot Resmon Email Issues

If you are not receiving emails from Resmon, use the logs to verify that the service is sending emails, check your email server and filter settings, and verify the Resmon settings are correct.

Check the staservd.log

If Resmon has sent out an email, it will be recorded in the log.

  1. Open the staservd.log located in the /var/log/tbi/db/backups directory.

  2. Look for the following messages:

    INFO: {StaResMon} Alert report email complete.
    
    INFO: {StaResMon} Standard report email complete.
    
  3. If you see either of the above messages, the Resmon service is sending emails. This means the issue may be with your email server or email filtering.

    If you don't see the above messages in the log, Resmon has not sent an email. Verify the Resmon settings are correct.

Check your email settings

The email service on your server may not be configured correctly or some email security features may be filtering out the Resmon emails. Make sure the "From" line has a legitimate host name. Use the staresmonadm -f command to modify.

Check the Resmon settings

If you did not see either of the logging message above and you are sure that Resmon should have sent an email based on the report time settings and alert settings, then verify the Resmon settings are correct. Use the staresmonadm -Q command to view the current settings. Make sure the DB username and password are set correctly for the STA DB mysql application.

Define Resource Report Settings

Change the time of day when Resmon sends the Resource Report, the report file name, and location of the report file. If you specify a new file name, and the file does not already exist, the Resmon service creates it with the next scan.

  1. On the STA server, open a terminal session. Log in as the Oracle user.

  2. Define report information.

    • Use 24-hour notation to specify the time of day.

    • The file location must be an absolute, not relative, path. The database user must have read/write privileges to the directory.

    • The file name extension must be .csv.

    For example:

    $ staresmonadm -T 23:59 -o /var/log/tbi/db/ResmonReport.csv
    
  3. If you want the new settings to take effect immediately, you must stop and restart the STA services daemon. See Services Daemon - Stop, Restart, or Show Status.