TSM Perl Monitoring Script - Group Project

jcarlock

ADSM.ORG Member
Joined
Aug 26, 2009
Messages
86
Reaction score
0
Points
0
Location
Atlanta, GA
I have written a rather large tsm script in perl (For UNIX/Linux currently). I have added a couple of options for portability, but I think its ready to have a larger group's input.

Knowledge of Perl and TSM's select queries is all you will need to add/modify/update. Some things are specifically tuned to my environment, specifically the executed command 'dsmpdmc' has an encyrpted version with the UID/PASS included, but this is a global variable easily adapted to your environment. Also, my Exchange backup validation, is VERY specific to my environment, you will need to manually update this...

Also, I use RegExp's to parse the output for the emails, you can remove this value completely from any scripts not giving proper output.

That being said, I will only be willing to give basic support for this script as my time is limited, but I thought this might be helpful.-

Here is the -help output:


TSM Consolidated Monitoring Script v0.9

This utility monitors a range of TSM critical status info.

$cmdhint

[OPTIONS]

-s : -scratch
Queries TSM for available scratch tapes and alerts
when there are less than $scratch_threshold tapes.

-c : -countses
Queries the number of active Node sessions actively
connected to TSM and alerts if there are more
sessions tha the threshold of $maxnumsessions.

-dr : -drivesoffline
Queries TSM for any LTO3 Tape drives that are offline
and alerts if there are any offline.

-dbch : -dbcachehit
Queries the current TSM database cache hit ratio and
alerts if the value is less than $cachehitthreshold%.

-dbpu : -dbpercentutil
Queries the current precent utilization of the TSM
database and alerts if it is using more than $dbputhreshold%.

-lpu : -logpercentutil
Queries the current precent utilization of the TSM
database log and alerts if it is using more than $logputhreshold%.

-w : -waitses
Queries TSM for the number of node sessions with a wait
time of over 60 minutes (3600 seconds).

-disks : -diskpoolusage(-disks)
Queries TSM for any disk pools utilizing over 95%
of there allocated disk space.

-dm : -datamovers
Queries TSM for any NDMP Datamovers that are not online.

-x : -exchangedaily
Queries TSM DB for the pervious day's backup and alerts
if the scheduled backup was unsuccessful.

-df : -dailyfailed
Queries daily failed status from TSM events and alerts
for any incomplete status from the TSM event table.

-ds : -dailysummary
Queries TSM to generate a daaily summary of Unsuccessful
backups/archives from the TSM summary table.

-ac : -access
Queries TSM for servers that have not accessed the server
in over 2 days.

-f : -frequent
Executes a set of jobs normally scheduled to run frequently.
Including:
- Scratch Tape Count
- High # of sessions
- Offline Drives
- DB Cache Hit
- DB Percent Utilization
- DB Log Percent Utilization
- High number of waiting sessions
- High Disk Pool Usage
- Offline Datamovers

-d : -daily
Executes a set of jobs normally run daily at 3:30 PM, including:
- Daily Exchange Backup Verification
- Daily Incomplete Events
- Daily Unsuccessful Backups/Archives Summary
- Daily Access Check

-a : -all
Runs all monitoring/reporting including daily and frequent jobs.

-h : -help
Prints this message.
 

Attachments

  • dsm-monitoring.txt
    14.8 KB · Views: 600
Two Options that MUST be configured before this will work is...

our $dsmadmc="dsmpdmc"; # Change to "dsmadmc -id=<yourID> -pa=<yourPASS>"
our $recipient='[email protected]'; # Change to desired recipient of all alerts
 
Thanks for sharing this. This is exacly what I am looking for as a starting point to grow my own customized reporting.
 
No problem. If you wouldn't mind posting any changes, or additions, I would greatly appreciate it.
 
i have problem with tsm sql command. when i try the sql command in TSM console, i get the result. If i try use in my script and i get error sql token. so what are different sql command in TSM console and script? should i add something into my script?
 
I am receiving below error while running perl script can some one guide me where I am doing the mistake..

syntax error at monitor.pl line 35, near "our "
Global symbol "$version" requires explicit package name at monitor.pl line 35.
Global symbol "$version" requires explicit package name at monitor.pl line 367.
Execution of monitor.pl aborted due to compilation errors.
 
If that is the only variable you are receiving an error from, you can safely remove it since it only tells the version of the script to the help subroutine. My guess is the newer version of perl is 'more strict' about variables. See this post I found...

http://perlmaven.com/global-symbol-requires-explicit-package-name

You could put the version in the second location manually, rather than using a variable. Either way, not a required variable for any other functionality.
 
Back
Top