Ad Widget

Collapse

Graph on email notification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sebastian
    Member
    • Jul 2020
    • 33

    #16
    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.

    ​​​​​​​

    Comment


    • hoppa
      hoppa commented
      Editing a comment
      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.

    • hoppa
      hoppa commented
      Editing 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.

    • hoppa
      hoppa commented
      Editing 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
  • hoppa
    Junior Member
    • Feb 2021
    • 17

    #17
    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).
    Zabbix Media module and scripts for sending templated e-mail alerts enriched with multiple configurable graphs and associated event information - moudsen/mailGraph

    Comment

    • hoppa
      Junior Member
      • Feb 2021
      • 17

      #18
      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".
      Zabbix Media module and scripts for sending templated e-mail alerts enriched with multiple configurable graphs and associated event information - moudsen/mailGraph
      Last edited by hoppa; 20-03-2021, 16:00.

      Comment

      • hoppa
        Junior Member
        • Feb 2021
        • 17

        #19
        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!

        Comment

        • hoppa
          Junior Member
          • Feb 2021
          • 17

          #20
          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.

          Comment


          • mazofeifa
            mazofeifa commented
            Editing a comment
            Hi. Where is the step-by-step manual to configure that Webhook? I can't find it.
        • hai.dao
          Junior Member
          • Jun 2022
          • 19

          #21
          i really need manual step by step

          Comment

          Working...