Ad Widget

Collapse

Zabbix Dynamic PDF Report Generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbixflic
    Member
    • Jan 2012
    • 39

    #31
    Ok Axilla,
    thanks to your aid using error_reporting I saw there was an issue
    due to an incomplete Curl installation. So first problem is solved

    Now I see Host and Time Period and, about Host, I can select
    only ALL. Also, selecting ALL and whatevere time period I get
    this error :

    Host: All
    Time Period: Hour


    Warning: Cannot modify header information - headers already sent by (output started at /home/zabbix/public_html/generatereport.php:94) in /home/zabbix/public_html/generatereport.php on line 44

    Warning: unlink(zabbix_cookie_.txt) [function.unlink]: No such file or directory in /home/zabbix/public_html/generatereport.php on line 45

    Warning: Cannot modify header information - headers already sent by (output started at /home/zabbix/public_html/generatereport.php:94) in /home/zabbix/public_html/generatereport.php on line 49

    Warning: Cannot modify header information - headers already sent by (output started at /home/zabbix/public_html/generatereport.php:94) in /home/zabbix/public_html/generatereport.php on line 141

    Thank you and regards

    F.

    Comment

    • zabbixflic
      Member
      • Jan 2012
      • 39

      #32
      Hi Axilla,

      I solved also that, now this is the situation :

      - again I can select only ALL

      - I get report with no graphs and error attached here

      thanks
      Attached Files

      Comment

      • zabbixflic
        Member
        • Jan 2012
        • 39

        #33
        Hi,

        any help ?

        Thanks

        edit:
        apache error log :


        [Fri Feb 17 12:14:16 2012] [error] [client 10.130.212.14] PHP Warning: unlink(zabbix_cookie_.txt): No such file or directory in /home/zabbix/public_html/generatereport.php on line 45, referer: http://10.129.93.154/zabbix/pdfform.php
        [Fri Feb 17 12:14:16 2012] [error] [client 10.130.212.14] PHP Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/zabbix/public_html/class.pdf.php on line 2641, referer: http://10.129.93.154/zabbix/pdfform.php
        [Fri Feb 17 12:14:16 2012] [error] [client 10.130.212.14] PHP Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/zabbix/public_html/class.pdf.php on line 2653, referer: http://10.129.93.154/zabbix/pdfform.php
        [Fri Feb 17 12:14:16 2012] [error] [client 10.130.212.14] PHP Notice: Undefined variable: offset in /home/zabbix/public_html/class.ezpdf.php on line 1392, referer: http://10.129.93.154/zabbix/pdfform.php
        Last edited by zabbixflic; 17-02-2012, 13:23.

        Comment

        • Axilla
          Senior Member
          • Aug 2010
          • 130

          #34
          the user has API access? It appears he doesn't.. or you would see a list of your hosts..

          Comment

          • zabbixflic
            Member
            • Jan 2012
            • 39

            #35
            Originally posted by Axilla
            the user has API access? It appears he doesn't.. or you would see a list of your hosts..
            Ok, so how can I enable user to have API access ?

            My user is root and he is an Administrator

            Zabbix version 1.8.10

            thanks
            bye
            Last edited by zabbixflic; 18-02-2012, 09:49.

            Comment

            • zabbixflic
              Member
              • Jan 2012
              • 39

              #36
              Ok good,
              all is working.

              User was not Api access enabled by default.

              EDIT : Timezone ok

              So what about enable automatic reporting and sending by email.

              Best regards and thanks!



              F.
              Last edited by zabbixflic; 20-02-2012, 12:28.

              Comment

              • jrprado
                Junior Member
                • Sep 2010
                • 28

                #37
                Occurring error in the PDF generation

                I need your help.

                I installed everything right, is listing the hosts, but is occurring error in the PDF generation. Here is the error in apache log:

                Code:
                [Fri Feb 24 11:00:18 2012] [error] [client 10.8.4.144] PHP Warning:  unlink(zabbix_cookie_28946.txt): No such file or directory in /var/www/html/zabbix_181  0/paginas/generatereport.php on line 45, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                [Fri Feb 24 11:00:20 2012] [error] [client 10.8.4.144] PHP Warning:  unlink(zabbix_cookie_17349.txt): No such file or directory in /var/www/html/zabbix_181  0/paginas/generatereport.php on line 45, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                [Fri Feb 24 11:00:48 2012] [error] [client 10.8.4.144] PHP Deprecated:  Function set_magic_quotes_runtime() is deprecated in /var/www/html/zabbix_1810/paginas/class.pdf.php on line 2641, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                [Fri Feb 24 11:00:48 2012] [error] [client 10.8.4.144] PHP Deprecated:  Function set_magic_quotes_runtime() is deprecated in /var/www/html/zabbix_1810/paginas/class.pdf.php on line 2653, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                [Fri Feb 24 11:00:48 2012] [error] [client 10.8.4.144] PHP Notice:  Undefined variable: offset in /var/www/html/zabbix_1810/paginas/class.ezpdf.php on line 1392, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                Follow the setup config.inc.php

                Code:
                <?php
                //CONFIGURABLE
                # zabbix server info(user must have API access)
                $z_server       = 'http://10.4.5.60/zabbix_1810/';
                $z_user         = '****';
                $z_pass         = '****';
                # tmp_images directory path
                $z_img_path = '/var/www/html/zabbix_1810/paginas/tmp_images/';
                # should be the tail of the URL
                $pdf_location = $z_server ."paginas/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";
                $data = './data.txt';
                ?>

                Comment

                • zabbixflic
                  Member
                  • Jan 2012
                  • 39

                  #38
                  Originally posted by jrprado
                  I need your help.

                  I installed everything right, is listing the hosts, but is occurring error in the PDF generation. Here is the error in apache log:

                  Code:
                  [Fri Feb 24 11:00:18 2012] [error] [client 10.8.4.144] PHP Warning:  unlink(zabbix_cookie_28946.txt): No such file or directory in /var/www/html/zabbix_181  0/paginas/generatereport.php on line 45, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                  [Fri Feb 24 11:00:20 2012] [error] [client 10.8.4.144] PHP Warning:  unlink(zabbix_cookie_17349.txt): No such file or directory in /var/www/html/zabbix_181  0/paginas/generatereport.php on line 45, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                  [Fri Feb 24 11:00:48 2012] [error] [client 10.8.4.144] PHP Deprecated:  Function set_magic_quotes_runtime() is deprecated in /var/www/html/zabbix_1810/paginas/class.pdf.php on line 2641, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                  [Fri Feb 24 11:00:48 2012] [error] [client 10.8.4.144] PHP Deprecated:  Function set_magic_quotes_runtime() is deprecated in /var/www/html/zabbix_1810/paginas/class.pdf.php on line 2653, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                  [Fri Feb 24 11:00:48 2012] [error] [client 10.8.4.144] PHP Notice:  Undefined variable: offset in /var/www/html/zabbix_1810/paginas/class.ezpdf.php on line 1392, referer: http://10.4.5.60/zabbix_1810/paginas/pdfform.php
                  Follow the setup config.inc.php

                  Code:
                  <?php
                  //CONFIGURABLE
                  # zabbix server info(user must have API access)
                  $z_server       = 'http://10.4.5.60/zabbix_1810/';
                  $z_user         = '****';
                  $z_pass         = '****';
                  # tmp_images directory path
                  $z_img_path = '/var/www/html/zabbix_1810/paginas/tmp_images/';
                  # should be the tail of the URL
                  $pdf_location = $z_server ."paginas/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";
                  $data = './data.txt';
                  ?>
                  Hi,
                  I was experience same error as you can see in my previous post.

                  Issue has been solved putting my user "root" also into "Api users"; it was
                  only an Administrator.

                  Regards

                  Comment

                  • jrprado
                    Junior Member
                    • Sep 2010
                    • 28

                    #39
                    Originally posted by zabbixflic
                    Hi,
                    I was experience same error as you can see in my previous post.

                    Issue has been solved putting my user "root" also into "Api users"; it was
                    only an Administrator.

                    Regards

                    I checked the user has API acess enabled. If user do not have permission would not be shown the list of hosts.

                    Comment

                    • mgielissen
                      Junior Member
                      • Nov 2009
                      • 8

                      #40
                      Originally posted by jrprado
                      I checked the user has API acess enabled. If user do not have permission would not be shown the list of hosts.
                      I have the same problem with zabbix 1.8.10 (Centos 6). User admin has API rights and. PNG files are generated under tmp_images but the pdf file is unreadable.

                      Comment

                      • mgielissen
                        Junior Member
                        • Nov 2009
                        • 8

                        #41
                        Originally posted by mgielissen
                        I have the same problem with zabbix 1.8.10 (Centos 6). User admin has API rights and. PNG files are generated under tmp_images but the pdf file is unreadable.
                        Found the solution: php.ini set display_error = OFF

                        Comment

                        • zabbixflic
                          Member
                          • Jan 2012
                          • 39

                          #42
                          Hi guys,

                          any idea about add an image (logo) on my pdf instead of "Zabbix"'s rectangle ?

                          I tried to edit pdf.php in this way :

                          $pdf->EzImage("../images/mylogo.png", 0, 535, "none", "left");

                          or

                          $pdf->addPngFromFile("../images/mylogo.png", 80, 8, 25);

                          but no luck and no errors on

                          /var/log/apache2/error.log

                          Any hint ?

                          thnx

                          Comment

                          • Axilla
                            Senior Member
                            • Aug 2010
                            • 130

                            #43
                            hi guys, sorry it took so long, been busy with work, and haven't had a lot of time to dedicate to this. I will look into adding e-mailing of reports, etc

                            those that are having errors when generating the report.. go to your php.ini and set display_errors = OFF..

                            I hope to update the library, and improve this project in the near future.
                            Last edited by Axilla; 05-03-2012, 15:57.

                            Comment

                            • zabbixflic
                              Member
                              • Jan 2012
                              • 39

                              #44
                              Many thanks Axilla for your work,

                              maybe someone else was already able to add image

                              Bye

                              Comment

                              • Axilla
                                Senior Member
                                • Aug 2010
                                • 130

                                #45
                                Originally posted by zabbixflic
                                Many thanks Axilla for your work,

                                maybe someone else was already able to add image

                                Bye
                                i've had issues with PNG's in the library i'm using.. try making it a JPEG and changing it to addJpegFromFile..

                                I will continue to make improvements and fix these issues.

                                Comment

                                Working...