Ad Widget

Collapse

PDF Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • exkg
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified Specialist
    • Mar 2007
    • 718

    #1

    PDF Reports

    Hi,

    We need beta testers

    This development is to generate PDF reports in ZABBIX GUI. Some features:

    - scheduled reports (one shot only, daily, wekly, etc);
    - send generated reports to an E-mail address;
    - reports can be viewed in ZABBIX GUI;
    - this patch will create new tables in ZABBIX database;
    - data is gathered in trends tables;

    After download files run install.sh and ZABBIX gui will have a new item in reports menu (Schedule Reports).

    Here a sample report.

    This was tested in 1.8.2 and has no guarantees and is not a ZABBIX SIA official development ... enjoy.


    []s,
    Luciano
    Last edited by exkg; 20-08-2010, 16:36.
    --
    Luciano Alves
    www.zabbix.com
    Brazil | México | Argentina | Colômbia | Chile
    Zabbix Performance Tuning
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    This is a much needed functionality.

    I have tried it on a 1.8.3 test system (cannot test on 1.8.2, it is our production server ).
    Code:
    # ./install.sh zabbix
    Instalador dos relatorios em PDF no zabbix
    
     Uso: pass required MySQL parameters to this script (like -u<USER>, -p<PASS>, <DATABASE>, etc). 
    Continue ? (y/n) yzabbix
    Informe o diretorio raiz dos arquivos do zabbix
    Ex.:  /var/www/html/zabbix ou /srv/www/zabbix
    /var/www/zabbix
    Tecle enter para continuar ... CTRL+C para cancelar
    Esse processo vai alterar arquivos da GUI do ZABBIX
    
    Criando backup e copiando ...
    en_gb.inc.php
    pt_br.inc.php
    general
    cp: cannot stat `files/images/general/general': No such file or directory
    config.inc.php
    forms.inc.php
    js.inc.php
    menu.inc.php
    report17.inc.php
    reports.inc.php
    chart_bar_report17.php
    chart_pie_report17.php
    chart_stack_report17.php
    popup.php
    popup_bitem17.php
    report17.php
    Criando diretorios para o PDF ...
    Aplicando patch no banco de dados ...
    Although I don't speak portuguese, I understand that some file is missing.

    In Zabbix frontend, I get following error:
    Code:
    Fatal error: Cannot redeclare selectbypattern() (previously declared in /var/www/zabbix/include/config.inc.php:1295) in /var/www/zabbix/include/func.inc.php  on line 777
    Sorry to report bad news, let me know how I can help.

    Thank you for your work,
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • MrKen
      Senior Member
      • Oct 2008
      • 652

      #3
      Sadly I have the same result as Alixen. Testing on 1.8.3rc4 (dont have 1.8.2).

      The same missing file error.
      The same error in /http/error_log "PHP Fatal error: Cannot redeclare selectbypattern() (previously declared in /usr/local/share/zabbix/include/config.inc.php:1295) in /usr/local/share/zabbix/include/func.inc.php on line 777"

      Cannot connect to the frontend, at all.

      MrKen
      Disclaimer: All of the above is pure speculation.

      Comment

      • exkg
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified Specialist
        • Mar 2007
        • 718

        #4
        Hmmm .... its bad, unfortunatly this patch was made in 1.8.2.

        As soon as possible we'll try with new versions ... or wait for ZABBIX Developers to say something


        []s,
        Luciano
        --
        Luciano Alves
        www.zabbix.com
        Brazil | México | Argentina | Colômbia | Chile
        Zabbix Performance Tuning

        Comment

        • MrKen
          Senior Member
          • Oct 2008
          • 652

          #5
          Hi Luciano,

          Thanks for your reply, and thanks also for creating this great functionality.

          I notice in your 'sample report' that the Pie Graph has no Legend or 3D view. Actually I set up a test 1.8.2 box a couple of weeks ago, but upgraded to 1.8.3rc due to the Pie Graph bug. https://support.zabbix.com/browse/ZBX-2496

          I wonder if you are aware of that bug. Your Pie Graph would look much nicer with a legend and 3D view.

          Also, as a beta tester, I wonder if you could create an English version of the install script. It was a little difficult to follow during the install.

          Regards,
          MrKen
          Disclaimer: All of the above is pure speculation.

          Comment

          • exkg
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified Specialist
            • Mar 2007
            • 718

            #6
            Hi ... a new version with a english version to install.sh and a correction about a missing file.


            []s,
            Luciano
            --
            Luciano Alves
            www.zabbix.com
            Brazil | México | Argentina | Colômbia | Chile
            Zabbix Performance Tuning

            Comment

            • alixen
              Senior Member
              • Apr 2006
              • 474

              #7
              Hi,

              Originally posted by exkg
              Hi ... a new version with a english version to install.sh and a correction about a missing file.
              No error message during execution of install.sh.
              BUT, I still get :
              Code:
              Fatal error: Cannot redeclare selectbypattern() (previously declared in /var/www/zabbix/include/config.inc.php:1295) in /var/www/zabbix/include/func.inc.php  on line 777
              I have tried to comment out functions that seem to be duplicate but there are A LOT !
              I have stopped after commenting out:
              include/func.inc.php:
              • function selectByPattern(&$table, $column, $pattern, $limit)
              • function order_result(&$data, $sortfield, $sortorder=ZBX_SORT_UP)
              • function order_by($def,$allways='')
              • function validate_sort_and_sortorder($sort=NULL,$sortorder= ZBX_SORT_UP)
              • function make_sorting_header($obj,$tabfield,$url='')
              • function getPageSortField($def)
              • function getPageSortOrder($def=ZBX_SORT_UP)

              include/js.inc.php:
              • function redirect($url,$timeout=null)

              include/validate.inc.php:
              • function validate_float($str)
              • function validate_period(&$str)
              • function validate_ticks($str)

              since I was still getting duplicate function errors.
              At this point, I could get zabbix login screen but I got new errors after that.

              Just in case, this is the way I test it:
              Code:
              # Install Zabbix frontend code
              cd /var/www/zabbix
              rm -rf *
              cd /usr/local/src/zabbix-1.8.3/frontends/php
              cp -arv * /var/www/zabbix
              I then point by browser to http://zabbix/zabbix/instal.php and configure frontend access to Zabbix DB.

              Code:
              # Install zabbix-PDF_reports
              cd /usr/local/src/zabbix-PDF_reports
              ./install.sh zabbix
              I then point by browser http://zabbix/zabbix (and get errors described above )

              In order to undo DB modifications, I do:
              Code:
              mysql zabbix
              drop table reports_groups;
              drop table reports_hosts;
              drop table reports_items;
              drop table reports_windows;
              Is it enough ?


              Regards,
              Alixen
              http://www.alixen.fr/zabbix.html

              Comment

              • alixen
                Senior Member
                • Apr 2006
                • 474

                #8
                Hi,

                I have tested it on Zabbix 1.8.2 and I have much better news !
                IT WORKS

                I have found two problems:
                1. I have to change DocumentRoot from /var/www to /var/www/zabbix otherwise I get:
                Code:
                FPDF error: Missing or incorrect image file: http://127.0.0.1/images/general/logo_pdf.jpg
                (images are stored in http://127.0.0.1/zabbix/images/general with /var/www as DocumentRoot).

                2. I am getting wrong data in graphs
                I have attached a snapshot (I can't attach PDF report since it contains data from customer hosts that I need to anonymize instead of hosts I have chosen).
                I have seen two problems:
                - hosts in graphs are not the ones I have selected (hosts in table are OK)
                - Items are "CPU Libre" ("Free CPU"). Range should be in 0 .. 100%. I am getting 0 .. 800 G% !

                Hope this helps
                Alixen
                Attached Files
                Last edited by alixen; 26-08-2010, 18:00. Reason: Correct image URL
                http://www.alixen.fr/zabbix.html

                Comment

                • exkg
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified Specialist
                  • Mar 2007
                  • 718

                  #9
                  Hmmm ... we already have notices that line graphs are broken in some cases

                  Have you tried with bar and pie graphs ? It's work ?


                  []s,
                  Luciano
                  --
                  Luciano Alves
                  www.zabbix.com
                  Brazil | México | Argentina | Colômbia | Chile
                  Zabbix Performance Tuning

                  Comment

                  • alixen
                    Senior Member
                    • Apr 2006
                    • 474

                    #10
                    Hi,

                    Originally posted by exkg
                    Have you tried with bar and pie graphs ? It's work ?
                    I have just tested bar and pie. They don't really work.
                    I have attached two screenshots:
                    • bar : bars seem OK but X axis label is not (hosts names seem to be truncated)
                    • pie : there are too many pie slices and labels are missing.


                    Regards,
                    Alixen
                    Attached Files
                    http://www.alixen.fr/zabbix.html

                    Comment

                    • alixen
                      Senior Member
                      • Apr 2006
                      • 474

                      #11
                      Hi,

                      I have done more tests:
                      • Bar graphs are OK. host names on X axis are truncated to 6 characters.
                      • It would be better if each bar had a different color (as for pie and line graphs).

                      These two points are not really bugs but could be enhancements.

                      I have also found that very large values in tables overwrite data in adjacent columns (see attached screenshot). May be using floating point format instead of fixed point would help; or, better yet, use Zabbix scaling functions ( 1.000.000.000 b/s => 1 Gb/s).

                      Regards,
                      Alixen
                      Attached Files
                      http://www.alixen.fr/zabbix.html

                      Comment

                      • fjrial
                        Senior Member
                        • Feb 2010
                        • 140

                        #12
                        Is it possible that the PDF report could be generated based only on two items of one host only and using those two items in the same graph?

                        We want a pdf report for eachone of the "centers" connected to us. We have a lot of hosts, and each host has two items: traffic in and traffic out.

                        We want reports with the sum, avg and max for traffic in and traffic out for each center and with the posibility to define the time range..

                        Your tool it's OK, but if I select a host and the two items of the host (in & out) to draw in line graph, each items gets its own graph.. It would be fantastic if we could set an option like "draw together".

                        By the way, thanks for this excellent tool.

                        Cheers.

                        Comment

                        • exkg
                          Senior Member
                          Zabbix Certified Trainer
                          Zabbix Certified Specialist
                          • Mar 2007
                          • 718

                          #13
                          Hi,

                          I think this is a killer feature in ZABBIX. We are waiting a word from ZABBIX developers to know if this feature will continue as a PATCH or will be in next ZABBIX versions.

                          Actually we have a wish list sent by some forum users ...
                          We have some gaps to solve in this first beta version:

                          - a crontab script to send E-mail with scheduled reports to ZABBIX users
                          - line graphs are very hugly
                          - a way to be ok in new ZABBIX versions

                          I agree to have a way to choose more than one item in same line graph
                          The main idea for this feature is to compare a item between hosts.

                          But my doubt: is it ok in your setup ? I mean: for users that have done tests with 1.8.2 ... this patch is working ?


                          [],
                          Luciano
                          Last edited by exkg; 03-09-2010, 03:23.
                          --
                          Luciano Alves
                          www.zabbix.com
                          Brazil | México | Argentina | Colômbia | Chile
                          Zabbix Performance Tuning

                          Comment

                          • fjrial
                            Senior Member
                            • Feb 2010
                            • 140

                            #14
                            Hi:

                            Mi little review:
                            If works with 1.8.2 but:
                            [Minor things]
                            -The scheduled reports options its called "MAINTENANCE PERIODS".. it should be changed.. also the button to create a new scheduled reports says "Create maintenance period"
                            -Add the possibility to delete the scheduled reports from the GUI.


                            -Trying to get the PDF I get this error:
                            FPDF error: mbstring overloading must be disabled
                            when I press the "PDF" link in the main page of scheduled reports..

                            I correct this error changing the value of mbstring.func_overload to 0
                            mbstring.func_overload = 0

                            This should be added to the README file.

                            And then I get this other one:
                            FPDF error: Can't open image file: pdf_file/img_3_43418.png

                            I'm unable to get the report in pdf format..

                            I can see it if I press the show button but I can't download it.

                            -If I don't select any hostgroup, but I select a host, I can see the report, it works fine .. but this message appears at the footer:
                            * Undefined index: groupids[/var/www/html/report17.php:471]
                            * Undefined index: groupids[/var/www/html/report17.php:471]


                            -I miss the possibility to create report based on graphs, not on items.. let me explain..

                            We have a lot of customers to whom we provide internet connection.. we need to generate report based on traffic in/out for everyone of this customers.. we have set-up in zabbix a lot of graphs for this purpose.. for us, it would be fantastic if we could get a report in this way:
                            Select hosts, *select graphs from hosts* (previously defined), and select date start-date end..
                            Each one of the graphs from the hosts will appear one after other.. (maybe it's less complicated than the actually behaviour of your tool

                            -The date period in the report does not seems to match the selected one in the form. See screenshot attached below

                            If I create the report with an specified date, and after that, I try to change that date, it does not work..

                            If I can help on anything, just let me know.. (now I'm involved in a development of a patch to integrate zabbix with request tracker software, in a near time I'll try to look at the code to see what can I do..)

                            Cheers and thanks
                            Attached Files

                            Comment

                            • alixen
                              Senior Member
                              • Apr 2006
                              • 474

                              #15
                              Hi Luciano,

                              Originally posted by exkg
                              But my doubt: is it ok in your setup ? I mean: for users that have done tests with 1.8.2 ... this patch is working ?
                              It looks promising but in its current state, I won't use it in production.
                              I am not talking about missing features but just bugs (I am just summarizing my previous posts in this thread):
                              1. hosts in graphs are not the ones selected
                              2. wrong Y scale in line graphs
                              3. large values in tables are unreadable since they overwrite data in adjacent cells


                              Once again, I would happily use it in production even with a reduced scope (for instance tables only, no graphs) but in its current state it is very promising but unusable.
                              I have kept a 1.8.2 test machine so that I can do more tests. Let me know if you need more informations on the bugs I have reported.

                              Luciano, although this post may sound rude, I really want to thank you for this development.
                              It is a much needed feature and I hope that it could be integrated in a future release of Zabbix.

                              Thank you again for your work,
                              Alixen
                              http://www.alixen.fr/zabbix.html

                              Comment

                              Working...