Ad Widget

Collapse

Double quote in notification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vlzemtsov
    Junior Member
    • Dec 2017
    • 1

    #1

    Double quote in notification

    Hello.

    Zabbix - 3.4.2

    A have script (media types) for telegram notification:

    PHP Code:
    #!/bin/bash

    TOKEN=<Token>

    CHAT_ID="$1"
    SUBJECT="$2"
    shift 2
    MESSAGE
    =$@

    curl --x mirror.maxus.lan:3128 --header 'Content-Type: application/json' --request 'POST' --data "{\"chat_id\":\"${CHAT_ID}\",\"text\":\"${SUBJECT}\n${MESSAGE}\"}" "https://api.telegram.org/bot${TOKEN}/sendMessage" grep -'"ok":false' 

    When I run the script from the console using double quotes, everything works fine
    ./zbxtel_vz.sh <telegram_id> l"o"l k"ek"
    The message comes, the quotes are removed

    When zabbix tries to send me a message in which there are double quotes, only the part of the message that was before the first double quote.

    I want see my message) Full)
Working...