Alerting on Error DB

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Alerting on Error DB

  • Creator
    Topic
  • #52752
    Jerry Tilsley
    Participant

      All,

      I would like to setup an alert based off the filesize of the error db, or maybe when the file itself changes.  Has anyone done this, or does anyone know which file I would need to monitor to catch when a new message is placed into the error db?

      Thanks,

      Jerry

    Viewing 3 reply threads
    • Author
      Replies
      • #75379
        David Barr
        Participant

          There’s an “error database” alert type. We set alerts on specific threads based on the count being greater than zero. Our alert runs a script that dumps the error to a file and sends them in e-mail to the analyst responsible for that system. The script also removes the errors from the database.

          This is one of our alerts that tends to stop triggering for some reason. I think we end of cycling the monitord to clear up the problem.

        • #75380
          Jerry Tilsley
          Participant

            Can you provide me with an example of how to dump the messages out of the error database via TCL?

          • #75381
            David Barr
            Participant

              Jerry Tilsley wrote:

              Can you provide me with an example of how to dump the messages out of the error database via TCL?

              Here’s a screenshot of the alert. The alert action is:

              exec {/quovadx/qdx5.7/integrator/scripts/errordb_alert.sh live1 “%A” david_barr@valleymed.org,zzzzz@valleymed.org “%F”}

              errordb_alert.sh:

              Code:

              #! /bin/ksh
              setroot
              setsite $1
              hcitcl /quovadx/qdx5.7/integrator/scripts/errordb_alert.tcl -a “$2” -e $3 -f “$4

              errordb_alert.tcl:

              Code:

              #! /quovadx/qdx5.7/integrator/bin/hcitcl
              #
              #
              #
              ###########################
              proc main { argc argv } {
                 set optargs [list {a 1 alert} {e 1 email} {f 1 filename}]

                 catch {set args [getopt $argv $optargs]} err

                 #echo ALERT:$alert
                 #echo FILENAME:$filename
                 #set thread [lindex [split $alert ” “] 4]
                 set thread unknown
                 set tlist [split $alert “{”]
                 for { set i 1 } { $i threadm count] } {
                         if { $count > 0 } {
                             set thread $threadm
                         }
                     }
                 }

                 #echo $thread

                 set subj “Error Message from PWIM – [clock format [clock seconds] -format “%
              D %R %p”] $alert”
                 foreach flag { o f d } {
                     catch {exec yes | hcidbdump -e -L -c -D -$flag $thread | fold} dump
                     if {[llength [split $dump n]] > 6} {
                         write_file $filename $dump
                         catch {[exec mailx -s $subj $email <$filename]} emailerr
                     }
                 }
              }

              main $argc $argv

            • #75382
              Jerry Tilsley
              Participant

                Awesome David!

                Thank you!

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