Aggiungi 'notifier'
ZM custom notification script for motion detection filter Usage: /path/to/script/notifier "%EPIM%" "%MN%" "%ET%" "%MP%" "%EC%" "%ESM%" "%ED%" "%ESA%" "%EL%" "%EP%" Remember to apply x permissions before executing for the first time.
This commit is contained in:
45
notifier
Normal file
45
notifier
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
TELEGRAM_BOT_TOKEN=""
|
||||
TLMSG="[SECURITY OPERATIONS CENTER]\n\nATTENZIONE \
|
||||
\n\nMovimento rilevato su $2 alle $3. \
|
||||
\
|
||||
\n\nMonitor: $4 \
|
||||
\nCausa: $5 (punteggio max. $6) \
|
||||
\nDescrizione: $7 \
|
||||
\
|
||||
\n\nPunteggio medio: $8 \
|
||||
\nDurata: $9 \
|
||||
\
|
||||
\n\nEvento: $10"
|
||||
|
||||
|
||||
MESSAGE="ATTENZIONE \
|
||||
|
||||
Movimento rilevato su $2 alle $3. \
|
||||
\
|
||||
Monitor: $4 \
|
||||
Causa: $5 (punteggio max. $6) \
|
||||
Descrizione: $7 \
|
||||
\
|
||||
Punteggio medio: $8 \
|
||||
Durata: $9 \
|
||||
\
|
||||
Evento: $10"
|
||||
|
||||
#PUSHOVER POST SECTION
|
||||
curl -F "token=" \
|
||||
-F "user=" \
|
||||
-F "title=Allarme TVCC TRN1" \
|
||||
-F "message=$MESSAGE" \
|
||||
-F "priority=2" \
|
||||
-F "expire=3600" \
|
||||
-F "retry=30" \
|
||||
https://api.pushover.net/1/messages
|
||||
|
||||
#TELEGRAM POST SECTION
|
||||
curl -X POST \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"chat_id": "", "text": "'"$TLMSG"'"}' \
|
||||
https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user