[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference csc32::consolemanager

Title:POLYCENTER Console Manager
Notice:Kits, Scans, Docs on CSC32:: as PCM$KITS:,PCM$DOCS:, PCM$SCANS:
Moderator:CSC32::BUTTERWORTH
Created:Thu Aug 06 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1541
Total number of notes:6564

1082.0. "Handy way to get history data...." by 30188::CLEMENCE () Tue Nov 07 1995 08:14

The next three replies contain a handy automated way to save the polycenter's
console monitoring data that is in a readable format. It will also auto-purge
the archive area and notify you of the results. I'm currently using it and
it make my job a lot easier. I'm running the polycenter console on aVMS system.

The first reply is the main working com file. It has two definitions in it.
I call this file: X_CONSOLE_EXTRACT.COM

 The first is the notify list. In my case I have filled it in with my node
 and username so that I recieve notification of the nightly runs and can rectify
 them if problems arise:

	$ notify_list = "<person you want to notify>"

	This is how my notify_list is setup:
	$ notify_list = "LANDO::CLEMENCE"

 The second is an area that I have setup to store the data into. In my case It 
 is located on another disk so that the main polycenter console monitoring 
 stuff is left on its own disk:

	$ history_area = "Console$History"



The second file is a com file for each console line defined in my polycenter
console area. The folks here like to name there console's after food names so
this one is called for the console line PIZZA. I call this file:
CONSOLE_EXTRACT_PIZZA.COM.

The third is a small file used to  unlock the console line. I call this file:
UNLOCK.TXT   It is called by X_CONSOLE_EXTRACT.COM so if you didn't like my 
filename you must adjust this com file.

T.RTitleUserPersonal
Name
DateLines
1082.1X_CONSOLE_EXTRACT.COM30188::CLEMENCETue Nov 07 1995 08:14191
$! file : X_CONSOLE_EXTRACT.COM
$
$! This batch file will extract consoles data backing of the 
$! various console data file into the history_area.
$! It will run in the morning, around 1am, and extract out the previous days
$! history.
$! it will resubmit itself to start again the next day.
$
$ on error then goto FAILURE                 
$!
$! 
$ notify_list = "<person you want to notify>"
$ history_area = "Console$History"
$ sysname = ''p1'
$ com_filename = ''p2'
$ if p1 .eqs. "" then goto check_bad
$ if p2 .nes. "" then goto start_this
$ check_bad:
$ fil_err_on = "''sysname' - ''com_filename'"
$ goto much_bad
$!
$!
$ start_this:
$ if p3 .eqs. "" then p3 = "01:00:00"
$ if f$mode() .eqs "INTERACTIVE" then goto next_night
$ !
$ ! Formatted date information
$ !
$ set proc/priv=all
$ today = f$cvtime("TODAY","ABSOLUTE","DATE")
$ today_1 = f$cvtime("TODAY-1-00","ABSOLUTE","DATE")
$ today_2 = f$cvtime("TODAY-2-00","ABSOLUTE","DATE")
$ today_3 = f$cvtime("TODAY-3-00","ABSOLUTE","DATE")
$ today_4 = f$cvtime("TODAY-4-00","ABSOLUTE","DATE")
$ today_5 = f$cvtime("TODAY-5-00","ABSOLUTE","DATE")
$ yesterday = f$cvtime("YESTERDAY","ABSOLUTE","DATE")
$ yesterday_1 = f$cvtime("YESTERDAY-1-00","ABSOLUTE","DATE")
$ yesterday_2 = f$cvtime("YESTERDAY-2-00","ABSOLUTE","DATE")
$ yesterday_3 = f$cvtime("YESTERDAY-3-00","ABSOLUTE","DATE")
$ yesterday_4 = f$cvtime("YESTERDAY-4-00","ABSOLUTE","DATE")
$ yesterday_5 = f$cvtime("YESTERDAY-5-00","ABSOLUTE","DATE")
$!
$!
$!
$ ystdy = ''yesterday_5'
$ tdy = ''today_5'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next5
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
	/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next5:
$!
$!
$!
$ ystdy = ''yesterday_4'
$ tdy = ''today_4'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next4
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
	/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next4:
$!
$!
$!
$ ystdy = ''yesterday_3'
$ tdy = ''today_3'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next3
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
	/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next3:
$!
$!
$!
$ ystdy = ''yesterday_2'
$ tdy = ''today_2'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next2
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
	/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next2:
$!
$!
$!
$ ystdy = ''yesterday_1'
$ tdy = ''today_1'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next1
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
	/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next1:
$!
$!
$!
$ ystdy = ''yesterday'
$ tdy = ''today'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
	/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next:
$!
$! Archive if any files are here then skip it all...
$!
$!
$ direct/date Console$archive:'sysname'.*
$ if '$status' .eqs. %x00000001 then goto archive_problems
$!
$!
$ fil_err_on = "''sysname'.archiv-''yesterday'"
$ set verify
$ console dialog/file=unlock.txt 'sysname'
$ console archive 'sysname'/before='yesterday'
$ set noverify
$!
$!
$! If we got here thn the archive must have been successfull
$! so delete the console$archive: area.
$ fil_err_on = "deleting console$archive: ''sysname' directory"
$ delete console$archive:'sysname'.*;*
$!
$!
$ mail   /noself/sub="CONSOLE_EXTRACT SUCCESS - ''sysname'"  -
         nl: 'notify_list'
$!
$ next_night:
$ submit	/after="tom+''p3'"			-
		/queue=sys$batch/nonotify	-
		'com_filename'
$ goto finish
$!
$!
$!
$ archive_problems:
$ mail   /noself-
  /sub="CONSOLE_EXTRACT FAILURE - ARCHIVE directory not empty - ''sysname'" -
  nl: 'notify_list'
$
$! goto next_night
$!
$!
$!
$ much_bad:
$ mail   /noself/sub="CONSOLE_EXTRACT FATAL - ''fil_err_on'" -
         nl: 'notify_list'
$ goto finish
$!
$!
$!
$ FAILURE:
$ mail   /noself/sub="CONSOLE_EXTRACT FAILURE - ''fil_err_on'" -
         nl: 'notify_list'
$!
$!
$!
$ re_submit:
$ submit	/after="+00:15"			-
		/queue=sys$batch/nonotify	-
		'com_filename'
$ finish:
$ exit
1082.2CONSOLE_EXTRACT_PIZZA.COM30188::CLEMENCETue Nov 07 1995 08:1512
$! file : CONSOLE_EXTRACT_PIZZA.COM
$!
$! This batch file will call X_CONSOLE_EXTRACT.COM which will 
$! extract consoles data backing of the 
$! various console data file into history_area.
$! It will run in the morning, around 1am, and extract out the previous days
$! history.
$! it will resubmit itself to start again the next day.
$!
$!
$ @x_console_extract.com  pizza  console_extract_pizza.com 00:35:00
$ exit
1082.3UNLOCK.TXT30188::CLEMENCETue Nov 07 1995 08:161
unlock
1082.4Allmost forgot30188::CLEMENCETue Nov 07 1995 08:2118
I forgot to mention..... what I have is an account with these come file in them.

x_console_extract.com
unlock.txt
console_extract_<line>.com

If I add a new console likne I just create a new
console_extract<line>.com file and then just
type:
	@console_extract_<line>.com

It will automatically get submitted for saving the data the next morning.

I also forgot to mention that if you didn't get to fixing a build hang until
a few days later. The com file will automatically try to extract up to the
previous 5 days. This way you you can got a a long weekend and not worry 
that you might lose data if you just started up the com file again.