Ad Widget

Collapse

How can send triggers by SMS in zabbix

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 176

    #1

    How can send triggers by SMS in zabbix

    I want to send SMS for triggers with via api . as you can see I am using follow script but it cannot send sms when there is Space in trigger alarm (All times we have space in trigger alarm) for example when trigger alarm is : /usr space is more than 90% it cannot send it . I think had to change in curl command or script to solve the issue would you please help me about it? Also I did all configure in media type and ... just the problem is with SPACE character .



    msg="$1"
    numbers=('123456789')
    for sms in "${numbers[@]}"; do
    curl -i "http://SMS-SERVER-IP-ADDRESS:PORT-Number/sms?src=Source-Number&dest=$sms&msg=$msg&apikey=MY-API-KEY"
    done



  • Answer selected by bab at 18-06-2022, 07:52.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    This might help you: https://stackoverflow.com/questions/...r-curl-command

    You can as well encode the query string:
    curl --get \
    --data-urlencode "p1=value 1" \
    --data-urlencode "p2=value 2" \

    # http://example.com?p1=value%201&p2=value%202
    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      This might help you: https://stackoverflow.com/questions/...r-curl-command

      You can as well encode the query string:
      curl --get \
      --data-urlencode "p1=value 1" \
      --data-urlencode "p2=value 2" \

      # http://example.com?p1=value%201&p2=value%202
      Markku

      Comment

      Working...