Refactoring for optimized flow and relevant data retrieval (v1.25)

This commit is contained in:
Mark Oudsen 2021-03-17 13:57:25 +01:00
parent 17cdbea2bd
commit 66b504a66c
2 changed files with 9 additions and 15 deletions

View File

@ -17,9 +17,7 @@ try {
// 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;
@ -60,4 +58,4 @@ 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;
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>5.0</version>
<date>2021-03-12T15:29:06Z</date>
<date>2021-03-17T12:55:43Z</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,10 +59,6 @@
<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>
@ -87,9 +83,7 @@
&#13;
// Must have fields&#13;
fields.itemId = params.itemId;&#13;
fields.triggerId = params.triggerId;&#13;
fields.eventId = params.eventId;&#13;
fields.eventValue = params.eventValue;&#13;
fields.recipient = params.recipient;&#13;
fields.baseURL = params.baseURL;&#13;
fields.duration = params.duration;&#13;
@ -138,6 +132,8 @@ Customization:&#13;
- &quot;graphWidth&quot; and &quot;graphWidth&quot; can be defined for the image size&#13;
- &quot;showLegend&quot; can be defined to show or hide the legend of the graph&#13;
- &quot;subject&quot; can be defined for a customized subject for the mail message&#13;
- &quot;periods&quot; and &quot;periods_headers&quot; can be defined for displaying multiple periods of the same graph, or&#13;
- &quot;period&quot; and &quot;period_header&quot; can be defined to display a single graph&#13;
&#13;
The html.template and plain.template files can be adjusted (TWIG format).&#13;
&#13;
@ -191,4 +187,4 @@ itemId: {ITEM.ID]</message>
</message_templates>
</media_type>
</media_types>
</zabbix_export>
</zabbix_export>