Reply To: tbllookup within Alert

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf tbllookup within Alert Reply To: tbllookup within Alert

#59049
Greg Eriksen
Participant

    Wow, thanks for all the responses.  It had looked like I maybe needed Charlie’s workaround (whatever that is), but I tried out all of your suggestions.

    Reggie, I modified the permissions you recommended, but no go.  And I had been thinking along the same lines as you about it being a problem with environment settings between me running both the lookup and the entire alertTrigger proc successfully from hcitcl, and the Monitor Daemon not being able to.  So I had inserted the following lines at the start of the proc:

    #

    global env

    echo rootdir: $env(HCIROOT)

    eval [exec $env(HCIROOT)/sbin/hcisetenv -root tcl $env(HCIROOT) clotest1]

    setHciDirs

    #

    It didn’t seem to cause any new errors, but it didn’t help either.

    Michael, I removed the “.tbl” extension from the table name being referenced in the proc, and tried it with and without the path, but no change in the error when called by the alert.

    Finally, I thought I would have to hear from Charlie what his workaround was, but the bottom of the original archive email posting from Mark seemed to be saying that a tcl proc with a tbllookup would work from an alert if the “alert action” defined was “exec” rather than “tcl”.  My first attempts at this made the error disappear from the site daemons log, but I didn’t get any emails produced either.  The “exec” action seems to automatically add an ampersand “&” at the end of the action, thus making it a background process.  As such, the echo statements I’d inserted in the proc were no longer displaying in the log, so I couldn’t tell how much of the proc was actually being run anymore.  After much trial and error, it eventually sunk in that I had to surround the entire string (proc name + 7 parameters) with the single quotes after the “hcitcl -c”.  When I define the action for the alert as the following, it now works:

    {exec {hcitcl -c ‘alertTrigger “grege@mmc.org cbordList” “WARNING – to_cbord exceeded queue count” “The to_cbord connection has exceeded queue maximum.” “gemini.mmc.org” “mmc.org” “” “”‘}

    I don’t know if this was in fact Charlie’s workaround or if he had something else, but my thanks go out especially to Michael for remembering and digging up that old posting from the archive.  I was getting nowhere with this, and while there’s about a day-and-a-half of my life I’ll never get back due to this particular undocumented monitor daemon quirk, at least it didn’t end up in me committing seppuku.