Skip to content
Permalink
Browse files

Telegram upgrade

  • Loading branch information...
NEMS Linux
NEMS Linux committed Aug 20, 2019
1 parent 4106c74 commit 8138a6b24c884a3af5e73497433d12064170a338
Showing with 3 additions and 1 deletion.
  1. +3 −1 data/1.5/nagios/plugins/notify-by-telegram.lua
@@ -4,13 +4,15 @@
-- Kaganishu for helping with documentation and improvements for NEMS 1.5
-- NickTheGreek for contributing his findings to help improve functionality for NEMS 1.5

-- VERSION 1.5.1

https = require('ssl.https')
local handle = io.popen("/usr/local/bin/nems-info alias")
local result = handle:read("*a")
handle:close()
local nemsalias = string.gsub(result, "\n", "")
local telegram_url = 'https://api.telegram.org/bot' .. arg[1] .. '/sendMessage?'
local chat_id = '-' .. arg[2]
local chat_id = '-' .. arg[2]:gsub('%g', '')

Notification = "Notification Type: " .. arg[3] ..'\n' --$NOTIFICATIONTYPE$
Host = "Host: " .. arg[4] ..'\n' --$HOSTNAME$

0 comments on commit 8138a6b

Please sign in to comment.
You can’t perform that action at this time.