Parse 5.8 NetConfig

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Parse 5.8 NetConfig

  • Creator
    Topic
  • #53837
    Jerry Magrann
    Participant

      Using 5.8 – I have read through a lot of threads about parsing the NetConfig, I have found the TLIB here – /hci/cis5.8/integrator/tcl/lib/cloverleaf/nci.tlib

      No can someone tell me how to use this to get data from the NetConfig such as ports and routes?

      Thanks!

    Viewing 4 reply threads
    • Author
      Replies
      • #79137
        bill bearden
        Participant

          I have used nci.tlib but I haven’t used it to go through the route section of the NetConfig file. Here is an example that looks at ip address and port, which are in the PROTOCOL section. The example limits it to outbound (ob) connections because that is what I was looking at when I wrote it.

          As you can probably tell, netcfgGetConnList returns a Tcl list. But exactly what the elements of that list are, I don’t know. I just know you can pass them to netcfgGetConnData to get “sections” of that connection/thread. netcfgGetConnData returns a Tcl keyed list.

          I haven’t used nci.tlib enough to get a feel for when I am getting what back from a call. There is probably a pattern or something logical about it. But I don’t know what it is so I can’t tell you. If you figure it out, let me know.

          This example is probably something (or based on something) I copied from someone else on Clovertech. If so, thanks.

          Code:

          netcfgLoad “$::env(HCISITEDIR)/NetConfig”
          set conns [netcfgGetConnList]
          set conns [lsort $conns]
          set protocol “”
          echo [format “%-24s %-20s %-10s” Conn :Host :Local_IP]
          foreach conn $conns {
           if {[regexp {.*ob.*} $conn]} {
             catch {set protocol [netcfgGetConnData $conn “PROTOCOL”]
               set host [keylget protocol “HOST”]
               set local_ip [keylget protocol “LOCAL_IP”]
               set port [keylget protocol PORT]
               echo “[format %-25s $conn]:[format %-20s $host/$port]:$local_ip”
             }
           }
          }

        • #79138
          James Cobane
          Participant

            Jerry,

            Attached are a couple of procs to get port info and also routes.

          • #79139
            Jerry Magrann
            Participant

              Thanks – I’ve been hacking away trying to get something nice and clean out of the 5.8 NetConfig, but so far no luck – I’ll see what your procs have and if I get something working will repost here.

              Thanks again!

            • #79140
              James Cobane
              Participant

                I’ve attached a document outlining some of the custom scripts that I developed that pull information from NetConfig and/or MSI.

              • #79141
                Bob Richardson
                Participant

                  One and All,

                  We had attended the Cloverleaf Roadshow last December 2012 where

                  the 6.0 Integrator was reviewed.  In this release there is a documentation function available to do reports via a web client for sites.  Sounded promising.

                  For those shops using or plan to use the 6.0 integrator perhaps you can post your experience with this documentation feature to this forum.

                  Otherwise like some of those here we have cranked out various Tcl and other program code to parse out the NetConfig.

                  Looking forward to other posts on this subject.

                  Thanks.

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