mirror of
https://github.com/moudsen/mailGraph
synced 2025-01-30 20:01:38 +01:00
Refactoring for optimized flow and relevant data retrieval (v1.25)
This commit is contained in:
parent
17cdbea2bd
commit
66b504a66c
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 @@
|
||||
|
||||
// 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;
|
||||
@ -138,6 +132,8 @@ 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).
|
||||
|
||||
@ -191,4 +187,4 @@ itemId: {ITEM.ID]</message>
|
||||
</message_templates>
|
||||
</media_type>
|
||||
</media_types>
|
||||
</zabbix_export>
|
||||
</zabbix_export>
|
||||
|
Loading…
x
Reference in New Issue
Block a user