#!/hci/quovadx/qdx5.6/integrator/bin/tcl################################################################################## Name: findApp# Developer: Max Drown# Date: 04/16/2009# Purpose: List all the threads and the notes for each thread if they exist.# Note: Combine this with grep to limit your search#################################################################################set hciRoot /hci/quovadx/qdx5.6/integrator# List of sites to exclude from the searchset siteExclusions {dev_max dev_joe}# Get the list of sitesset siteList [exec grep environs $hciRoot/server/server.ini]regsub {environs=} $siteList {} siteListset siteList [lsort [split $siteList ;]]# Loop through the sitesforeach site $siteList { set site [file tail $site] # Skip the excluded sites if {[lsearch -exact $siteExclusions $site] == -1} { # Set up the environment eval [exec $hciRoot/sbin/hcisetenv -root tcl $hciRoot $site] # Get the thread names netcfgLoad $hciRoot/$site/NetConfig set threadList [lsort [netcfgGetConnList]] foreach thread $threadList { # Get the name of the process # (could get the process name with another netcfg call, but avoiding another loop) regexp {(w{2,3}d{2,2})} $thread match process # Get the "Summary:" line from the notes and output the results set note "" set notesFile "$hciRoot/$site/notes/NetConfig/$process/thread_$thread.notes" if {[file exists $notesFile]} { catch {exec /bin/grep Summary: $notesFile} note # Ignore this warning from grep if {$note == "child process exited abnormally"} {set note ""} puts "$threadtt$note" } else { puts "$thread" } } }}# End of Script