Téléverser les fichiers vers "/"
This commit is contained in:
commit
49d74231a5
BIN
Documentation_Ntfy_Zabbix_0.1.pdf
Normal file
BIN
Documentation_Ntfy_Zabbix_0.1.pdf
Normal file
Binary file not shown.
50
ntfy.sh
Normal file
50
ntfy.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script de notification Ntfy pour Zabbix
|
||||
# Version 0.3
|
||||
|
||||
# Paramètres personnalisables
|
||||
|
||||
# Ntfy
|
||||
ntfy_user="USER"
|
||||
ntfy_password="PASSWORD"
|
||||
|
||||
# Carte réseau
|
||||
address_interface="172.17.17.18"
|
||||
|
||||
# Proxy
|
||||
# Adresse + port du proxy (1.2.3.4:1234)
|
||||
proxy_address="172.17.0.1:3128"
|
||||
proxy_user="USER"
|
||||
proxy_password="PASSWORD"
|
||||
|
||||
|
||||
#=================================================================================
|
||||
|
||||
# Script
|
||||
|
||||
topic=$1
|
||||
subject=$2
|
||||
body=$3
|
||||
|
||||
if [ ! "$(grep "Problème" <<<"$subject")" = "" ]
|
||||
then
|
||||
#Problème
|
||||
tag="facepalm"
|
||||
elif [ ! "$(grep "Resolus" <<<"$subject")" = "" ]
|
||||
then
|
||||
#Résolu
|
||||
tag="+1"
|
||||
fi
|
||||
|
||||
|
||||
curl \
|
||||
-x "http://$proxy_user:$proxy_password@$proxy_address" \
|
||||
-interface $address_interface \
|
||||
-u $ntfy_user:$ntfy_password \
|
||||
-H "Title: $subject" \
|
||||
-H "Tags: $tag" \
|
||||
-d "$body" \
|
||||
https://ntfy.axolito.fr/$topic
|
||||
|
||||
exit 0
|
||||
41
zbx_export_mediatypes.yaml
Normal file
41
zbx_export_mediatypes.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
# Pour scipt ntfy.sh version 0.3
|
||||
#
|
||||
zabbix_export:
|
||||
version: '6.0'
|
||||
date: '2023-09-15T06:10:04Z'
|
||||
media_types:
|
||||
-
|
||||
name: 'Serveur Ntfy Axolito'
|
||||
type: SCRIPT
|
||||
script_name: ntfy.sh
|
||||
parameters:
|
||||
- '{ALERT.SENDTO}'
|
||||
- '{ALERT.SUBJECT}'
|
||||
- '{ALERT.MESSAGE}'
|
||||
description: |
|
||||
Notifications sur le serveur Ntfy de Axolito
|
||||
https://ntfy.axolito.fr/
|
||||
message_templates:
|
||||
-
|
||||
event_source: TRIGGERS
|
||||
operation_mode: PROBLEM
|
||||
subject: 'ZABBIX LORITZ Problème : {EVENT.NAME} '
|
||||
message: |
|
||||
Probleme survenu à : {EVENT.TIME} le {EVENT.DATE}
|
||||
Nature du problème: {EVENT.NAME}
|
||||
Equipement concerné: {HOST.NAME}
|
||||
Gravité: {EVENT.SEVERITY}
|
||||
Statut: {EVENT.OPDATA}
|
||||
ID du problème : {EVENT.ID}
|
||||
{TRIGGER.URL}
|
||||
-
|
||||
event_source: TRIGGERS
|
||||
operation_mode: RECOVERY
|
||||
subject: 'ZABBIX LORITZ Resolus: {EVENT.RECOVERY.NAME}'
|
||||
message: |
|
||||
Le problème a été résolu à {EVENT.RECOVERY.TIME} le {EVENT.RECOVERY.DATE}
|
||||
Nature du problème : {EVENT.RECOVERY.NAME}
|
||||
Equipement concerné : {HOST.NAME}
|
||||
Gravité : {EVENT.SEVERITY}
|
||||
ID du problème : {EVENT.ID}
|
||||
{TRIGGER.URL}
|
||||
Loading…
x
Reference in New Issue
Block a user