Ad Widget
Collapse
Graph on email notification
Collapse
X
-
v2.0 released. I've removed the dependency on ItemID as Zabbix no longer provisions the item-id from v5.4 onwards by default. Pulls the first item-id from the trigger (working on making that smarter in case of multiple trigger item ids).
Next step for v2.1 is a configuration wizard that installs, configures and updates mailGraph.Leave a comment:
-
I've just released v1.28 that has some bugfixes cause by the refactor in v1.26. I've also added the ability to login to the Mail server with a username/password.
This is my last release for now as my next goal in v1.30xis to separate the graph creation code from MailGraph moving towards a generic API level code that can also be used by other Media types in Zabbix to add graphs (first target is Slack, seond target is Telegraph). I'll keep you updated on my progress.
Zabbix Media module and scripts for sending templated e-mail alerts enriched with multiple configurable graphs and associated event information - moudsen/mailGraph
If you like the code please hit the "star" button in GitHub. If you have new/fresh ideas of functionality that could be added to MailGraph let me know as well!Leave a comment:
-
v1.27 has the functionality you are looking for ... You can either add a Screen ID as a tag 'mailGraph.screen' to a Trigger or a Host, where you can also define a specific period an period header for this section of graphs.
Let me know if this is what you were looking for! Cheers, Mark -
I've just released v1.27 that allows for additional graphs to be embedded from a Trigger or Host Tag that references to a Zabbix Screen that on its turn defines the set of graphs to be processed. Note that the html.template has changed significantly. If you upgrade, you need to at least adjust "GRAPHS" to "GRAPHS_I".
Last edited by hoppa; 20-03-2021, 16:00.Leave a comment:
-
I've just completed v1.27 that will allow for a simple way to accomplish what you have requested for. I've taken the idea of taking the graphs from a "Screen" and to make these available to the template for inclusion/processing. A Trigger or Host can be used (via "Tags") to enable the functionality.
Once testing has completed I will post the update on GitHub and update the wiki accordingly. -
I have given this some though and will extend the code shortly to pickup a global setting (config.json "addHostGraphs"), a specific tag ("mailGraph.addHostGraphs") or a screen reference tag ("mailGraph.screebId") for a specific host from which the graphs will be added to the mail. I will also allow for a Trigger tag to point to a "mailGraph.screenId", just need to figure out first which parameter will prevail (most likely this setting will disable the "periods" setting as otherwise there are too many graphs associated to a single mail which could cause Zabbix server (over)load issues in case of rapid event firing. -
Just to let you know I've released v1.26 (code refactor and optimisation, hiding sensitive information in the log, multiple graphs per period (max 4), updated Template logic, wiki updated).
Looking forward to hear if this works for any of you and open for enhancements (just raise an issue in the GitHub).
Leave a comment:
-
This can be achieved currently for a single graph in which you combine what you would like to see and using a Tag configured in the Trigger that points to the required graph you would like to see. The Tag is "mailGraph.graph" where you set the ID of the graph that must be added.
Thinking out loud about the idea to have the ability of a set of graphs embedded that is associated with the host of the Trigger:
- What about adding a tag that points to a SCREEN that is to be embedded in the mail either as a set of indidivual graphs or as a "screenshot" type?
- I could also extend the mailGraph.graph to allow for a series of graph item IDs?
In case multiple graphs are displayed, how should the Period be handled? Otherwise the mail may get overcrowded with graphs when generating 2 to 4 additional ones ... :-). Or simply disable multiple periods and allow only 1 period for the set.
I have all the information already kind of present in my current code as I use the API to get all related information (Trigger -> Items, Items -> Host, Items+Host -> Graphs, Trigger -> Event).
Regards, Mark -
Looks great.
I wonder if you have possibility or idea ho to add graphs for multiple items for host, who triggered the alert.
I'd like to have graph in alert for CPU usage(%), Memory usage (%), ICMP response time (ms), icmp loss (%),
Only then we will be able to know current monitored host status after receiving the mail.
it is not possible with simple alertscript, because graphs are generated basing on ITEMID, and we have only ITEMID only for triggered item.
Leave a comment:
-
v1.22 released. Ability added to have multiple graphs embedded at once at a configurable period of time and with configurable header text that can be configured system wide or per Trigger. Also fixed some minor bugs and added "debug" option (set in either way from config.json or from Zabbix macro).Leave a comment:
-
That's correct Mark, your way to do it is way more universal and in the end of the day it's always better to do it your way.
Anyway having possibility to send graph in mail is improving Zabbix experience significantly. I hope it will be soon available out of the box, Thanks to your work.Leave a comment:
Leave a comment: