Determining which site is firing an alert in a shellscript

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Determining which site is firing an alert in a shellscript

  • Creator
  • #50864
    Jonathan Christian

    Hello All –

    Is there any way to determine which site is firing an alert for a thread in a korn shell script? In essence, if I have a thread trigging an alert based on outbound queue depth, I’d like to find a way to place the site associated to that thread into a variable for use later in the script.

    I could easily do this by manually keying the site id in the list of arguments passed into the script from the alert exec, but I’d like to see if there’s a more automated approach to it, so that I don’t have to hardcode everything into either the script itself or the alert exec line.

    I currently have it to where all I need to pass into the script is the alert text (“%A”). From there, the script parses out the alert text to determine which thread is in alert. It then greps an hciconnstatus with the thread name to determine which process the thread falls under. The only missing component is cross-referencing either (or both) of those to find the site id and plopping it into a variable, but I haven

Viewing 2 reply threads
  • Author
    • #67818
      James Cobane


      You can simply access the variable $HCISITE.

    • #67819
      Jonathan Christian

      Wow. I could just slap myself. That was so obvious.

      Thanks for letting me know, Jim. I appreciate it.

    • #67820
      Peter Heggie

      When you use $HCISITE in your action (ex: EXEC action that invokes mail), do you get this message in your hcimonitord.err file:

      Tcl substitution warning: “can’t read “HCISITE”: no such variable” in ”

      The substitution works fine at run time, but every five minutes, we see this message for each alert instance using a shell variable. Should the alert daemon ignore variables that start with dollar sign?

      Peter Heggie

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

Forum Statistics

Registered Users
Topic Tags