Ad Widget

Collapse

Zabbix Dynamic PDF Report Generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SupportGuy
    Member
    • Mar 2012
    • 30

    #106
    Hello,

    Just to give my feeback.

    It works fine for me with Zabbix 2.0.4 under RH6.3 and PHP 5.3

    Thank you for this great job, it makes up a lack of Zabbix.

    Just one suggetsion / improvment idea, it would be nice to had other filter by choosing for example :
    - several hosts but not all,
    - the graphs to had to the report.

    In my dozen of servers and hundreds of items it may be quite heavy

    Comment

    • thiagomz
      Member
      • Jan 2010
      • 74

      #107
      Originally posted by marakshin
      Upgrade source code for working with version Zabbix 2.0.4 + php5.3
      - call deprecated functions in ini_set();
      - change login string;
      - change API calls to new format;
      Version in attachment (without folder: fonts - attachment limit).

      Waiting for feedback
      Hi !

      What can be that ... ?

      Code:
      [Mon Feb 04 18:48:46 2013] [error] [client 177.139.249.10] PHP Warning:  unlink(zabbix_cookie_1430.txt): No such file or directory in /var/www/zabbix/report/generatereport.php on line 44, referer: http://zabbix.mysite.com/report/pdfform.php
      [Mon Feb 04 18:48:47 2013] [error] [client 177.139.249.10] PHP Warning:  unlink(zabbix_cookie_1449.txt): No such file or directory in /var/www/zabbix/report/generatereport.php on line 44, referer: http://zabbix.mysite.com/report/pdfform.php
      Other problem.. in the screen I am able to select the host .. when I click in Generate.. it process but do not open anything...

      If I use the url http://zabbix.mysite.com/report/pdfform.php It open the pdf.. but very unformated...

      tkz all

      Comment

      • G3r0m3G
        Junior Member
        • Dec 2012
        • 16

        #108
        Hello thiagomz,

        Create a directory called "tmp_cookies" in your root zabbix directory. Then, apply security on this folder with apache user/group owner.

        G3r0m3G

        Comment

        • vincentk222
          Junior Member
          • Feb 2013
          • 1

          #109
          Hi all
          I'm little bit lost ...
          how doest it work
          Do i need to configure the report with data.txt or is this file generated automatically?
          vincent

          Comment

          • parabola
            Junior Member
            • Sep 2009
            • 14

            #110
            Thanks for taking the time to create this plugin

            Any chance we could get the ability to have a single graph / report for a host group (for availability report reasons) that would be fantastic!

            -Parabola

            Comment

            • tiagosoares
              Member
              Zabbix Certified Specialist
              • Jul 2010
              • 35

              #111
              Hey Guys,

              Everything is working fine, except the layout of PDF as you can see attached.

              Any help?

              Many Tks!
              Attached Files

              Comment

              • cloudmafia
                Junior Member
                • Nov 2012
                • 23

                #112
                PDF Reort Generation

                having issue installing FFMPEG, after installing ffmpeg,ffmpeg-devel and libs, unable to find ffmpeg.so... please let me know whether it is very much required to generate PDF or is there any alternative or solution.

                Comment

                • krawalli
                  Junior Member
                  • Feb 2013
                  • 1

                  #113
                  Originally posted by tiagosoares
                  Hey Guys,

                  Everything is working fine, except the layout of PDF as you can see attached.

                  Any help?

                  Many Tks!
                  Are the fonts installed?

                  Comment

                  • tiagosoares
                    Member
                    Zabbix Certified Specialist
                    • Jul 2010
                    • 35

                    #114
                    Hey krawalli!!

                    Thats it! I just downloaded the zip file provided by marakshin (to version 2.0.4) and the "font" folder was not included.

                    Thank you!

                    Tiago.

                    Comment

                    • fdeco
                      Junior Member
                      • Feb 2013
                      • 4

                      #115
                      Scheduled reports

                      Hello everybody!

                      Is there a way of scheduling this PDF reports? Can it be added to a next version?

                      Comment

                      • wamsterdam
                        Member
                        • Apr 2013
                        • 34

                        #116
                        Not yet working...

                        I'm trying to get this to work with version 2.0.5, but with little succes. At first, I could only choose ALL for hosts. After putting a var_dump($hosts) on line 50 in pdfforms.php (after fetching the data with ZabbixAPI:fetch_array), my browser shows an array containing:

                        Code:
                        array(13) {
                          [0]=>
                          array(1) {
                            ["hostid"]=>
                            string(5) "10125"
                          }
                          [1]=>
                          array(1) {
                            ["hostid"]=>
                            string(5) "10079"
                          }
                          [2]=>
                          array(1) {
                            ["hostid"]=>
                            string(5) "10076"
                          }
                        [...]
                        The function ReadArray in pdfform.php expects "host", not "hostid" as in the array. When I change (line 34):

                        PHP Code:
                        if($key == 'host') {
                            echo 
                        "<option value=\"$value\">$value</option>";

                        to:

                        PHP Code:
                        if($key == 'hostid') {
                            echo 
                        "<option value=\"$value\">$value</option>";

                        I can choose my hosts. Not by name though, but by hostid. I do not know if it is supposed to show hostnames or hostid's? So now I can choose hosts, an image is created in tmp_images and a PDF file is created. But instead of showing graphs, it is showing an image with error: Critical error, field "graphid" is not integer. Exactly the same error as zabbixflic in reply #32, but had no API access. I do, because I recieve a list of hosts.

                        Is this because of me editing pdfform.pdf or because I upgraded from 1.8.7 to 2.0.5? Does anybody know what it takes to get this working?

                        TIA,
                        Wouter

                        EDIT: OK, a little bit closer... I also had to change generatereport.pdf (line 116) change "host" to "hostid":

                        PHP Code:
                        $hostGraphs ZabbixAPI::fetch_array('graph','get',array('extendoutput'=>'shorten','select_graphs'=>'shorten','filter'=>array('host'=>$site)))
                                or die(
                        'Unable to get graphs: '.print_r(ZabbixAPI::getLastError(),true)); 
                        to:

                        PHP Code:
                        $hostGraphs ZabbixAPI::fetch_array('graph','get',array('extendoutput'=>'shorten','select_graphs'=>'shorten','filter'=>array('hostid'=>$site)))
                                or die(
                        'Unable to get graphs: '.print_r(ZabbixAPI::getLastError(),true)); 
                        But now my image contains only HTML code:

                        Code:
                        You are not logged in.
                        You cannot view this URL as a guest. You must login to view this page.
                        If you think this message is wrong, please consult your administrators about getting the necessary permissions.
                        Now what?
                        Last edited by wamsterdam; 18-04-2013, 16:26.

                        Comment

                        • wamsterdam
                          Member
                          • Apr 2013
                          • 34

                          #117
                          It's working now

                          Finally got it working now. I forgot to edit the $z_login_data string in config.inc.php as mentioned in post #65. If you use Travis's version from post #100 and replace "host" with "hostid" as in my previous post, you're good to go with Zabbix 2.0.5.

                          Wouter

                          Comment

                          • kot_vaska
                            Junior Member
                            • Jan 2012
                            • 13

                            #118
                            Hi, I'm trying to use this on Ubuntu Server 12.04 LTS, Zabbix 1.8.11
                            I'm getting a PDF report but with no graphs (blank Graphs page).

                            This is what shows up in apache logs many times (probably 1 for each graph):

                            [Mon Apr 22 12:34:47 2013] [error] [client 10.10.10.10] PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/custom_pages/class.ezpdf.php on line 1319, referer: http://10.10.10.2/custom_pages/pdfform.php
                            PNG files in tmp_images all have the size of "0".

                            Is there something missing?

                            Comment

                            • wamsterdam
                              Member
                              • Apr 2013
                              • 34

                              #119
                              Have you put the correct permissions on the tmp_images folder?

                              Wouter

                              Comment

                              • kot_vaska
                                Junior Member
                                • Jan 2012
                                • 13

                                #120
                                Originally posted by wamsterdam
                                Have you put the correct permissions on the tmp_images folder?

                                Wouter
                                drwxrwxr-x 2 root www-data 4096 Apr 22 13:36 tmp_images

                                It must be, otherwise png files in the tmp_images folder would not be created. They just are 0 in size.

                                Created files:
                                -rw-r--r-- 1 www-data www-data 0 Apr 23 00:11 UBR10k-nov-Cable7_1_4379.png
                                Last edited by kot_vaska; 23-04-2013, 07:33.

                                Comment

                                Working...