Over the years I've been using Zabbix as both personal and business solution for monitoring. One of the missing features in Zabbix itself was the ability to have graphs generated and associated to monitoring messages as well as an easy way to jump back into Zabbix when searching for monitoring information for specific events, problems or to have a direct link to the associated Zabbix item or host.
This initiated the development of mailGraph v1 in Zabbix 5.4 delivering an elementary solution for sending HTML enriched messages from Zabbix including graphs.
To facilitate in a very flexible way to setup and format messages including the graphs, Twig made its introduction towards mailGraph v2, the current release branch of mailGraph.
The below message is just an example of what MailGraph is capable of. The template engine in Twig allows for a fully customized message creation to your needs! It is also possible to add more Zabbix fields as any field is passed to Twig when accessible in Zabbix through the macro mechanism. Example: `{ITEM.ID}`.
mailGraph is capable of adding several series of graphs into a single message delivering a unique experience when and how groups of graph images per the requested periods of time are added.
Currently mailGraph supports hosts, (one or more related) items and screens (applicable to Zabbix 5.4 only).
More information can be found in the Wiki.
## Installation ##
Please refer to the Wiki how to get mailGraph installed and configured on your system.
_This version has been verified with Zabbix 5.4 and 6.0 LTS and is expected to work with 6.4 and later (based on v2.10 testing)_
Release notes
- Adding [ACKNOWLEDGES] message information for processing in the TWIG template to allow inclusion of "Action" information in the mail messages (eg. who acknowledged/changed problem status). Refer to the Wiki "Templates" section for more detailed information.
- Fixed issue with Zabbix 5.4.12 where parameters that are blank or zero did no longer get passed to the Javascript hence causing basic checks to fail. Javascript and parameter checks in mailGraph.php have been adjusted and optimized.
- Refactored the Javascript error handling to get rid of the "Invalid JSON offset" message and to deal with individual error conditions while presenting a better error message on the root cause of the concerning issue.
-`smtp_from_address` to set the from mail address (if not set uses mailing system default). Note: obsolete `mail_from` but retained for backwards compatibility.
- Added pre- and postchecking of variables to the Zabbix javascript - this will prevent the 'invalid JSON' messages and provide better feedback for errors
- When testing MailGraph it is now possible to set the eventId to zero - a random problem will be picked up via the API
- Zabbix Media Type XML reverted back to version 5.4 (for backwards compatibility)
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.
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.