Ad Widget

Collapse

Passing phone number Alert script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clarkritchie
    Member
    • Aug 2013
    • 46

    #1

    Passing phone number Alert script?

    I read the page on Custom Scripts. Zabbix seems to always pass my email address as the first argument to my custom script, not the value I specified on the Media Type.

    Here's my script, test2.sh -- I've hard coded the email address so that I can capture the first argument in the email body:

    #!/bin/bash
    to=$1
    subject=$2
    body=$3

    cat <<EOF | mail -s "From Script: $subject" "[email protected]"
    to: $to
    subject: $subject
    body: $body
    EOF


    I defined this as a system-wide media type and I added the media type to myself with a Send to value of +11235551212.

    Should I not be getting +11235551212 as the first argument to test2.sh? $1 is always my email address.
    Attached Files
  • filipp.sudanov
    Senior Member
    Zabbix Certified Specialist
    • May 2014
    • 137

    #2
    I just tried it on Zabbix 2.4 - it's passing the phohe number correctly (5551212, +11235551212 or +1-123-555-1212 - all passed correctly to $1)

    What Zabbix version are you using?
    Are you sure, that your Action in Configuration --> Actions is referring to you "Zoom Telerivet 2" and not any other media type?

    Comment

    • clarkritchie
      Member
      • Aug 2013
      • 46

      #3
      Thanks for the reply.

      Yes, see attached -- my action is using my "Zoom Telerivet 2" media type.

      We are using 2.2.4.

      I'll run through this again today top to bottom to make sure I am not missing anything, but at the moment I am stumped.
      Attached Files

      Comment

      • clarkritchie
        Member
        • Aug 2013
        • 46

        #4
        Interesting. I just ran through this again, top to bottom. $1 is always my email address.

        On my user account, under Media, Email is the first item, then some test media entries, finally my custom Zoom Telerivet media type.

        For grins, I disabled Email on my account, ran my test again, and $1 was correct: I got the phone number specified for the Zoom Telerivet media type on my account. Great!

        I just re-enabled Email media type and ran my test again, and $1 is still correct -- the phone number.

        So maybe this was a quirk on my account. Disabling/reenabling the default media type cleared something out.

        Comment

        Working...