Ad Widget

Collapse

Zabbix Dynamic PDF Report Generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doughall
    Junior Member
    • Feb 2010
    • 5

    #61
    Such a shame this thread's dead..

    Comment

    • Axilla
      Senior Member
      • Aug 2010
      • 130

      #62
      its not dead, i just don't have a lot of time to work on it atm.. the source is hosted on zabbix.org.

      Comment

      • xcalibur
        Member
        • Apr 2011
        • 40

        #63
        Originally posted by doughall
        I added an ECHO to the pdfform.php to see the contents of the array, and it spat out all the hostids..
        Same thing here.
        DID you manage to solve that sucka?

        Comment

        • xcalibur
          Member
          • Apr 2011
          • 40

          #64
          Originally posted by Axilla
          its not dead, i just don't have a lot of time to work on it atm.. the source is hosted on zabbix.org.
          Any chance you can tell us why on Zabbix 2.0 only "ALL" is showed under "HOSTS"?

          Thanks!

          Comment

          • yso
            Junior Member
            • Aug 2011
            • 16

            #65
            pdfform.php

            < $hosts = ZabbixAPI::fetch_array('host','get',array('output' =>'extend','sortfield'=>'host','with_graphs'=>'1') )
            ---
            > $hosts = ZabbixAPI::fetch_array('host','get',array('extendo utput'=>'shorten','sortfield'=>'host','with_graphs '=>'1'))



            generatereport.php

            < $hostGraphs = ZabbixAPI::fetch_array('graph','get',array('output '=>'extend','filter'=>array('host'=>$site)))
            ---
            > $hostGraphs = ZabbixAPI::fetch_array('host','get',array('extendo utput'=>'shorten','select_graphs'=>'shorten','filt er'=>array('host'=>$site)))


            < $hostsGraphs = ZabbixAPI::fetch_array('graph','get',array('output '=>'extend'))
            ---
            > $hostsGraphs = ZabbixAPI::fetch_array('host','get',array('extendo utput'=>'shorten','select_graphs'=>'shorten','filt er'=>array('graphids'=>'')))


            config.inc.pdf

            < $z_login_data = "name=" .$z_user ."&password=" .$z_pass ."&enter=Sign in";
            ---
            > $z_login_data = "name=" .$z_user ."&password=" .$z_pass ."&enter=Enter";


            Try this changes...

            Andy

            Comment

            • jitheshr89
              Junior Member
              • Oct 2012
              • 26

              #66
              How to make a User with API acess

              zabbix Version 2.0
              Ubuntu 12.04

              Could you please tell how to make a user with API access. Now am getting a PDF with out any data. Haader and footer is showing but not any graphs inside to that. Hope i will get a help

              Comment

              • jitheshr89
                Junior Member
                • Oct 2012
                • 26

                #67
                Blank Pdf is getting

                Blank Pdf is generated
                Images are saving into tmp_images but not able to view (fatal error reading PNG image file: not a PNG file)

                Comment

                • yso
                  Junior Member
                  • Aug 2011
                  • 16

                  #68
                  Originally posted by jitheshr89
                  zabbix Version 2.0
                  Ubuntu 12.04

                  Could you please tell how to make a user with API access. Now am getting a PDF with out any data. Haader and footer is showing but not any graphs inside to that. Hope i will get a help
                  Just add the User to the API-Group...

                  Comment

                  • yso
                    Junior Member
                    • Aug 2011
                    • 16

                    #69
                    Originally posted by jitheshr89
                    Blank Pdf is generated
                    Images are saving into tmp_images but not able to view (fatal error reading PNG image file: not a PNG file)
                    Can you read something in the generatd png-File with a texteditor?
                    Do you have GD-Lib wth png installed on your system?

                    Comment

                    • jitheshr89
                      Junior Member
                      • Oct 2012
                      • 26

                      #70
                      Apacha2 error.log.

                      Thanks Yso for your kind help.

                      Gd is already installed. Still am not able not getting Graphs in PDF report.
                      If possible please go through the error log i posted below.


                      PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' - /usr/lib/php5/20090626+lfs/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
                      PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/json.so' - /usr/lib/php5/20090626+lfs/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
                      PHP Warning: Module 'ffmpeg' already loaded in Unknown on line 0
                      [Sun Oct 21 19:50:51 2012] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.4 with Suhosin-Patch configured -- resuming normal operations


                      [Sun Oct 21 20:24:06 2012] [error] [client 192.168.1.100] PHP Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/user/public_html/class.pdf.php on line 2641, referer: http://192.168.1.100/zabbix/pdfform.php
                      [Sun Oct 21 20:24:06 2012] [error] [client 192.168.1.100] PHP Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/user/public_html/class.pdf.php on line 2653, referer: http://192.168.1.100/zabbix/pdfform.php





                      Advance Thanks
                      Jithesh R

                      Comment

                      • yso
                        Junior Member
                        • Aug 2011
                        • 16

                        #71
                        Originally posted by jitheshr89
                        Thanks Yso for your kind help.
                        PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' - /usr/lib/php5/20090626+lfs/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
                        You need curl... do you have installed?

                        php_curl.dll: dll-files are windows related... you can't load it under linux.

                        Normaly you sould have a .so-file, or compiled curl in php directly.

                        Andy

                        Comment

                        • jitheshr89
                          Junior Member
                          • Oct 2012
                          • 26

                          #72
                          Once again Thanks Yso for your help,

                          I already installed Curl. These are the extention am getting.
                          -------------------------------------------------------------------------------------------------------------------------
                          user@L283:~$ php -m

                          [PHP Modules]
                          bcmath
                          bz2
                          calendar
                          Core
                          ctype
                          curl
                          date
                          dba
                          dom
                          ereg
                          exif
                          ffmpeg
                          fileinfo
                          filter
                          ftp
                          gd
                          gettext
                          hash
                          iconv
                          json
                          libxml
                          mbstring
                          mhash
                          mysql
                          mysqli
                          openssl
                          pcntl
                          pcre
                          PDO
                          pdo_mysql
                          Phar
                          posix
                          readline
                          Reflection
                          session
                          shmop
                          SimpleXML
                          soap
                          sockets
                          SPL
                          standard
                          sysvmsg
                          sysvsem
                          sysvshm
                          tokenizer
                          wddx
                          xml
                          xmlreader
                          xmlwriter
                          zip
                          zlib
                          --------------------------------------------------------------------------------------------------------------------------
                          Also .so files is located in same folder . But dont know why apache shwoing warning related dll files.
                          user@L283:/usr/lib/php5/20090626+lfs$ ls
                          curl.so ffmpeg.so gd.so mysqli.so mysql.so pdo_mysql.so pdo.so
                          ----------------------------------------------------------------------------------------------------------------------------
                          I removed '?>' from all Pdf Generating files(Pfd.php, pdfform.php,ZabbixAPI.class.php,class.ezpdf.php,cl ass.pdf.php,config.inc.php,generatereport.php). But still am getting graphs in PDF file. Also not able to open png files in tmp_images folder(fatal error is showing). Now no error is showing in apacha error log when i downloaded the PDF file. But showing warning when i restart Apache. Warning shown below.


                          PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' - /usr/lib/php5/20090626+lfs/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
                          PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/json.so' - /usr/lib/php5/20090626+lfs/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
                          PHP Warning: Module 'ffmpeg' already loaded in Unknown on line 0
                          [Mon Oct 22 11:02:41 2012] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.4 with Suhosin-Patch configured -- resuming normal operations



                          Yso could you please check this.
                          Last edited by jitheshr89; 22-10-2012, 07:42.

                          Comment

                          • Tracs
                            Junior Member
                            • Oct 2012
                            • 9

                            #73
                            Can't login

                            I have been unable to get this running with Zabbix 2.0.3. Had anyone done this and if so how do i set it up?? I am trying to get reporting done to send to clients. Any help would be apreciated. THank you.

                            Comment

                            • jitheshr89
                              Junior Member
                              • Oct 2012
                              • 26

                              #74
                              hi Tracs

                              hi,
                              Tracs, I got the screen and PDF is generating. BUt PDF report is blank. SO to that step I can help you. please describe your correct issue.

                              Am Using
                              Zabbix Version 2.0.3
                              OS: Ubuntu
                              DB: Mysql

                              Comment

                              • jitheshr89
                                Junior Member
                                • Oct 2012
                                • 26

                                #75
                                Its Working now

                                Hi friends,


                                Now PDF is generating with Graph. Now I want to send those PDF through Gmail. Does anybody have script for that please share.
                                Version 2.0.3
                                OS : Ubuntu
                                DB MySQL
                                Special thnaks to AXILA,YSO
                                Thanks for your all support. Expecting same in future too.

                                Comment

                                Working...