msgBody not in email from tcl alerts

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf msgBody not in email from tcl alerts

  • Creator
    Topic
  • #55674
    Keith McLeod
    Participant

      Recently we had an unscheduled reboot of the Interface Engine.

    Viewing 5 reply threads
    • Author
      Replies
      • #86119
        Peter Heggie
        Participant

          I can’t help but think the reboot brought in some change. I’ve never seen mail functionality changed, though. I would go through some trial and error:

          – put in an echo to see what the mailfile name is – did [pwd] resolve correctly?

          – run just the line containing the ‘exec’ by itself from within hcitcl, or just run the ‘mail’ command from the command line, pointing to an existing file (with and without a body). Did it work?

          – is there another ‘mail’ command?

          – did the context of the user change?

          – is the ampersand (background execution) necessary?

          – and what is in proc ‘write_file’ – is there another one out there now??

          Peter Heggie

        • #86120
          Keith McLeod
          Participant

            Thanks Peter.  Tried most of what you have in your post.  write_file is a tclX command that gives quick syntax to write a string to a file.  In old HIE TCL Reference guide.  Kind of like for_file gets each line from a file and puts it into a variable….

            I have run commands manually and scripted outside of the Alerts.pkg.  The procs still run correctly in the test environment.  In theory nothing changed from a coding perspective within this file.

            The mail command was under suspicion, but works fine from command line.  I am going to add more debug info to verify my variables are being populated correctly to write to the temp file.

            The reboot occurred apparently as a result of the vm console where a reboot command was issued accidently.  I have taken measures to prevent this in the control-alt-delete.conf file and provided a message insisting that Integration be notified before any reboots.  Like putting code in place without it being activated, this makes me wonder what has changed.  More debugging and ideas welcome.  Again thanks.

          • #86121
            Michael Hertel
            Participant

              This probably isn’t it but…

              In my upgrade experience from AIX to Linux, I found out the mail acts differently.

              If the message body has “control characters” in it, Linux will convert the body to an attachment. ATT.bin

              Usually I echo an HL7 message that has carriage returns in it.

              While I got away with this in AIX, it got me in Linux land.

              When you get no body, is there an attachment?

              I was able to resolve my issue by converting carriage returns into line feeds before echoing it as the body.

            • #86122
              David Barr
              Participant

                Get rid of the trailing ampersand. It makes the mail command run in the background. That means that the TCL script probably runs the next command (removing the input file) before your mail command has a chance to start up and read it.

              • #86123
                Keith McLeod
                Participant

                  Thanks for all the help.  I ended up doing the following:

                  set sm [open “| mail -s “Some Subject Here” -r $fromAddress $toAddress” w]

                  puts $sm $msgBody

                  close $sm

                  Seems to work now… Again thanks…

                • #86124
                  Peter Heggie
                  Participant

                    I learn something new every day! I have never seen the TCL ‘open’ command variation where a channel is used instead of a filename. It kind of twists my mind to think that everything between the quotes is resolved after the surrounding open/puts/close functions.

                    Peter Heggie

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