From bb2e8278c113de67d7174a2a9737a1a9f9dc6c32 Mon Sep 17 00:00:00 2001 From: Mark Oudsen Date: Sat, 27 Feb 2021 17:36:06 +0100 Subject: [PATCH] Added debugging references to Zabbix problem templates to support easy debugging - v1.10 --- mailGraph.xml | 255 ++++++++++++++++++++++++-------------------------- 1 file changed, 122 insertions(+), 133 deletions(-) diff --git a/mailGraph.xml b/mailGraph.xml index 8202db7..8936381 100755 --- a/mailGraph.xml +++ b/mailGraph.xml @@ -1,7 +1,7 @@ 5.0 - 2021-02-27T12:14:57Z + 2021-02-27T16:34:16Z MailGraph @@ -9,7 +9,7 @@ baseURL - https://mydomain.com/zabbix + https://zbx.puzzl.nl/zabbix/ duration @@ -57,159 +57,148 @@ URL - https://mydomain.coml/mailGraph.php + https://zbx.puzzl.nl/mailGraph.php - YES - The "URL" must point to the location of the processing script. If a proxy is required, define "HTTPProxy" for the proxy address. - -Customization: -- "graphWidth" and "graphWidth" can be defined for the image size -- "showLegend" can be defined to show or hide the legend of the graph -- "subject" can be defined for a customized subject for the mail message - -The html.template and plain.template files can be adjusted (TWIG format). - -Values available: -{{ baseURL }} - base url of the Zabbix system (use for references to API and login) -{{ TRIGGER_ID }} - id of the applicable trigger -{{ TRIGGER_DESCRIPTION }} - raw trigger description (note: macros are not parsed!) -{{ TRIGGER_COMMENTS }} - comments of the trigger -{{ TRIGGER_URL }} - url of the trigger form -{{ ITEM_ID }} - id of the associated item to the trigger -{{ ITEM_KEY }} - key of the item -{{ ITEM_NAME }} - item name -{{ ITEM_DESCRIPTION }} - description of the item -{{ ITEM_LASTVALUE }} - last value of the item -{{ ITEM_PREVIOUSVALUE }} - the value of the before LASTVALUE -{{ ITEM_URL }} - url of the item form -{{ HOST_ID }} - id of the associated host to the item -{{ HOST_NAME }} - name of the host -{{ HOST_ERROR }} - last error state of the applicable host -{{ HOST_DESCRIPTION }} - description of the host -{{ HOST_URL }} - url of the host form -{{ EVENT_ID }} - id of the associated event -{{ EVENT_NAME }} - name of the event (note: macros are parsed!) -{{ EVENT_OPDATA }} - associated operational data of the vent -{{ EVENT_VALUE }} - event state (0=Recovered, 1=Triggered/Active) -{{ EVENT_SEVERITY }} - severity of the event -{{ EVENT_STATUS }} - status of the event -{{ EVENT_URL }} - url of the event details -{{ GRAPH_ID }} - id of the (first) associated graph that contains the item -{{ GRAPH_NAME }} - name of this graph -{{ GRAPH_URL }} - URL to this graph (assuming script produces to an accessible location) -{{ GRAPH_CID }} - IMG embed string (<img src="{{ GRAPH_CID }}" />) -{{ LOG_HTML }} - script log in HTML format + The "URL" must point to the location of the processing script. If a proxy is required, define "HTTPProxy" for the proxy address. + +Customization: +- "graphWidth" and "graphWidth" can be defined for the image size +- "showLegend" can be defined to show or hide the legend of the graph +- "subject" can be defined for a customized subject for the mail message + +The html.template and plain.template files can be adjusted (TWIG format). + +Values available: +{{ baseURL }} - base url of the Zabbix system (use for references to API and login) +{{ TRIGGER_ID }} - id of the applicable trigger +{{ TRIGGER_DESCRIPTION }} - raw trigger description (note: macros are not parsed!) +{{ TRIGGER_COMMENTS }} - comments of the trigger +{{ TRIGGER_URL }} - url of the trigger form +{{ ITEM_ID }} - id of the associated item to the trigger +{{ ITEM_KEY }} - key of the item +{{ ITEM_NAME }} - item name +{{ ITEM_DESCRIPTION }} - description of the item +{{ ITEM_LASTVALUE }} - last value of the item +{{ ITEM_PREVIOUSVALUE }} - the value of the before LASTVALUE +{{ ITEM_URL }} - url of the item form +{{ HOST_ID }} - id of the associated host to the item +{{ HOST_NAME }} - name of the host +{{ HOST_ERROR }} - last error state of the applicable host +{{ HOST_DESCRIPTION }} - description of the host +{{ HOST_URL }} - url of the host form +{{ EVENT_ID }} - id of the associated event +{{ EVENT_NAME }} - name of the event (note: macros are parsed!) +{{ EVENT_OPDATA }} - associated operational data of the vent +{{ EVENT_VALUE }} - event state (0=Recovered, 1=Triggered/Active) +{{ EVENT_SEVERITY }} - severity of the event +{{ EVENT_STATUS }} - status of the event +{{ EVENT_URL }} - url of the event details +{{ GRAPH_ID }} - id of the (first) associated graph that contains the item +{{ GRAPH_NAME }} - name of this graph +{{ GRAPH_URL }} - URL to this graph (assuming script produces to an accessible location) +{{ GRAPH_CID }} - IMG embed string (<img src="{{ GRAPH_CID }}" />) +{{ LOG_HTML }} - script log in HTML format {{ LOG_PLAIN }} - script log in PLAIN text format TRIGGERS PROBLEM Problem: {EVENT.NAME} - Problem started at {EVENT.TIME} on {EVENT.DATE} -Problem name: {EVENT.NAME} -Host: {HOST.NAME} -Severity: {EVENT.SEVERITY} -Operational data: {EVENT.OPDATA} -Original problem ID: {EVENT.ID} -{TRIGGER.URL} + Problem started at {EVENT.TIME} on {EVENT.DATE} +Problem name: {EVENT.NAME} +Host: {HOST.NAME} +Severity: {EVENT.SEVERITY} +Operational data: {EVENT.OPDATA} +Original problem ID: {EVENT.ID} +{TRIGGER.URL} + +eventId: {EVENT.ID} +TriggerId: {TRIGGER.ID} +itemId: {ITEM.ID] TRIGGERS RECOVERY Resolved in {EVENT.DURATION}: {EVENT.NAME} - Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE} -Problem name: {EVENT.NAME} -Problem duration: {EVENT.DURATION} -Host: {HOST.NAME} -Severity: {EVENT.SEVERITY} -Original problem ID: {EVENT.ID} -{TRIGGER.URL} + Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE} +Problem name: {EVENT.NAME} +Problem duration: {EVENT.DURATION} +Host: {HOST.NAME} +Severity: {EVENT.SEVERITY} +Original problem ID: {EVENT.ID} +{TRIGGER.URL} + +eventId: {EVENT.ID} +TriggerId: {TRIGGER.ID} +itemId: {ITEM.ID] TRIGGERS UPDATE Updated problem in {EVENT.AGE}: {EVENT.NAME} - {USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}. -{EVENT.UPDATE.MESSAGE} - -Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}. - - - DISCOVERY - PROBLEM - Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS} - Discovery rule: {DISCOVERY.RULE.NAME} - -Device IP: {DISCOVERY.DEVICE.IPADDRESS} -Device DNS: {DISCOVERY.DEVICE.DNS} -Device status: {DISCOVERY.DEVICE.STATUS} -Device uptime: {DISCOVERY.DEVICE.UPTIME} - -Device service name: {DISCOVERY.SERVICE.NAME} -Device service port: {DISCOVERY.SERVICE.PORT} -Device service status: {DISCOVERY.SERVICE.STATUS} -Device service uptime: {DISCOVERY.SERVICE.UPTIME} - - - AUTOREGISTRATION - PROBLEM - Autoregistration: {HOST.HOST} - Host name: {HOST.HOST} -Host IP: {HOST.IP} -Agent port: {HOST.PORT} + {USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}. +{EVENT.UPDATE.MESSAGE} + +Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}. + +eventId: {EVENT.ID} +TriggerId: {TRIGGER.ID} +itemId: {ITEM.ID] +