Thread IP and ports

Clovertech Forums Cloverleaf Thread IP and ports

  • Creator
    Topic
  • #121037
    John Bass
    Participant

      Is there a way to get a list of all threads in a site with IP and port numbers in a text file?  I want to create a spreadsheet with this information.

      • This topic was modified 11 months, 3 weeks ago by John Bass.
    Viewing 3 reply threads
    • Author
      Replies
      • #121039
        James Cobane
        Participant

          We created a script (getportsall) that searches all your sites NetConfig(s) and pulls the data out of the NetConfig for each site.  The output looks like this:
          <pre> Port Type Host/site thread Protocol Thread/Dest Site
          ——– ————— —————————————- ———- —————————— —————
          2000 Client & Dest mcwapp840b.corp.ds.some.org pdl-tcpip to_hfh_intellidesk epic1prod
          2200 Client & Dest 10.88.205.73 tcpip to_hfhn_topcon_adt hfh1prod
          2304 Client lsibase1.wafoote.org tcpip to_hfah_LSI_adt hfah1prod
          2505 Client 10.32.75.70 tcpip to_hfah_WestComNurse_adt hfah1prod
          2575 Client 10.403.0.108 tcpip to_rhyme_278N_278Referral epic2prod</pre>
          Script is attached with a .txt extension added to allow it to be uploaded.  Feel free to modify for your needs.

          Regards,

          Jim Cobane – Henry Ford Health

          P. S. – It doesn’t look like the formatting of the output stayed in the post, but you get the idea.

          • This reply was modified 11 months, 3 weeks ago by James Cobane.
          Attachments:
          You must be logged in to view attached files.
          • #121043
            John Bass
            Participant

              Thanks for the quick response Jim!  I tried running the script from the shell window after changing the extension but got this error.

              tcl getportsall.tcl
              Port Type Host/site thread Protocol Thread/Dest Site
              ——– ————— —————————————- ———- —————————— —————
              can’t read “threadlist”: no such variable
              while executing
              “lsort $threadlist”
              invoked from within
              “set threadlist [lsort $threadlist]”
              (file “getportsall.tcl” line 107)

               

            • #121053
              James Cobane
              Participant

                Hmm…not sure why you’re getting the error as the script runs for me.  Make sure that you’re root is set (i.e. setroot / showroot)

            • #121042
              Jim Kosloskey
              Participant

                I think you will need some Tcl.

                If you are on a release that supports NCI (NetConfig Interface), you can use that API, otherwise, the NetConfig is a text file, and you can either read it and work your way through the keyed lists and lists or there are undocumented commands (which I do not use) to extract certain NetConfig information. If you want to go that way, hopefully others who do use those undocumented commands can assist.

                I have a proc that retrieves port information using NCI which you can have, if you like as an example.

                If you would like that proc, email me.

                email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

              • #121046
                Jim Vilbrandt
                Participant

                  Hi John,

                  I wrote these two Scripts that are included as Inbound Data TPS on two timer threads that run once a night. They create CSV files once a day that contain details for all threads defined in the SITES argument. One is for Protocol details, the second for Route details.

                  Here is how the TPS Args are configured:

                  {SITES {site1 site2 site3}}
                  {DEBUG 0}

                  The threads are configured as fileset-local that function both as an inbound (the file from the previous run is the “trigger”) and an outbound. Warning! – the thread will “consume” all files in the target directory, so you will need a dedicated directory for each thread. I use a filename filter “Directory Parse” TPS, so both files can co-exist in one directory.

                  The scripts are running on both Unix and Windows platforms.

                  Regards from Germany, Jim Vilbrandt

                  Attachments:
                  You must be logged in to view attached files.
                • #121049
                  Dirk Engels
                  Participant

                    I’ve attached my script which lists all port over all sites, so you can also see if there are double assigned ports over your site. You can also specify a sorting by thread, site or port number. The standard output is on screen, but with option -print it creates a csv file.

                    Just execute it with hcitcl getPortInfo.tcl within a Cloverleaf shell window.

                    Attachments:
                    You must be logged in to view attached files.
                Viewing 3 reply threads
                • You must be logged in to reply to this topic.