Grafana Module

  • Hello Community,


    just released the first versiob of my Icinga Web 2 module to intigrate Grafana graphs.

    Get it here: https://exchange.icinga.com/cark/Grafana+Module or at https://github.com/Mikesch-mp/icingaweb2-module-grafana

    For installation instruction, please read the README (it's really simple :) )


    Please report bugs/feature requests at https://github.com/Mikesch-mp/…eb2-module-grafana/issues



    Todo's:


    [ ] Translation

    [ ] Create more dashboards for common services/checks




    Some screenshots:




    The default dashboard for not configured graphs:


  • Haha :D you were a bit faster than me :D I am also working on a Grafana module and am in the final steps (adding configuration ui, ...)


    Nice work :) Will try for sure!


    [edit]: I just tried it. You took a different approach in using the render API and fetching on the icinga server. I implemented the module using the iframe embed method. This works better together with our SSO solution protecting Grafana. It also leads to graphs being zoomable etc.. well it's Grafana after all :)

    I couldn't get your module to work as we don't have the http auth enabled and can only use the Bearer header.

    I like the configuration options, especially the per service configuration of the graphs.

    What my module supports is different backends, currently influxdb and graphite. The only real change needed is that metrics need to be escaped for graphite.

    You definitely, did some nice work! Hopefully I'm allowed to publish my module as well so we can learn from each other :)

  • My approach was to keep it as simple as possible, because iam so lazy. The module supports Grafana, what backend you use in Grafana is up to you. I just provide premade dashboards for Grafana with InfluxFB and can give support for that combo.


    Iam looking forward to test your module too :)



  • Hallo Mikesch,
    Auf meiner RHEL5 läuft leider der PhantomJS nicht.
    Daher hab ich dein Modul genommen und den image tag gegen einen iframe getauscht (und die URL um "render" gekürzt).
    Nun hab ich wie gewünscht interaktive Grafana Grafen in meinen Services.
    Leider erfolgt alle 5 Sekunden ein Refresh des IFrames. Kann man das irgendwie auf eine Minute anheben ?

  • Nö.

    Wenn du mal aus Spass in deiner getPreviewImage()

    von

    Code
    1. $img = 'data:image/png;base64,'.base64_encode($imgBinary);
    2. $html = '<img src="%s" alt="%s" width="%d" height="%d" />';

    nach

    Code
    1. $img = 'data:image/png;base64,'.base64_encode($imgBinary);
    2. $html= "<div>".date('l jS \of F Y h:i:s A') . "</div>";
    3. $html .= '<img src="%s" alt="%s" width="%d" height="%d" />'

    änderst, siehst du dass icingaweb2 alle 10 Sekunden einen Refresh hinlegt und damit grafana alle 10 Sekunden dein Preview rendern muss.

    Das ist beim IFrame nicht so schön "zack, neuer Inhalt" sondern dröselt sich langsam auf (dauert circa 2 Sekunden).Ich werde wohl mit 2 iframes arbeiten müssen welche ich wechselseitig aktualisiere und danach mittels javascript "Visible=" umschalte.

    Wahrscheinlich refreshen die sich aber beide automatisch, dann hab ich verloren.

  • Hmmm, dann bin ich erstmal mit meinem Latein am Ende :(

    Du kannst aber in Deiner User Konfiguration den Globalen Refresh ausschalten, wie ich das aber in einem <div> oder ähnlichem machen kann hab ich nicht gefunden.

  • Danke, ich sehe es mir noch einmal an !

    Offtopic:

    Die Kommentare im Quelltext erklären stellenweise noch ein Ticketsystem...

  • Mikesch how t interegrate grafana with icingaweb2. Please mention all the steps. Which all are packages has to installed. ??

    Please create a new thread with your question and provide more details on your setup.

  • rajeshballa



    What linux distributionn do you use ? then i can give you a bit more detailed information.

  • any idea how to prevent icingaweb2 from reloading iframes with each Interval


    i am on that as well. The only solution i see is:

    • in the grapher hook, create a placeholder div and get its position.
    • in some other hook, create the iframe and absolute position it above the placeholder.


    Kind of a rape. May be TomGelf has a better tip for us two ?

    The post was edited 1 time, last by sru ().