Ad Widget

Collapse

Zabbix Dynamic PDF Report Generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sam
    Junior Member
    • Jul 2014
    • 5

    #181
    no graph in report

    Originally posted by cleciooliveira
    Hello Ferrol,

    I'm using version 2.2.1.
    The user User was created in zabbix and has the proper permissions.

    Like, when you run the report will generate in the apache logs the url access, checking those logs appear on the link that informed (http://192.168.1.2/zabbix/chart2.php...dth=750&height = 150 & period = 3600 ), if I log in with the User zabbix entered in config.inc.php and enter this link the image of the report appears normal as shown in the previous post, but the error appears on the report:

    Error: No permission for the referenced goal or it does not exist you!

    Became more clear now?

    Sorry again for my english

    Hi cleciooliveira,

    how about you report function? I'm using version 2.2.4, and facing same problems what is no graph in report. can you help me to solve that?
    thanks

    Comment

    • Eddriks
      Junior Member
      • Apr 2010
      • 22

      #182
      Originally posted by sam
      Hi cleciooliveira,

      how about you report function? I'm using version 2.2.4, and facing same problems what is no graph in report. can you help me to solve that?
      thanks

      the same here... the pdf is generating well but no graph in it.

      When I look the apache errors.log, I can see this :

      PHP Warning: unlink(zabbix_cookie_2282.txt): No such file or directory in /var/www/zabbix/custom_pages/generatereport.php on line 44, referer: [...]/custom_pages/pdfform.php
      PHP Warning: unlink(zabbix_cookie_2279.txt): No such file or directory in /var/www/zabbix/custom_pages/generatereport.php on line 44, referer: [...]/custom_pages/pdfform.php
      PHP Warning: unlink(zabbix_cookie_2295.txt): No such file or directory in /var/www/zabbix/custom_pages/generatereport.php on line 44, referer: [...]/custom_pages/pdfform.php
      PHP Warning: unlink(zabbix_cookie_2281.txt): No such file or directory in /var/www/zabbix/custom_pages/generatereport.php on line 44, referer: [...]/custom_pages/pdfform.php
      PHP Notice: getimagesize(): Read error! in /var/www/zabbix/custom_pages/class.ezpdf.php on line 1319, referer: [...]/custom_pages/pdfform.php
      PHP Notice: getimagesize(): Read error! in /var/www/zabbix/custom_pages/class.ezpdf.php on line 1319, referer: [...]/custom_pages/pdfform.php
      PHP Notice: getimagesize(): Read error! in /var/www/zabbix/custom_pages/class.ezpdf.php on line 1319, referer: [...]/custom_pages/pdfform.php
      PHP Notice: getimagesize(): Read error! in /var/www/zabbix/custom_pages/class.ezpdf.php on line 1319, referer: [...]/custom_pages/pdfform.php

      Any hints ?

      Comment

      • Eddriks
        Junior Member
        • Apr 2010
        • 22

        #183
        Hello guys,

        Just solved my problem here. it was only the certificate with a bad information (hostname =/= IP address thing...). All is working well .

        Comment

        • sam
          Junior Member
          • Jul 2014
          • 5

          #184
          other way for the reports

          Originally posted by boe
          Hi wamsterdam.

          You have created a nice script, but report is intended for the boss, and he did not want it to analyze graphs. Requires statistics in numbers.
          Hi Boe,

          would you have any ways for the report? I need this report to complete my Zabbix.

          Thanks very much!!

          Comment

          • Rotunnoz
            Junior Member
            • Jul 2014
            • 3

            #185
            Documentation

            Hello,

            I much appreciate this feature however I'm uncertain how to use it.

            I have Zabbix v2.2 running under Ubuntu 14.04 and I got to the point of generating the sample PDF report just fine, no errors whatsoever.

            How should I be adding the stuff I want to my report form? It would be great some sort of readme file describing how to actually build the reports.

            Any help will be very appreciated.


            EDIT:

            Concretely, the problem I was running into was that I'd like see just an "ALL" option when choosing the hosts to generate the report from and that no graph would be added to the report.

            It turns out that this is a common issue associated with versions 2.0 and on. If anyone is having that same trouble, please consider checking out post #65 in this thread by user "yso" at page 7. That completely nailed it for me, just don't forget to restart apache service after you do the suggested changes.
            Last edited by Rotunnoz; 20-08-2014, 14:50. Reason: Editing to add troubleshooting

            Comment

            • budiman
              Junior Member
              • Aug 2014
              • 4

              #186
              same problem

              Originally posted by Eddriks
              Hello guys,

              Just solved my problem here. it was only the certificate with a bad information (hostname =/= IP address thing...). All is working well .
              Hi Eddriks, what do you mean by that? I have the same problems. I don;t know why. Could you help me?

              on apache error log :
              Undefined variable: offset in /usr/share/zabbix/custom_pages/class.ezpdf.php on line 1392
              Undefined variable: temp in /usr/share/zabbix/custom_pages/class.ezpdf.php on line 1416

              Thank you,
              Last edited by budiman; 15-08-2014, 10:30.

              Comment

              • lana_paradinha
                Junior Member
                • Sep 2013
                • 28

                #187
                Originally posted by budiman
                Hi Eddriks, what do you mean by that? I have the same problems. I don;t know why. Could you help me?

                on apache error log :
                Undefined variable: offset in /usr/share/zabbix/custom_pages/class.ezpdf.php on line 1392
                Undefined variable: temp in /usr/share/zabbix/custom_pages/class.ezpdf.php on line 1416

                Thank you,
                Same problem where

                [Tue Aug 26 09:32:29 2014] [error] [client 192.168.1.10] PHP Notice: Undefined variable: temp in /var/www/html/zabbix/report/class.ezpdf.php on line 1416, referer: http://xxxxx.xxxxx.com.br/report/pdfform.php
                [Tue Aug 26 09:32:29 2014] [error] [client 192.168.1.10] PHP Notice: Undefined variable: offset in /var/www/html/zabbix/report/class.ezpdf.php on line 1392, referer: http://xxxxx.xxxxx.com.br/report/pdfform.php

                Comment

                • lana_paradinha
                  Junior Member
                  • Sep 2013
                  • 28

                  #188
                  Solved!

                  see your language to user guest! change it to english!

                  Comment

                  • Francesco
                    Member
                    • Nov 2013
                    • 48

                    #189
                    Hi, i have one problem :-)
                    my zabbix version is 2.0.8

                    Apache log:
                    [Fri Aug 29 12:07:59 2014] [error] [client 10.0.37.138] PHP Fatal error: Call to undefined function json_encode() in /usr/share/zabbix/zabbix_report_generation/ZabbixAPI.class.php on line 220, referer: http://172.25.1.13/zabbix/screens.ph...de08de93b86d2a

                    <?php
                    //CONFIGURABLE
                    # zabbix server info(user must have API access)
                    $z_server = 'http://172.25.1.13/zabbix/';
                    $z_user = 'admin';
                    $z_pass = 'password';
                    # tmp_images directory path
                    $z_img_path = '/usr/share/zabbix/zabbix_report_generation/tmp_images/';
                    # should be the tail of the URL
                    $pdf_location = $z_server ."zabbix_report_generation/pdf.php";
                    # paper settings
                    $paper_format = 'LETTER'; // formats supported: 4A0, 2A0, A0 -> A10, B0 -> B10, C0 -> C10, RA0 -> RA4, SRA0 -> SRA4, LETTER, LEGAL, EXECUTIVE, FOLIO
                    $paper_oreintation = 'portrait'; // formats supported: portrait / landscape
                    # time zone
                    $timezone = 'EST';

                    //DO NOT CHANGE BELOW THIS LINE
                    $z_tmp_cookies = "";
                    $z_url_index = $z_server ."index.php";
                    $z_url_graph = $z_server ."chart2.php";
                    $z_url_api = $z_server ."api_jsonrpc.php";
                    //$z_login_data = "name=" .$z_user ."&password=" .$z_pass ."&enter=Enter";
                    $z_login_data = "name=" .$z_user ."&password=" .$z_pass ."&enter=Sign in";



                    $data = './data.txt';
                    ?>

                    Comment

                    • RonnyP
                      Junior Member
                      • Sep 2014
                      • 5

                      #190
                      Dynamic PDF Generator rewritten - v0.5

                      I've rewritten most of the code for the Dynamic PDF Generator to suit me better. I have not done much changes with the code that do the actual PDF generation.
                      Maybe someone else will find this modified version useful as well.

                      I don't use this through a screen since the screen refreshes, and some larger reports may take a while to generate.
                      I just install this under the web-folder as "report". You may need to adjust some parameters in config.inc.php, in particular:
                      $z_server = 'http://your-zabbix-server-address/zabbix/';
                      $z_user = 'Admin';
                      $z_pass = 'ChangePassword';
                      $company_name = 'Zabbix'; // Used in PDF Report

                      The index page now is a bit more loaded with Javascript - mostly Jquery to help with typeable selector, calendar, hiding/displaying fields based on radio buttons.

                      Changes (that I can remember :
                      * inc/: Moved included files to its own folder
                      * js/ : Created javascript (jquery) files in its own folder
                      * css/: Moved css files to its own folder. Added some of Zabbix CSS to
                      these.
                      * index.php: Rewrote all of "pdfform.php" and created it as just index.php.
                      * index.php: Allows reporting on group. Uses GroupID and HostID from
                      Zabbix API (not name).
                      * index.php: Uses Jquery (javascript) for many of the functions on the index page.
                      * index.php: Uses Jquery Calendar to select range for custom timeframe
                      * index.php: Uses Jquery Selector2 where you can search in the select
                      box. Good for installations with many groups/hosts.
                      * createpdf.php: Merged and rewrote code for pdf.php and
                      generatedreport.php.
                      * createpdf.php: Stores created reports in reports subdirectory. Does
                      * createpdf.php: Added some sanitization with filter_input on some
                      _GET variables. Need to implement on more.
                      * inc/index.functions.php: Moved some common function in index.php to
                      an included file
                      * inc/createpdf.functions.php: Moved common function from createpdf.php

                      Download:

                      Comment

                      • bimvis
                        Junior Member
                        • Sep 2013
                        • 5

                        #191
                        Originally posted by RonnyP
                        I've rewritten most of the code for the Dynamic PDF Generator to suit me better. I have not done much changes with the code that do the actual PDF generation.
                        Maybe someone else will find this modified version useful as well.

                        I don't use this through a screen since the screen refreshes, and some larger reports may take a while to generate.
                        I just install this under the web-folder as "report". You may need to adjust some parameters in config.inc.php, in particular:
                        $z_server = 'http://your-zabbix-server-address/zabbix/';
                        $z_user = 'Admin';
                        $z_pass = 'ChangePassword';
                        $company_name = 'Zabbix'; // Used in PDF Report

                        The index page now is a bit more loaded with Javascript - mostly Jquery to help with typeable selector, calendar, hiding/displaying fields based on radio buttons.

                        Changes (that I can remember :
                        * inc/: Moved included files to its own folder
                        * js/ : Created javascript (jquery) files in its own folder
                        * css/: Moved css files to its own folder. Added some of Zabbix CSS to
                        these.
                        * index.php: Rewrote all of "pdfform.php" and created it as just index.php.
                        * index.php: Allows reporting on group. Uses GroupID and HostID from
                        Zabbix API (not name).
                        * index.php: Uses Jquery (javascript) for many of the functions on the index page.
                        * index.php: Uses Jquery Calendar to select range for custom timeframe
                        * index.php: Uses Jquery Selector2 where you can search in the select
                        box. Good for installations with many groups/hosts.
                        * createpdf.php: Merged and rewrote code for pdf.php and
                        generatedreport.php.
                        * createpdf.php: Stores created reports in reports subdirectory. Does
                        * createpdf.php: Added some sanitization with filter_input on some
                        _GET variables. Need to implement on more.
                        * inc/index.functions.php: Moved some common function in index.php to
                        an included file
                        * inc/createpdf.functions.php: Moved common function from createpdf.php

                        Download:
                        https://www.dropbox.com/s/sfhw8gy0dr...t.v05.zip?dl=0

                        Great customization.. I willl test this in more detail next week. You think it is also possible to genereate a SLA report for the uptime of websites?

                        Smika

                        Comment

                        • Mick
                          Member
                          • Jan 2014
                          • 31

                          #192
                          Hello all

                          I implement this package https://www.dropbox.com/s/sfhw8gy0dr...t.v05.zip?dl=0 to my zabbix version 2.2.6 and I click generate I see something this, screen in attachment. Below I share my config.inc.php:


                          <?php
                          //CONFIGURABLE
                          # zabbix server info(user must have API access)
                          $z_server = 'http://192.168.175.245/zabbix/';
                          $z_user = 'Admin';
                          $z_pass = 'zabbix';
                          # Temporary directory for storing pdf data and graphs - must exist
                          $z_tmp_path = './tmp';
                          # Directory for storing PDF reports
                          $pdf_report_dir = './reports';
                          # Root URL to reports
                          $pdf_report_url = $z_server ."report/reports";
                          # paper settings
                          $paper_format = 'A4'; // formats supported: 4A0, 2A0, A0 -> A10, B0 -> B10, C0 -> C10, RA0 -> RA4, SRA0 -> SRA4, LETTER, LEGAL, EXECUTIVE, FOLIO
                          $paper_orientation = 'portrait'; // formats supported: portrait / landscape
                          # time zone - see http://php.net/manual/en/timezones.php
                          $timezone = 'Europe/Oslo';
                          # Logo used in PDF - may be empty
                          # TODO: Specify image size!
                          $pdf_logo = './images/zabbix.png';
                          $company_name = 'Zabbix';

                          //DO NOT CHANGE BELOW THIS LINE
                          $z_tmp_cookies = "/tmp/";
                          $z_url_index = $z_server ."index.php";
                          $z_url_graph = $z_server ."chart2.php";
                          $z_url_api = $z_server ."api_jsonrpc.php";
                          $z_login_data = "name=" .$z_user ."&password=" .$z_pass ."&autologin=1&enter=Sign+in";
                          ?>
                          Attached Files

                          Comment

                          • RonnyP
                            Junior Member
                            • Sep 2014
                            • 5

                            #193
                            Originally posted by Mick
                            Hello all
                            I implement this package https://www.dropbox.com/s/sfhw8gy0dr...t.v05.zip?dl=0 to my zabbix version 2.2.6 and I click generate I see something this, screen in attachment. Below I share my config.inc.php:
                            ....
                            Can you check if a file was actually written to the reports sub-dir?
                            It may be that the web-server user do not have permission to write to this folder.
                            I gave this folder these permissions (on RHEL, where webserver user is apache):
                            chgrp apache reports
                            chmod 775 reports

                            I'll remember to update the install-instructions with this info.

                            Comment

                            • RonnyP
                              Junior Member
                              • Sep 2014
                              • 5

                              #194
                              Originally posted by bimvis
                              Great customization.. I willl test this in more detail next week. You think it is also possible to genereate a SLA report for the uptime of websites?

                              Smika
                              I think an SLA-report would be a bit different than this report. A different report probably have to be written.
                              This reporting only adds all graphs on a host/hostgroup to a PDF-report.

                              Comment

                              • johnatan.camargo
                                Junior Member
                                • Oct 2014
                                • 3

                                #195
                                Problem

                                Hi.
                                I'm also having trouble. Below the Apache log.

                                [Fri Oct 17 21:26:25 2014] [error] [client 172.16.0.4] PHP Warning: Creating default object from empty value in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 122
                                [Fri Oct 17 21:26:25 2014] [error] [client 172.16.0.4] PHP Fatal error: Call to undefined function curl_init() in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 322
                                [Fri Oct 17 21:34:06 2014] [error] [client 172.16.0.4] PHP Warning: Creating default object from empty value in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 122
                                [Fri Oct 17 21:34:06 2014] [error] [client 172.16.0.4] PHP Fatal error: Call to undefined function curl_init() in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 322
                                [Fri Oct 17 21:34:15 2014] [error] [client 172.16.0.4] PHP Warning: Creating default object from empty value in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 122, referer: http://172.16.0.8/zabbix/screenedit....te&screenid=20
                                [Fri Oct 17 21:34:15 2014] [error] [client 172.16.0.4] PHP Fatal error: Call to undefined function curl_init() in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 322, referer: http://172.16.0.8/zabbix/screenedit....te&screenid=20
                                Can help me ?

                                Comment

                                Working...