mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix telegram notifications (fix #6915)
This commit is contained in:
parent
6213c4c5c2
commit
93dd74d906
2 changed files with 13 additions and 6 deletions
|
|
@ -83,15 +83,20 @@ function telegram.sendMessage(recipient, message_body, settings)
|
|||
tmp = message_body
|
||||
end
|
||||
|
||||
-- In this case "httpPost" method is needed
|
||||
local msg = json.encode(message_body)
|
||||
data = '{"chat_id": "' .. recipient.recipient_params.telegram_channel .. '", "text": "' .. tmp .. '", "disable_notification": true}'
|
||||
local message = {
|
||||
chat_id = recipient.recipient_params.telegram_channel,
|
||||
text = tmp,
|
||||
disable_notification = true
|
||||
}
|
||||
|
||||
local data = json.encode(message)
|
||||
|
||||
-- In this case "httpPost" method is needed
|
||||
local post_rc = ntop.httpPost(settings.url, data)
|
||||
|
||||
if(post_rc and (post_rc.RESPONSE_CODE == 200)) then
|
||||
rc = true
|
||||
break
|
||||
rc = true
|
||||
break
|
||||
end
|
||||
|
||||
retry_attempts = retry_attempts - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue