$! Proceedure to create T4 compatible data from Cache License Counts $! $! P1 = Start Time $! P2 = End Time $! P3 = File Name start time_end time $! P4 = monitoring interval in seconds $! $ On CONTROL_Y then goto windup $ Set Verify $ Set Noon $! $ If P1 .Eqs. "" Then Exit $ If P2 .Eqs. "" Then Exit $ If P3 .Eqs. "" Then Exit $ If P4 .Eqs. "" Then Exit $! $ Set Prefix " " $ Set Process/Priv=(All,NoBypass) $ Write Sys$OutPut "''P4' ", $Status $ This_Node = F$GetSyi("NodeName") $ Today = F$CvTime(P1,"ABSOLUTE","DATE") $ If (F$Length(Today) .Eq. 10) then Today = "0" + Today $ Today = Today - "-" - "-" $ STime = F$CVTIME(P1) $ Etime = F$CVTIME(P2) $! $ Set Command t4$sys:T4$Hib $ set default t4$data $! $ open /write/share=read - t4_cache T4_'this_node'_'Today'_'P3'_cache.csv $ write t4_cache "''this_node',''this_node'" Stamp = F$CVTIME(P1,"ABSOLUTE","DATE") $ write t4_cache "''stamp',''stamp'" Stamp = f$extract (0,5,F$CVTIME(P1,"ABSOLUTE","TIME")) $ write t4_cache "''stamp',''stamp'" $ write t4_cache - "[CACHE]Sample Time, [CACHE.License]Free" $! $ delta_hib = "" $ if P4 .lt. 60 .and. P4 .gt. 0 $ then $ delta_hib = "+00:00:''P4'" $ delta_off = 20 $ endif $ if P4 .eq. 60 $ then $ delta_hib = "+00:01" $ delta_off = 17 $ endif $ if P4 .eq. 300 $ then $ delta_hib = "+00:05" $ delta_off = 17 $ endif $ if P4 .gt. 60 .and. delta_hib .eq. "" $ then $ write t4_cache "Someone needs to handle monitoring intervals greater than 1 minutes" $ exit $ endif $! $ if F$CVTIME() .lts. STime $ Then $ T4Hib/Until="''F$CvTime(P1,"ABSOLUTE","DateTime")'" $ endif $! $ mainloop: $! $ Stamp = f$extract (0,8,F$CVTIME("","ABSOLUTE","TIME")) $ pipe ( write sys$output "D ^CKEY" ; write sys$output "H" ) | cache | - search/form=dump/nohigh sys$pipe currently | t4$sys:tee.com $ write t4_cache stamp, "," , f$trnlnm("UCSD_CACHE_LICENSE") $! $ if F$CVTIME() .lts. ETime $ Then $ close t4_cache $ open /append/share=read - t4_cache T4_'this_node'_'Today'_'P3'_cache.csv $ delta = f$extract(0,delta_off,F$CvTime("''stamp'''delta_hib'","ABSOLUTE","DateTime")) $ T4Hib/Until="''delta'" $ goto mainloop $ endif $! $ windup: $ close/nolog/error=done t4_cache $ done: $ exit $! tee.com $ loop: $ read/end_of_file=done sys$pipe LINE $ license_count = f$integer(F$EXTRACT(26,(F$LENGTH(line)-F$LOCATE("",LINE)-1),line)) $ define/group/nolog ucsd_cache_license 'license_count $ goto loop $ done: $ exit