Port Listing from Remote Commands

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Port Listing from Remote Commands

  • Creator
    Topic
  • #51721
    Robert Gordon
    Participant

      A decade ago I created “ports”, and revised it for another hospital using namespaces.  They say three times the charm, well this is it.  Far from being finished as I have not configured every type of protocal, but then it does have access and expansion into a comments field in the display, also it does a dynamic display, which means that all data will show up in a column format, but columns are not in a fixed format.

      As always (There is one bug, since I do need you to understand the code, as well as contribute to the code, I can’t know everything…  :roll:), test before inplementing, for “Unices” try “/home/hci/bin” mode 775; and a symbolic link in the bin directory of cloverleaf. for “NT” use a small batch file like ports.cmd which points to “hcitcl.exe c:..ports.tcl” in the bin directory and it should work.  

      😯

    Viewing 4 reply threads
    • Author
      Replies
      • #71444
        Russ Ross
        Participant

          Thanks for sharing!

          I’m not sure if you are saying you intentionally put a bug in the code to force us to look at it or if you are asking for us to help you find the bug.

          It would also be nice to describe what to expect the script to do.

          I got a fair idea of what to expect when I took a quick look at the code.

          I ran the code and got an error and took a look and immediately saw a significant amount of necessary code was comment out on the following line:

          Code:

             set fd [open “$HciSiteDir/NetConfig” r]; #fconfigure $fd -translation binary; set data [read $fd]; regsub -all — “n” $data “” data; regsub -all — “protocol ” $data “nprotocol ”  data; regsub -all — “process ” $data “nprocess ”  data; set data [lrange [split $data n] 1 end]; close $fd

          since you are looking for comments, as a matter of preference I chose to change your one line of code into the following:

          Code:


             set fd [open “$HciSiteDir/NetConfig” r];
             fconfigure $fd -translation binary;
             set data [read $fd];
             regsub -all — “n” $data “” data;
             regsub -all — “protocol ” $data “nprotocol ”  data;
             regsub -all — “process ” $data “nprocess ”  data; set data [lrange [split $data n] 1 end];
             close $fd

          You will notice I also took out the # in front of fconfigure and it produce output like this for the site I was in when I ran it:

          Code:


          Thread Name                Host Name      Port/Type                 Comments                                              
          ———–                ———      ———                 ——–                                              
          9208                             9208                      PDL: mlp_tcp.pdl                                      
          9411_pat1_ordrs                pat1_lis_jump_2_lis/tcpip Encode Type: binary                                  
          jump_picis_9216            localhost      9216                      PDL: mlp_tcp.pdl                                      
          9207                             9207                      PDL: mlp_tcp.pdl                                      
          jump_pat1_9404                lis_jump_pat1_lab/tcpip   Encode Type: binary                                  
          ib_pathnet_351_8027               8027                      PDL: mlp_tcp.pdl                                      
          9212                             9212                      PDL: mlp_tcp.pdl                                      
          ob_pathnet_351_8026        hnaa           8026                      PDL: mlp_tcp.pdl                                      
          load_pathnet_351              file                      In: /data/test_cerner/load_pathnet_351, Out: /dev/null
          9211                             9211                      PDL: mlp_tcp.pdl                                      
          jump_mercurymd_9502        localhost      9502                      PDL: mlp_tcp.pdl                                      
          9210                             9210                      PDL: mlp_tcp.pdl                                      
          9030_sms_23_adt                   9030                      PDL: mlp_tcp.pdl                                      
          ib_pathnet_rslts_9417             ib_lis_rslts              PDL: mlp_tcp.pdl                                      
          9206_flat_adt                     9206                      PDL: mlp_tcp.pdl                                      
          jump_bdm_rxtfc_9029        127.0.0.1      9029                      PDL: mlp_tcp.pdl                                      
          ob_pathnet_ord_subset_file    file                      In: /dev/null, Out: ../../../data/fls/test_fls        
          ob_pathnet_ordrs_9416      hnaa           ob_lis_ordrs              PDL: mlp_tcp.pdl                                      
          ob_labdb_5581              CL_lisods      5581                      PDL: mlp_tcp.pdl                                      
          ob_labdb_5580              CL_lisods      CL_ob_lis_rslts_ods       PDL: mlp_tcp.pdl                                      
          hop_9208                   localhost      9208                      PDL: mlp_tcp.pdl                                      
          ob_ocf_8013                    8013/tcpip                Encode Type: binary                                  
          hop_9207                   localhost      9207                      PDL: mlp_tcp.pdl                                      
          load_pathnet_450              file                      In: /data/test_cerner/load_pathnet_450, Out: /dev/null
          ob_rslts_clin_stat         143.111.217.93 12561                     PDL: mlp_tcp.pdl                                      
          hop_9212                   localhost      9212                      PDL: mlp_tcp.pdl                                      
          js_bldbnk                  localhost      qdx_test_j_lab_450        PDL: mlp_tcp.pdl                                      
          ob_pathnet_450_8062        hnaa           8062                      PDL: mlp_tcp.pdl                                      
          hop_9211                   localhost      9211                      PDL: mlp_tcp.pdl                                      
          hop_9210                   localhost      9210                      PDL: mlp_tcp.pdl                                      
          ib_pathnet_450_8021               8021                      PDL: mlp_tcp.pdl                                      

          Russ Ross
          RussRoss318@gmail.com

        • #71445
          Robert Gordon
          Participant

            A teacher leaves a crossword puzzle to a bunch of kindergarden students.  One student figures out the solution and then lets all the other students copy the answer.  The students continues to do this all year.  Today the students a year latter still can’t spell cat or dog…

          • #71446
            Russ Ross
            Participant

              I know the cat command will show the contents of a file but what does the dog command do?

              Russ Ross
              RussRoss318@gmail.com

            • #71447
              Kirby Knight
              Participant

                So in a UNIX environment, what are the steps neccesary to get this command to work from the remote commands?

              • #71448
                Ian Morris
                Participant

                  Wow!

              Viewing 4 reply threads
              • The forum ‘Tcl Library’ is closed to new topics and replies.