Troubleshooting
Problem
Method to disable IBM Spectrum Protect (aka known as IBM Tivoli Storage Manager - TSM) server and/or storageagent traces dynamically based on an event
Resolving The Problem
IBM Spectrum Protect server and storageagent traces can sometimes get very large. With the MAXSIZE parameter of the 'trace begin' command or option the size of the tracefile can be limited to the specified size. If MAXSIZE is set, then the trace information will wrap in the specified tracefile. But this implies that the tracing will be stopped soon after the desired error condition has occurred to prevent overwriting of the valuable trace information by more or less useless trace information.
How can the tracing be disabled, if no one can permanently watch the system or if the error only occurs intermittently?
Here are 2 different possibilities to achieve this:
- Write an IBM Spectrum Protect script which queries the server for a specific condition on a recurring basis and disables the trace if the condition has occurred.
- Use the servermon.pl script provided by IBM Spectrum Protect support.
Details for the IBM Spectrum Protect server script:
- Here is a sample script, COND_END_TRACE, to end tracing on IBM Spectrum Protect server and storageagent TEST-STA after one of messages ANR8779E, ANR8787W, ANR8783E has been written into the activitylog, the script also contains an administrative schedule to run the script::
select * from actlog where originator='SERVER' -
and msgno in (8779,8787,8783) and -
date_time >=current_timestamp -5 minutes
if (RC_NOTFOUND) goto reschedule
del schedule cond_end_trace t=a
trace flush
trace end
(TEST-STA) trace flush
(TEST-STA) trace end
issue message I '+++++++ tracing ended ++++++++'
exit
reschedule:
delete schedule cond_end_trace t=a
define schedule cond_end_trace t=a -
cmd="run cond_end_trace" -
active=yes starttime=NOW+0:05 perunit=onetime
And for those who want to cut and paste the "define script" command, here we go:
Please be aware that each line starts with either DEFINE or UPDATE SCRIPT, perhaps your browser is fornatting it differently - so please check before running the script :-)
DEFINE SCRIPT COND_END_TRACE "select * from actlog where originator='SERVER' and msgno=8779 and date_time >=current_timestamp -5 minutes" LINE=1 DESC="Sample Script"
UPDATE SCRIPT COND_END_TRACE "if (RC_NOTFOUND) goto reschedule" LINE=2
UPDATE SCRIPT COND_END_TRACE "del schedule cond_end_trace t=a" LINE=3
UPDATE SCRIPT COND_END_TRACE "trace flush" LINE=4
UPDATE SCRIPT COND_END_TRACE "trace end" LINE=5
UPDATE SCRIPT COND_END_TRACE "(TEST-STA) trace flush" LINE=6
UPDATE SCRIPT COND_END_TRACE "(TEST-STA) trace end" LINE=7
UPDATE SCRIPT COND_END_TRACE "issue message I '+++++++ tracing ended ++++++++'" LINE=8
UPDATE SCRIPT COND_END_TRACE "exit" LINE=9
UPDATE SCRIPT COND_END_TRACE "reschedule:" LINE=10
UPDATE SCRIPT COND_END_TRACE "delete schedule cond_end_trace t=a" LINE=11
UPDATE SCRIPT COND_END_TRACE "define schedule cond_end_trace t=a cmd='run cond_end_trace' active=yes starttime=NOW+0:05 perunit=onetime" LINE=12
Alternatively you might want to use the server monitoring script to enable traces up to a certain condition met (stop event).
Details for the servermon.pl script:
- The servermon.pl script is described in detail following the link from the related URL section, this is also the download location for the servermon.pl script.
Beside other options, you can use the following parameters to define traceflags and stop conditions:
Enter comma separated stop events, e.g. ANR#####E [none]:
Here you can specify a comma separated list of messages as logged to the activity log. If any of the messages specified is found during the runtime of the script, the script will go through some final doc collection and then stop.
Enter traceflags [none]:
Here you can specify any server traceflags as asked for by IBM support. Tracing will be stopped upon stopping the script via sending SIGINT or if the number of diagnostic cycles are reached (see below).
Enter size limit for the tracefile. (1-65535MB, -1 unlimited) [-1]:
If you enabled tracing via the traceflags parameter you can specify the maxsize limit in MB for the generated tracefile.
Related Information
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21167024