Timestamp script

I'm wondering like some others may be, what you mean?



If you want it to redirect to a file called timestamp.txt then:



q event * * > c:\timestamp.txt



However, if you are wanting something different than:



07/10/2006 00:30:00 07/10/2006 00:30:35 NIGHTLY_WIN_- PLANNING Completed



That may be a different issue.
 
<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Quote:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><BLOCKQUOTE>timestamp means



Tue 07/11/2006.txt</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>



why not run a batch script from your pc?



I maintain that if you want meaningful info from the events table you should use selects, but if you are happy with q events then who am i to argue



You could try something like the following, bare in mind I am pretty rusty with windows batch scripts, but should be okay. If there are errors with the login procedure let me know and should be able to debug. I would have tested on a TSM machine, but not at work this week..



I have only set the output file to be tsm_events.yymmdd.log if you want hhmm let me know.



Also when testing might be worth running from the run prompt with

start > run > cmd/k c:\path\events.bat



this will show you exaclty where it is failing



************events.bat*************************



@echo off

::

:: This script is grabbing information from the event logs

:: on TSM

::



:: Setting parameters

::



set today=%date:~12,2%%date:~7,2%%date:~4,2%

set user="username"

set pass="pass"

set server="server"

set logfile="c:\logs\tsm_events.%today%.log"

path=%path%;c\dir\where\dsmadmc\is



goto create_events.log



:create_events.log



dsmadmc -se=%server% -id=%user% -pass=%pass% 'q events * * ' > %logfile%

if errorlevel==1 goto create_events_failed



::Everything is successful process exiting

::



goto end



::Failure process

::



:create_events_failed



:: Netsend indicating the process has failed just use this for testing

::



net send %computername% %logfile% creation failed



:end



****************end**************************



cheers



mateinone
 
in fact if you want to change the output



try



set today=%date:~12,2%%date:~7,2%%date:~4,2%.%time:~0,2%%time:~3,2%



for 060711.2229



or



set today=%date:~0,3%.%date:~12,2%%date:~7,2%%date:~4,2%



for Tue.060711



generally you get the idea
 
i want select command but for my customized event q is not possible for me.Pls let me know to what is the select command for the following event



q event exchangeserver exc* begind=-2 ENDDATE=TODAY f=d
 
Creating the select should not be much of a problem...



However because I have not got a server in front of me and never use q events anymore you will need to tell me exaclty what you are after...



Do you want every column from the events table (probably not required) or are you trying to report exceptions from the last couple of days??



do a

select * from columns where tabname='EVENTS' and tell me which columns you want to include.



Paste which fields and what you want reported and I will help...ps I am crashing in about 30 minutes to if you are not able to post by then I will do tomorrow night...
 
Policy Domain Name: EXCHANGESERVER

Schedule Name: EX01-COMMAND

Node Name: VSUK4EX01

Scheduled Start: 07/10/2006 22:00:00

Actual Start: 07/10/2006 22:00:03

Completed: 07/10/2006 22:02:25

Status: Completed

Result: 0

Reason: All operations completed successfully.





this is the output of that command
 
Will the following do



select node_name, domain_name, scheduled_start, actual_start, schedule_name, status, result from events where scheduled_start>='2001-01-01' and scheduled_start>=current_timestamp -48 hours and domain_name='EXCHANGESERVER'
 
select node_name, domain_name, scheduled_start, actual_start, schedule_name, status, result from events where scheduled_start>='2001-01-01' and scheduled_start>=current_timestamp -48 hours and domain_name='EXCHANGESERVER' and schedule_name='EX01-COMMAND'
 
Hi



Thanks for select script it is working properly.Just how to modify the script for selecting all schedules related to domain



For for domain=exchangeserver

schedule association =ex01-command,ex02-command,ex-runnow
 
if you want every schedule associated with the domain exchange server just do not include

and schedule_name='EX01-COMMAND'



If you want just those schedules starting with ex replace with

and

schedule_name like 'ex%' (remember it is case sensitive)



if u want just those 3 you have asked but there are others starting with ex use



and (schedule_name='ex01-command' or schedule_name='ex02-command' or schedule_name='ex-runnow')





if you want them by schedule name.... add the following to the end of your command



order by schedule_name, node_name
 
Back
Top