mirror of
				https://github.com/moudsen/mailGraph
				synced 2025-10-29 00:27:38 +01:00 
			
		
		
		
	Compare commits
	
		
			48 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 8bc476ed63 | ||
|   | e80a2a56a3 | ||
|   | 4b28d3f066 | ||
|   | 93535d4006 | ||
|   | b9622da72f | ||
|   | 56fb68ae9c | ||
|   | fa51c3e59e | ||
|   | 4ae62b3a1f | ||
|   | 0731b87d44 | ||
|   | bdf4b05a6b | ||
|   | df16444665 | ||
|   | bccd134523 | ||
|   | 27c1d64511 | ||
|   | 8597658670 | ||
|   | b7e2062486 | ||
|   | 2955ffc404 | ||
|   | 2976a4af9c | ||
|   | 2882367308 | ||
|   | 8b4885038a | ||
|   | f541719fbe | ||
|   | 9edab245d8 | ||
|   | 341bd561ab | ||
|   | e2f657f3dd | ||
|   | 82a8fe4121 | ||
|   | bee76b63c0 | ||
|   | ba0d474bdb | ||
|   | a5a0f0ace1 | ||
|   | 8655d4ca2c | ||
|   | 76321be3f8 | ||
|   | 9d4f00ce87 | ||
|   | 1278d43acb | ||
|   | 18c22abf17 | ||
|   | 0a623f3137 | ||
|   | 634134b423 | ||
|   | 58668311ee | ||
|   | 9052b71562 | ||
|   | 74b6ee15c7 | ||
|   | 398637e582 | ||
|   | 9e40060cdd | ||
|   | e85400b0de | ||
|   | e05fcbfba7 | ||
|   | 66b504a66c | ||
|   | bc0c83b544 | ||
|   | 17cdbea2bd | ||
|   | fb51354649 | ||
|   | 78061964c4 | ||
|   | 1c9786c549 | ||
|   | 37b1ea7ea2 | 
							
								
								
									
										54
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,7 +1,55 @@ | ||||
| ## mailGraph (v1.22) | ||||
| Zabbix Media module and scripts for sending e-mail alerts with graphs. | ||||
| ## mailGraph v2.10 release ## | ||||
| _(2023/06/30)_ | ||||
|  | ||||
| **Please use the Wiki for information on how to install, configure and use MailGraph in Zabbix.** | ||||
| _This version has been verified with Zabbix 5.4, 6.0 LTS and 6.4._ | ||||
|  | ||||
| Minor updates to the mailGraph code | ||||
| - When not defining zabbix_api_user and zabbix_api_pwd in the configuration file the zbx_user and zbx_user_pwd wll be used | ||||
|  | ||||
| Modified files | ||||
| - mailGraph.php | ||||
| - mailGraph.xml | ||||
| - javascript/zabbix.mailGraph.js | ||||
|  | ||||
| For those upgrading to the latest release without installing the media type: | ||||
| - copy new mailGraph.php over existing mailGraph.php | ||||
| - open the Media type MailGraph in Zabbix and edit the javascript | ||||
| -- replace the script contents with the contents of javascript/zabbix.mailGraph.js | ||||
|  | ||||
| Changes are in effect immediately, no need to restart any services. | ||||
|  | ||||
| ## Zabbix 6.4.x testing ## | ||||
| _(2023/06/30)_ | ||||
|  | ||||
| Zabbix 6.4 verification has succesfully completed. | ||||
| - Refactored code to remove deprecated and removed functions since Zabbix 6.4.0 | ||||
| -- Zabbix Javascript now using HttpRequest instead of CurlHttpRequest (function name changes implemented) | ||||
| -- Zabbix API user.login is now based on "username" (instead of "user") | ||||
|  | ||||
| Sidenotes | ||||
| - Zabbix logging still shows deprecation messages however it is believed these are internal to Zabbix and not related to mailGraph | ||||
|  | ||||
| _(2023/06/29)_ | ||||
|  | ||||
| Zabbix 6.4.x verification is in progress. Required intermediate release to fix one major issue (Zabbix login parameters deprecation) and some minor coding updates. | ||||
| Expect to continue with automatic configuration within the next 2 months. | ||||
|  | ||||
| ## Zabbix 6.2.x testing ## | ||||
| _(2022/10/10)_ | ||||
|  | ||||
| Testing completed. No immediate issues found. | ||||
|  | ||||
| _(2022/08/22)_ | ||||
|  | ||||
| Zabbix 6.2.x testing is in progress. Once completed the next effort will be to deliver on automatic configuration detection and automatic updates. | ||||
|  | ||||
| ## IMPORTANT NOTE ## | ||||
| As a result of a major functional change in Zabbix 5.4 (Screens no longer exist and are all moved into Dashboards) the mailGraph.screen macro no longer functions under Zabbix 5.4+. A code rewrite is in progress to deal with detecting the Zabbix version and to pick dashboard.get instead of screen.get as a source list for the graphs that should be included in the mail message. | ||||
|  | ||||
| **v1.x is no longer supported; please upgrade to the current v2 release** | ||||
| **Please use the Wiki for information on how to install, configure and use MailGraph in Zabbix** | ||||
|  | ||||
| ## Example message | ||||
| The below message is just an example of what MailGraph is capable of. The template engine ("Twig") allows for a fully customized message creation to your needs! It is also possible to add more Zabbix fields. If you need additional fields just raise an issue ticket and ask and I'll see what I can do. | ||||
|  | ||||
| [](images/Example-mail-message-v122.png) | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| { | ||||
|     "script_baseurl": "https:\/\/domain.com\/", | ||||
|     "script_baseurl": "https:\/\/mydomain.com\/", | ||||
|     "cli_itemId": 0, | ||||
|     "cli_triggerId": 0, | ||||
|     "cli_eventId": 0, | ||||
|     "cli_eventValue": 0, | ||||
|     "cli_duration": 0, | ||||
|     "cli_recipient": "recipient@domain.com", | ||||
|     "cli_recipient": "recipient@mydomain.com", | ||||
|     "cli_subject": "[TEST] {{ HOST_NAME|raw }}:  ({{ EVENT_SEVERITY }}) {{ EVENT_NAME|raw }}", | ||||
|     "cli_baseURL": "https:\/\/domain.com\/zabbix\/", | ||||
|     "cli_baseURL": "https:\/\/mydomain.com\/zabbix\/", | ||||
|     "cli_period": "30m", | ||||
|     "cli_period_header": "Last 30 minutes", | ||||
|     "cli_debug": 1, | ||||
|     "cli_proxy": "", | ||||
|     "zabbix_user": "alogicalusername", | ||||
|     "zabbix_user_pwd": "astrongpassword", | ||||
|     "zabbix_api_user": "alogicalusername", | ||||
|     "zabbix_api_pwd": "astrongpassword", | ||||
|     "mail_from": "sender@domain.com", | ||||
|     "mail_from": "sender@mydomain.com", | ||||
|     "subject": "{{ HOST_NAME|raw }}:  ({{ EVENT_SEVERITY }}) {{ EVENT_NAME|raw }}", | ||||
|     "smtp_server": "localhost", | ||||
|     "smtp_port": 25, | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| { | ||||
|     "script_baseurl": "https:\/\/domain.com\/", | ||||
|     "script_baseurl": "https:\/\/mydomain.com\/", | ||||
|     "cli_itemId": 0, | ||||
|     "cli_triggerId": 0, | ||||
|     "cli_eventId": 0, | ||||
|     "cli_eventValue": 0, | ||||
|     "cli_duration": 0, | ||||
|     "cli_recipient": "recipient@domain.com", | ||||
|     "cli_recipient": "recipient@mydomain.com", | ||||
|     "cli_subject": "[TEST] {{ HOST_NAME|raw }}:  ({{ EVENT_SEVERITY }}) {{ EVENT_NAME|raw }}", | ||||
|     "cli_baseURL": "https:\/\/domain.com\/zabbix\/", | ||||
|     "cli_baseURL": "https:\/\/mydomain.com\/zabbix\/", | ||||
|     "cli_periods": "10m,4h,2d,7d", | ||||
|     "cli_periods_headers": "Last 10 minutes,Last 4 hours,Last 2 days,Last 7 days", | ||||
|     "cli_debug": 1, | ||||
|     "cli_proxy": "", | ||||
|     "zabbix_user": "alogicalusername", | ||||
|     "zabbix_user_pwd": "astrongpassword", | ||||
|     "zabbix_api_user": "alogicalusername", | ||||
|     "zabbix_api_pwd": "astrongpassword", | ||||
|     "mail_from": "sender@domain.com", | ||||
|     "mail_from": "sender@mydomain.com", | ||||
|     "subject": "{{ HOST_NAME|raw }}:  ({{ EVENT_SEVERITY }}) {{ EVENT_NAME|raw }}", | ||||
|     "smtp_server": "localhost", | ||||
|     "smtp_port": 25, | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|         $content = file_get_contents($argv[1]); | ||||
|         $data = json_decode($content,TRUE); | ||||
|  | ||||
|         if ($data==NULL) | ||||
|         if (($data==NULL) && (sizeof($content)>2)) | ||||
|         { | ||||
|             echo 'Invalid JSON format in config file?!'.$cCRLF; | ||||
|             die; | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								images/Example-Zabbix-MediaType-Config.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								images/Example-Zabbix-MediaType-Config.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 85 KiB | 
							
								
								
									
										1
									
								
								javascript/READ.ME
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								javascript/READ.ME
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| Issue #32 has been resolved. The javascript code now works for Zabbix 5.4, 6.0 LTS and 6.4. | ||||
| @@ -1,22 +1,23 @@ | ||||
| try { | ||||
|     // Pickup parameters | ||||
|     params = JSON.parse(value), | ||||
|         req = new CurlHttpRequest(), | ||||
|         req = new HttpRequest(), | ||||
|         fields = {}, | ||||
|         resp = '', | ||||
|         result = { tags: {} }; | ||||
|  | ||||
|     // Set HTTP proxy if required | ||||
|     if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { req.setProxy(params.HTTPProxy); } | ||||
|     if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { | ||||
|         req.setProxy(params.HTTPProxy); | ||||
|         fields.HTTPProxy = params.HTTPProxy; | ||||
|     } | ||||
|  | ||||
|     // Declare output type | ||||
|     req.AddHeader('Content-Type: application/json'); | ||||
|     req.addHeader('Content-Type: application/json'); | ||||
|  | ||||
|     // Must have fields | ||||
|     fields.itemId = params.itemId; | ||||
|     fields.triggerId = params.triggerId; | ||||
|     fields.eventId = params.eventId; | ||||
|     fields.eventValue = params.eventValue; | ||||
|     fields.recipient = params.recipient; | ||||
|     fields.baseURL = params.baseURL; | ||||
|     fields.duration = params.duration; | ||||
| @@ -39,11 +40,11 @@ try { | ||||
|  | ||||
|     // Post information to the processing script | ||||
|     Zabbix.Log(4, '[MailGraph Webhook] Sending request: ' + params.URL + '?' + JSON.stringify(fields)); | ||||
|     var resp = req.Post(params.URL,JSON.stringify(fields)); | ||||
|     var resp = req.post(params.URL,JSON.stringify(fields)); | ||||
|     Zabbix.Log(4, '[Mailgraph Webhook] Receiving response:' + resp); | ||||
|  | ||||
|     // If there was an error, report it | ||||
|     if (req.Status() != 200) { throw JSON.parse(resp).errors[0]; } | ||||
|     if (req.getStatus() != 200) { throw JSON.parse(resp).errors[0]; } | ||||
|  | ||||
|     // We expect the message id back from the processing script | ||||
|     resp = JSON.parse(resp); | ||||
|   | ||||
							
								
								
									
										655
									
								
								mailGraph.php
									
									
									
									
									
								
							
							
						
						
									
										655
									
								
								mailGraph.php
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										212
									
								
								mailGraph.xml
									
									
									
									
									
								
							
							
						
						
									
										212
									
								
								mailGraph.xml
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <zabbix_export> | ||||
|     <version>5.0</version> | ||||
|     <date>2021-03-10T18:50:24Z</date> | ||||
|     <version>6.0</version> | ||||
|     <date>2023-06-29T23:22:52Z</date> | ||||
|     <media_types> | ||||
|         <media_type> | ||||
|             <name>MailGraph</name> | ||||
| @@ -19,10 +19,6 @@ | ||||
|                     <name>eventId</name> | ||||
|                     <value>{EVENT.ID}</value> | ||||
|                 </parameter> | ||||
|                 <parameter> | ||||
|                     <name>eventValue</name> | ||||
|                     <value>{EVENT.VALUE}</value> | ||||
|                 </parameter> | ||||
|                 <parameter> | ||||
|                     <name>graphHeight</name> | ||||
|                     <value>120</value> | ||||
| @@ -35,6 +31,10 @@ | ||||
|                     <name>HTTPProxy</name> | ||||
|                     <value/> | ||||
|                 </parameter> | ||||
|                 <parameter> | ||||
|                     <name>infoTest</name> | ||||
|                     <value>Test</value> | ||||
|                 </parameter> | ||||
|                 <parameter> | ||||
|                     <name>itemId</name> | ||||
|                     <value>{ITEM.ID}</value> | ||||
| @@ -59,130 +59,130 @@ | ||||
|                     <name>subject</name> | ||||
|                     <value>{{ HOST_NAME|raw }}: ({{ EVENT_SEVERITY }}) {{ EVENT_NAME|raw }}</value> | ||||
|                 </parameter> | ||||
|                 <parameter> | ||||
|                     <name>triggerId</name> | ||||
|                     <value>{TRIGGER.ID}</value> | ||||
|                 </parameter> | ||||
|                 <parameter> | ||||
|                     <name>URL</name> | ||||
|                     <value>https://mydomain.com/mailGraph.php</value> | ||||
|                 </parameter> | ||||
|             </parameters> | ||||
|             <script>try {
 | ||||
|     // Pickup parameters
 | ||||
|     params = JSON.parse(value),
 | ||||
|         req = new CurlHttpRequest(),
 | ||||
|         fields = {},
 | ||||
|         resp = '',
 | ||||
|         result = { tags: {} };
 | ||||
| 
 | ||||
|     // Set HTTP proxy if required
 | ||||
|     if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { req.setProxy(params.HTTPProxy); }
 | ||||
| 
 | ||||
|     // Declare output type
 | ||||
|     req.AddHeader('Content-Type: application/json');
 | ||||
| 
 | ||||
|     // Must have fields
 | ||||
|     fields.itemId = params.itemId;
 | ||||
|     fields.triggerId = params.triggerId;
 | ||||
|     fields.eventId = params.eventId;
 | ||||
|     fields.eventValue = params.eventValue;
 | ||||
|     fields.recipient = params.recipient;
 | ||||
|     fields.baseURL = params.baseURL;
 | ||||
|     fields.duration = params.duration;
 | ||||
| 
 | ||||
|     // Optional fields
 | ||||
|     if (typeof params.graphWidth === 'string') { fields.graphWidth = params.graphWidth; }
 | ||||
|     if (typeof params.graphHeight === 'string') { fields.graphHeight = params.graphHeight; }
 | ||||
|     if (typeof params.subject === 'string') { fields.subject = params.subject; }
 | ||||
|     if (typeof params.showLegend === 'string') { fields.showLegend = params.showLegend; }
 | ||||
|     if (typeof params.periods === 'string') { fields.periods = params.periods; }
 | ||||
|     if (typeof params.periods_headers === 'string') { fields.periods_headers = params.periods_headers; }
 | ||||
|     if (typeof params.debug === 'string') { fields.debug = params.debug; }
 | ||||
| 
 | ||||
|     // Add generic fields
 | ||||
|     Object.keys(params).forEach(function(key) {
 | ||||
|         if (key.substring(0, 4) == 'info') {
 | ||||
|             fields[key] = params[key];
 | ||||
|         }
 | ||||
|     });
 | ||||
| 
 | ||||
|     // Post information to the processing script
 | ||||
|     Zabbix.Log(4, '[MailGraph Webhook] Sending request: ' + params.URL + '?' + JSON.stringify(fields));
 | ||||
|     var resp = req.Post(params.URL,JSON.stringify(fields));
 | ||||
|     Zabbix.Log(4, '[Mailgraph Webhook] Receiving response:' + resp);
 | ||||
| 
 | ||||
|     // If there was an error, report it
 | ||||
|     if (req.Status() != 200) { throw JSON.parse(resp).errors[0]; }
 | ||||
| 
 | ||||
|     // We expect the message id back from the processing script
 | ||||
|     resp = JSON.parse(resp);
 | ||||
|     result.tags.__message_id = resp.messageId;
 | ||||
| 
 | ||||
|     // Pass the result back to Zabbix
 | ||||
|     return JSON.stringify(result);
 | ||||
| }
 | ||||
| catch (error)
 | ||||
| {
 | ||||
|     // In case something went wrong in the processing, pass the error back to Zabbix
 | ||||
|     Zabbix.Log(127, 'MailGraph notification failed : '+error);
 | ||||
|     throw 'MailGraph notification failed : '+error;
 | ||||
|  | ||||
|             <script>try { | ||||
|     // Pickup parameters | ||||
|     params = JSON.parse(value), | ||||
|         req = new HttpRequest(), | ||||
|         fields = {}, | ||||
|         resp = '', | ||||
|         result = { tags: {} }; | ||||
|  | ||||
|     // Set HTTP proxy if required | ||||
|     if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { | ||||
|         req.setProxy(params.HTTPProxy); | ||||
|         fields.HTTPProxy = params.HTTPProxy; | ||||
|     } | ||||
|  | ||||
|     // Declare output type | ||||
|     req.addHeader('Content-Type: application/json'); | ||||
|  | ||||
|     // Must have fields | ||||
|     fields.itemId = params.itemId; | ||||
|     fields.eventId = params.eventId; | ||||
|     fields.recipient = params.recipient; | ||||
|     fields.baseURL = params.baseURL; | ||||
|     fields.duration = params.duration; | ||||
|  | ||||
|     // Optional fields | ||||
|     if (typeof params.graphWidth === 'string') { fields.graphWidth = params.graphWidth; } | ||||
|     if (typeof params.graphHeight === 'string') { fields.graphHeight = params.graphHeight; } | ||||
|     if (typeof params.subject === 'string') { fields.subject = params.subject; } | ||||
|     if (typeof params.showLegend === 'string') { fields.showLegend = params.showLegend; } | ||||
|     if (typeof params.periods === 'string') { fields.periods = params.periods; } | ||||
|     if (typeof params.periods_headers === 'string') { fields.periods_headers = params.periods_headers; } | ||||
|     if (typeof params.debug === 'string') { fields.debug = params.debug; } | ||||
|  | ||||
|     // Add generic fields | ||||
|     Object.keys(params).forEach(function(key) { | ||||
|         if (key.substring(0, 4) == 'info') { | ||||
|             fields[key] = params[key]; | ||||
|         } | ||||
|     }); | ||||
|  | ||||
|     // Post information to the processing script | ||||
|     Zabbix.Log(4, '[MailGraph Webhook] Sending request: ' + params.URL + '?' + JSON.stringify(fields)); | ||||
|     var resp = req.post(params.URL,JSON.stringify(fields)); | ||||
|     Zabbix.Log(4, '[Mailgraph Webhook] Receiving response:' + resp); | ||||
|  | ||||
|     // If there was an error, report it | ||||
|     if (req.getStatus() != 200) { throw JSON.parse(resp).errors[0]; } | ||||
|  | ||||
|     // We expect the message id back from the processing script | ||||
|     resp = JSON.parse(resp); | ||||
|     result.tags.__message_id = resp.messageId; | ||||
|  | ||||
|     // Pass the result back to Zabbix | ||||
|     return JSON.stringify(result); | ||||
| } | ||||
| catch (error) | ||||
| { | ||||
|     // In case something went wrong in the processing, pass the error back to Zabbix | ||||
|     Zabbix.Log(127, 'MailGraph notification failed : '+error); | ||||
|     throw 'MailGraph notification failed : '+error; | ||||
| }</script> | ||||
|             <process_tags>YES</process_tags> | ||||
|             <description>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).
 | ||||
| 
 | ||||
|             <description>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 | ||||
| - "periods" and "periods_headers" can be defined for displaying multiple periods of the same graph, or | ||||
| - "period" and "period_header" can be defined to display a single graph | ||||
|  | ||||
| The html.template and plain.template files can be adjusted (TWIG format). | ||||
|  | ||||
| More details are available at https://github.com/moudsen/mailGraph</description> | ||||
|             <message_templates> | ||||
|                 <message_template> | ||||
|                     <event_source>TRIGGERS</event_source> | ||||
|                     <operation_mode>PROBLEM</operation_mode> | ||||
|                     <subject>Problem: {EVENT.NAME}</subject> | ||||
|                     <message>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}
 | ||||
|                     <message>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]</message> | ||||
|                 </message_template> | ||||
|                 <message_template> | ||||
|                     <event_source>TRIGGERS</event_source> | ||||
|                     <operation_mode>RECOVERY</operation_mode> | ||||
|                     <subject>Resolved in {EVENT.DURATION}: {EVENT.NAME}</subject> | ||||
|                     <message>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}
 | ||||
|                     <subject>Resolved in {EVENT.DURATION}: {EVENT.RECOVERY.NAME}</subject> | ||||
|                     <message>Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE} | ||||
| Problem name: {EVENT.RECOVERY.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]</message> | ||||
|                 </message_template> | ||||
|                 <message_template> | ||||
|                     <event_source>TRIGGERS</event_source> | ||||
|                     <operation_mode>UPDATE</operation_mode> | ||||
|                     <subject>Updated problem in {EVENT.AGE}: {EVENT.NAME}</subject> | ||||
|                     <message>{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}
 | ||||
|                     <message>{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]</message> | ||||
|                 </message_template> | ||||
|             </message_templates> | ||||
|   | ||||
| @@ -114,49 +114,6 @@ | ||||
|                 </table> | ||||
|             </td> | ||||
|         </tr> | ||||
| {% if GRAPH_CID1|length > 0 %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <span class="graphHeader">{{ GRAPH_HEADER1 }}</span><br/> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ GRAPH_CID1 }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
| {% endif %} | ||||
| {% if GRAPH_CID2|length > 0 %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <hr/> | ||||
|                     <span class="graphHeader">{{ GRAPH_HEADER2 }}</span><br/> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ GRAPH_CID2 }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
| {% endif %} | ||||
| {% if GRAPH_CID3|length > 0 %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <hr/> | ||||
|                     <span class="graphHeader">{{ GRAPH_HEADER3 }}</span><br/> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ GRAPH_CID3 }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
| {% endif %} | ||||
| {% if GRAPH_CID4|length > 0 %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <hr/> | ||||
|                     <span class="graphHeader">{{ GRAPH_HEADER4 }}</span><br/> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ GRAPH_CID4 }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
| {% endif %} | ||||
|         <tr> | ||||
|             <td class="links"> | ||||
|                 <div align=center> | ||||
| @@ -170,6 +127,66 @@ | ||||
|                 </div> | ||||
|             </td> | ||||
|         </tr> | ||||
| {% for aGraph in GRAPHS_I %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <span class="graphHeader">{{ aGraph.HEADER }}</span><br/> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ aGraph.CID }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
| {% endfor %} | ||||
| {% if TRIGGER_SCREEN > 0 %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <span class="graphHeader">{{ GRAPHS_T_HEADER }} - {{ GRAPHS_T_PERIODHEADER }}</span> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
|         <tr> | ||||
|             <td class="links"> | ||||
|                 <div align="center"> | ||||
|                     Screen ID: <a href="{{ GRAPHS_T_LINK }}">{{ TRIGGER_SCREEN }}</a> | ||||
|                 </div> | ||||
|             </td> | ||||
|         </tr> | ||||
|     {% for aGraph in GRAPHS_T %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ aGraph.CID }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
|     {% endfor %} | ||||
| {% endif %} | ||||
| {% if HOST_SCREEN > 0 %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <span class="graphHeader">{{ GRAPHS_H_HEADER }} - {{ GRAPHS_H_PERIODHEADER }}</span> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
|         <tr> | ||||
|             <td class="links"> | ||||
|                 <div align="center"> | ||||
|                     Screen ID: <a href="{{ GRAPHS_H_LINK }}">{{ HOST_SCREEN }}</a> | ||||
|                 </div> | ||||
|             </td> | ||||
|         </tr> | ||||
|     {% for aGraph in GRAPHS_H %} | ||||
|         <tr> | ||||
|             <div align=justify> | ||||
|                 <td align="center"> | ||||
|                     <img id="mainimage" border=0 style="width: 100%; max-width: 790px" alt="Zabbix Graph" src="{{ aGraph.CID }}" /> | ||||
|                 </td> | ||||
|             </div> | ||||
|         </tr> | ||||
|     {% endfor %} | ||||
| {% endif %} | ||||
|     </table> | ||||
| </body> | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user