Ad Widget

Collapse

How to send hostname and severity ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karzer
    Member
    • Mar 2010
    • 61

    #1

    How to send hostname and severity ?

    I use the script below to send winpopup.

    Code:
    #!/bin/sh
    # Send a zabbix message via winpopup to a given host
    # Use as an alertscript within zabbix
    # Syntax: winpopup $receiptant $subject $message
    # Note: zabbix passes $1=receiptiant, $2=subject, $3=message to any script
    RECEIPIANT=$1
    SUBJECT=$2
    MESSAGE=$3
    HOST=${RECEIPIANT%|*}
    IP=${RECEIPIANT#*|}
    echo -e "Subject:$SUBJECT\\n$MESSAGE" | smbclient -M $HOST -I $IP
    I would like it to be seemed just host name and severity or to be seemed as an additional information.
    How could we modify this script or any other alternative ?
  • JBo
    Senior Member
    • Jan 2011
    • 310

    #2
    Hi,

    You can modify message subject and/body in zabbix.
    In Configuration / Actions, edit your action and add:
    • {TRIGGER.SEVERITY}
    • {HOSTNAME}

    to subject or message.
    A list of all available macros is in the documentation.

    Regards,
    JBo

    Comment

    • karzer
      Member
      • Mar 2010
      • 61

      #3
      Hi JBo,

      Thanks for your fast reply but I couldnt be clear so I try to explain a little more about my problem.

      We dont want to see the message on zabbix web interface,
      We would like to sent this message to another application (HP-OM) as input for it.

      In this below script parameters which are SUBJECT and MESSAGES correct,
      Code:
      RECEIPIANT=$1
      SUBJECT=$2
      MESSAGE=$3
      HOST=${RECEIPIANT%|*}
      IP=${RECEIPIANT#*|}
      Is it possible to set values like these for HOSTNAME and SEVERITY ?
      How can I write variable for them ?

      Comment

      • JBo
        Senior Member
        • Jan 2011
        • 310

        #4
        Hi karzer,

        I'm afraid that I don't understand your question.

        Zabbix passes 3 parameters to alert scripts (recipient, subject, message) and you cannot change that.

        If you want to pass specific parameters (as hostname and severity) to your script, you need to embed them inside subject or message values and extract them in your script.

        Hope this helps,
        JBo

        Comment

        Working...