Notes

  • Creator
    Topic
  • #50807

    Given a thread name, is there a command or script that will print out the notes from “$HCIROOT//notes/NetConfig//thread_.notes”?

    -- Max Drown (Infor)

Viewing 0 reply threads
  • Author
    Replies
    • #67594

      Well, here’s what I’ve come up. There’s probably a better way. This script will loop through all of your sites and print out all of the thread names along with the corresponding test from the notes (I’ve limited the output to a line that starts with “Summary:”).

      Code:

      #!/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 search
      set siteExclusions {dev_max dev_joe}

      # Get the list of sites
      set siteList [exec grep environs $hciRoot/server/server.ini]
      regsub {environs=} $siteList {} siteList
      set siteList [lsort [split $siteList ;]]

      # Loop through the sites
      foreach 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

      Example:

      >findApp | grep hmm
      bn12hmm_out
      bnc44hmm_in
      bnd03hmm_in
      bnd03hmma60_in
      bnd05hmm_out
      [code]>findApp | grep hmm
      bn12hmm_out
      bnc44hmm_in
      bnd03hmm_in
      bnd03hmma60_in
      bnd05hmm_out

      -- Max Drown (Infor)

Viewing 0 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,297
Replies
34,440
Topic Tags
287
Empty Topic Tags
10