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.
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.
Comment