Netconfig Syntax Checker

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Netconfig Syntax Checker

  • Creator
    Topic
  • #54642
    Scott Caldwell
    Participant

      Is there any program or online tool available for checking the syntax of the netconfig?  I am getting a new error that I didnt notice until the other day, and since when you restart processes the log file gets copied (and or over/written), I cant quite figure out what I did thats’ causing the problem.

      here is the problem:

      Code:

      [tcl :err :ERR /0:processname_cmd:–/–/—- –:–:–] NetConfig Error: list element in braces followed by “]]” instead of space

      I did add a new thread within said process on the same day I started searching for the errors in the logs I do have…but I’ve since deleted the thread and still get the error.

      Thanks,

      Scott

    Viewing 14 reply threads
    • Author
      Replies
      • #82377

        First, turn on Log History and SMAT History under Site Options. Then, each time you bounce the process or cycle the SMAT files or logs, a backup is made in the /LogHistory and /SmatHistory sub directories.

        You can enabled auto cycling using file sizes under the NetConfig/Process menu.

        Second, unless you are very careful and know what you are doing, it is not recommended that you manually modify the NetConfig, but instead always use the Network Configurator Tool.

        Third, the Network Configurator Tool as a  menu options for validation as well has a command line tool called “hcinetcheck”.

        -- Max Drown (Infor)

      • #82378
        Scott Caldwell
        Participant

          Thanks for the reply.

          1.  OK I turned on Log History.  Not sure I need the SMAT History turned on as we save cycle nightly – should I anyway? Whats the advantage?  Wouldn’t I lose part of the day’s file as whatever was archived wouldn’t be included in the nightly SC?

          2. I don’t edit the netconfig manually, I’ve always used the tool.

          3. OK I found that, and it gave me the error, but no line number or anything to give me a sense of what needs fixed.

        • #82379

          If you have a tool that’s cycling SMAT, then no need to turn on SMAT History. However, you may want to turn it on in the future and adjust how your script works to take advantage of this function in Cloverleaf.

          Send me your NetConfig, and I’ll see if I can locate the issue for you. What version of Cloverleaf?

          -- Max Drown (Infor)

        • #82380
          Scott Caldwell
          Participant

            file sent.

            6.0

          • #82381

            The NetConfig is fine. Looking at the error a little closer it implies there’s actually a problem with one of your tcl procs, not the NetConfig.

            What you could do if necessary to locate the problem, is make a copy of your site, switch to the copy, and delete threads until you locate the thread with the error. You can make copies of the NetConfig each time for rolling back your changes.

            -- Max Drown (Infor)

          • #82382
            Scott Caldwell
            Participant

              Where did you find what pointed to that conclusion?

              Max Drown wrote:

              The NetConfig is fine. Looking at the error a little closer it implies there’s actually a problem with one of your tcl procs, not the NetConfig.

            • #82383

              I did a NetConfig validation. All of the warnings are expected, such as host not found.

              -- Max Drown (Infor)

            • #82384
              Yves Guerin
              Participant

                Dear,

                To check the tcl procs I use tclCheck <a href="http://catless.ncl.ac.uk/Programs/tclCheck/&#8221; class=”bbcode_url”>http://catless.ncl.ac.uk/Programs/tclCheck/

                Regards,

                Yves[/url]

              • #82385
                Rob Lindsey
                Participant

                  There is a program that comes with the CL version at least on Unix.

                  hcinetcheck

                  >hcinetcheck -?

                  usage: hcinetcheck [configFile] [-n]

                  Where:

                     configFile = name of NetConfig format file to verify

                     -n         = skip DNS lookup for hostname verification

                  I have used this in the past and it has helped me.

                  Rob

                • #82386
                  Elisha Gould
                  Participant

                    In addtion to Yves’s response, I’ve attached a script that I’ve been slowly working on for validating tclprocs.

                    validate_tcl.sh takes a single TPS proc or tcl file name and parses to detect issues. It detect if the code is executable or a string for most cases, and will return 0 when no error is detected, or where the error is located and return 1.

                    ie:

                    Code:

                    > validate_tcl.sh hcitpsmsgkill
                    > echo $?
                    0

                    If there is a bracket mismatch, it prints an error with the location of the error. ie see below when I added a random square bracket:

                    Code:


                    > validate_tcl.sh hcitpsmsgkill_err
                    ERROR MISMATCHING brackets in:
                    # Initialize the disposition list
                    set dispList “”
                    [
                    # For all context other than IB Reply, just kill it
                    if {![string equal $context sms_ib_reply]} {
                    set disp KILL
                    } else {
                    PARSING_ERROR

                    > echo $?
                    1

                    I appologies that it is not documentated and I can’t remember where I got the base code from. I think it started from http://wiki.tcl.tk/9620

                  • #82387
                    Charlie Bursell
                    Participant

                      I am really confused here.  Please tell me what a Tcl syntax checker can do that cannot already be done with hcitpstest?

                      First, before you ever save a Tcl proc make sure that the last brace matches the first.  You *MUST* have an editor that allows brace, bracket, etc. matching,

                      Open one window with the Tcl proc in edit mode and run hcitpstest in another window.  It is simple to apply the fixes.  Not only that a syntax checker will only check that, syntax.  What if the logic of your algorithm is wrong?  hcitpstest will tell you that by looking at the output.

                      Maybe I am missing something here?

                    • #82388

                      The only thing I can think of where this would be useful is if they don’t know which proc has a syntax problem. They can use a script like this to search all of the procs until they find the proc with the issue.

                      -- Max Drown (Infor)

                    • #82389
                      David Barr
                      Participant

                        If the goal is just to make sure that there are no missing braces in your tclprocs, I would avoid using a simplistic parser and use the regular TCL parser.  The auto_load command will load a proc without running it and should tell you if there are any errors in the proc.

                        So you could run mktclindex in the folder, then write a script to verify that every .tcl file is present in the tclIndex and try to auto_load every proc in the tclIndex. That should catch all of your syntax errors.

                      • #82390
                        Elisha Gould
                        Participant

                          The syntax matching in the editors are mostly ok, but sometimes miss things, and the exceptions when running the code don’t always show the location of the issue.

                          For us this just gives a quick check prior to testing to ensure everything matches up rather than having to wait for the test suite to complete first.

                          Its also useful as part of our startup script to prevent startup if an issue is detected.

                        • #82391
                          Bob Richardson
                          Participant

                            Greetings,

                            Another quick way to verify that at least the structure of the TCL program is ok:   start up a TCL shell from a command line (Unix): >tcl

                            Then within this shell do:  source tclprogram.tcl

                            If any structure errors exist you get this message:

                            Error: missing close-brace

                            Try it out.

                            Enjoy.

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