Ad Widget

Collapse

Zabbix Dynamic PDF Report Generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edeyzel
    Junior Member
    • Feb 2018
    • 1

    #346
    Line Spacing

    Has anyone found a way to adjust line spacing, especially system status, triggers and trends page.

    The sections follow to close up to each other and the data is very bunched up if you get what I'm saying.

    Otherwise awesome tool

    Any help would be appreciated.
    Attached Files

    Comment

    • vlam
      Senior Member
      Zabbix Certified Specialist
      • Jun 2009
      • 166

      #347
      Hi

      After upgrading to 3.2.11 and changing to the latest version of the PDF files I get the following message when logging in


      Unable to login: Array ( [code] => -32602 [message] => Invalid params. [data] => Incorrect method "user.authenticate". )
      4 Zabbix Frontend Servers (Load balanced)
      2 Zabbix App Servers (HA)
      2 Zabbix Database Servers (HA)
      18 Zabbix Proxy Servers (HA)
      3897 Deployed Zabbix Agents
      6161 Values per second
      X-Layer Integration
      Jaspersoft report Servers (HA)

      Comment

      • dipak
        Junior Member
        • Mar 2018
        • 1

        #348
        hi getting this error

        Unable to logout: Array ( [code] => -32602 [message] => Invalid params. [data] => Invalid parameter "/": unexpected parameter "user". [debug] => Array ( [0] => Array ( [file] => /usr/share/zabbix/include/classes/api/services/CUser.php [line] => 1310 [function] => exception [class] => CApiService [type] => :: [args] => Array ( [0] => 100 [1] => Invalid parameter "/": unexpected parameter "user". ) ) [1] => Array ( [file] => /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php [line] => 123 [function] => logout [class] => CUser [type] => -> [args] => Array ( [0] => Array ( [user] => Admin [auth] => 726c4db3fff5f37dc15254f3197b023b ) ) ) [2] => Array ( [file] => /usr/share/zabbix/include/classes/core/CJsonRpc.php [line] => 87 [function] => callMethod [class] => CLocalApiClient [type] => -> [args] => Array ( [0] => user [1] => logout [2] => Array ( [user] => Admin [auth] => 726c4db3fff5f37dc15254f3197b023b ) [3] => 726c4db3fff5f37dc15254f3197b023b ) ) [3] => Array ( [file] => /usr/share/zabbix/api_jsonrpc.php [line] => 63 [function] => execute [class] => CJsonRpc [type] => -> [args] => Array ( ) ) ) )

        Comment

        • vlam
          Senior Member
          Zabbix Certified Specialist
          • Jun 2009
          • 166

          #349
          Hi, getting following error after login

          I am running on 3.2.11 and my frontend is running on https. When connecting it gets to the login screen and after that it take a long time to load. sometimes it loads and sometimes it gives "An internal server error occurred. Please try again later."

          What can cause this and where would I need to look at fixing it?
          Thanks
          4 Zabbix Frontend Servers (Load balanced)
          2 Zabbix App Servers (HA)
          2 Zabbix Database Servers (HA)
          18 Zabbix Proxy Servers (HA)
          3897 Deployed Zabbix Agents
          6161 Values per second
          X-Layer Integration
          Jaspersoft report Servers (HA)

          Comment

          • aigars.kadikis
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Mar 2018
            • 208

            #350
            Hi,

            Got the report working (using version 0.9.4 https://drive.google.com/uc?export=d...GJqamQ1dFVSWWM) on CentOS 7.4 with zabbix version 3.0.16, but when I apply the same steps on version 3.4.8 then web interface (after entering user credentials) says:
            [CODE] Unable to logout: Array (
            Code:
             => -32602 [message] => Invalid params. [data] => Invalid parameter "/": unexpected parameter "user". )
            httpd error log says
            [Fri Apr 27 02:15:28.875224 2018] [:error] [pid 1498] [client 10.0.2.2:2312] PHP Warning: Creating default object from empty value in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 122, referer: http://localhost:8034/report/
            The line 122 in ZabbixAPI.class.php is:
            Code:
                public static function debugEnabled($value) {
                    // Initialize instance if it isn't already
                    self::__init();
                    if ($value === TRUE)
            [SIZE=16px][B]            self::$instance->debug = true;[/B][/SIZE]
                    else
                        self::$instance->debug = false;
                }

            I have only modified these fields in config.inc.php:
            Code:
            $z_server       = 'http://10.0.2.5/';
            $z_user         = 'Admin';
            $z_pass         = 'zabbix';
            Apart from that everything remains to stay as original.

            Does Zabbix Dynamic PDF Report is executable on later Zabbix version than 3.0?

            Regards,

            Comment

            • aigars.kadikis
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Mar 2018
              • 208

              #351
              Originally posted by matheuscunha
              Temporary Solution on Zabbix 3.4.1

              Hello everyone,

              I found a temporary solution to the problem on version 3.4.1 of Zabbix using a comment # from line 1319 to 1321 in /var/www/html/include/classes/api/services/CUser.php.

              Follow here the current configuration of the file.

              From line 1315 to 1324.
              1315
              1316 public function logout($user) {
              1317 $api_input_rules = ['type' => API_OBJECT, 'fields' => []];
              1318 if (!CApiInputValidator::validate($api_input_rules, $user, '/', $error))
              1319 #{
              1320 # self::exception(ZBX_API_ERROR_PARAMETERS, $error);
              1321 # }
              1322
              1323 $sessionid = self::$userData['sessionid'];
              1324

              Kind Regards
              I can confirm that whis temporary solution works and can be applied on version 3.4.8.

              Still I'm saying this is not recommended thing to do, but here is some notes how to set up Zabbix Dynamic PDF Report 0.9.4 on 3.4.8 under CentOS 7.4
              Scripts for automated Zabbix server/proxy/agent configuration on various operating systems - File not found · aigarskadikis/zabbix-scripts


              Thanks, matheuscunha!

              Comment

              • sab696
                Junior Member
                • Apr 2018
                • 1

                #352
                HI

                I am using zabbix 3.4 version i am able to configer the PDF report

                Reciving the bellow error message


                Unable to login: Array ( [code] => -32602 [message] => Invalid params. [data] => Incorrect method "user.authenticate". )

                Please assist me on this

                Thanks in Advance

                Comment

                • eternalcuriosity
                  Junior Member
                  • Jun 2018
                  • 4

                  #353
                  Originally posted by sab696
                  HI

                  I am using zabbix 3.4 version i am able to configer the PDF report

                  Reciving the bellow error message


                  Unable to login: Array ( [code] => -32602 [message] => Invalid params. [data] => Incorrect method "user.authenticate". )

                  Please assist me on this

                  Thanks in Advance
                  Hi,

                  Were you able to find the solution?

                  Comment


                  • eternalcuriosity
                    eternalcuriosity commented
                    Editing a comment
                    The solution was replacing user.authenticate with user.login in ZabbixAPI.class.php file. user.authenticate is no longer supported.
                • cdslaughter
                  Member
                  • Jun 2018
                  • 69

                  #354
                  So I have searched the forum to the best of my ability, but I cant seem to figure out what I am missing.
                  When I try and generate a report, all it does is think for a moment and just refresh the page. No report is generated that I can tell.
                  I look at the apache error log and see the following error.

                  [Thu Jul 05 12:30:40.016481 2018] [:error] [pid 24865] [client MyIP:60199] PHP Warning: Creating default object from empty value in /usr/share/zabbix/reports/ZabbixAPI.class.php on line 122, referer: http://zabbix.local/reports/pdfform.php
                  [Thu Jul 05 12:30:42.179840 2018] [:error] [pid 24865] [client MyIP:60199] PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /usr/share/zabbix/reports/class.pdf.php:2641\nStack trace:\n#0 /usr/share/zabbix/reports/pdf.php(127): Cpdf->addPngFromFile('./images/zabbix...', 199, 94.372, 200, 0)\n#1 {main}\n thrown in /usr/share/zabbix/reports/class.pdf.php on line 2641, referer: http://zabbix.local/reports/pdfform.php

                  Might anyone have an idea what I am missing?

                  Running 3.4.10 on Ubuntu 16.04
                  Last edited by cdslaughter; 05-07-2018, 19:43.

                  Comment

                  • vlam
                    Senior Member
                    Zabbix Certified Specialist
                    • Jun 2009
                    • 166

                    #355
                    Hi All

                    After changing Web server to Nginx and upgrading php from 5.4 to 7.2 my PDF reporter went completely bonkers

                    CURL URL: https://127.0.0.1/api_jsonrpc.php
                    CURL Options: Array ( [19913] => 1 [13] => 30 [78] => 5 [81] => [64] => [52] => 1 [74] => 1 [10023] => Array ( [0] => Content-Type: application/json-rpc [1] => User-Agent: ZabbixAPI v1.0 - http://andrewfarley.com/zabbix_php_api ) [10036] => POST [10015] => {"auth":null,"method":"user.login","id":1,"para ms" :{"password":"password","user":"reporter"},"json rp c":"2.0"} [10102] => gzip ) Got response from API: ({"jsonrpc":"2.0","result":"1edce19ea938e78a74e1 c5 1164e3de1b","id":1}) Response decoded: (Array ( [jsonrpc] => 2.0 [result] => 1edce19ea938e78a74e1c51164e3de1b [id] => 1 ) __login() Got response from API: (1edce19ea938e78a74e1c51164e3de1b) CURL URL: https://127.0.0.1/api_jsonrpc.php
                    CURL Options: Array ( [19913] => 1 [13] => 30 [78] => 5 [81] => [64] => [52] => 1 [74] => 1 [10023] => Array ( [0] => Content-Type: application/json-rpc [1] => User-Agent: ZabbixAPI v1.0 - http://andrewfarley.com/zabbix_php_api ) [10036] => POST [10015] => {"auth":"1edce19ea938e78a74e1c51164e3de1b","met hod ":"host.get","id":1,"params":{"output":["hostid","name"],"sortfield":"name","with_graphs":"1"},"jsonrpc ":" 2.0"} [10102] => gzip ) Got response from API: ({"jsonrpc":"2.0","result":

                    and then after this is shows me all of the hosts and groups and everything also

                    What can it be and what can I do to resolve it>

                    thanks
                    4 Zabbix Frontend Servers (Load balanced)
                    2 Zabbix App Servers (HA)
                    2 Zabbix Database Servers (HA)
                    18 Zabbix Proxy Servers (HA)
                    3897 Deployed Zabbix Agents
                    6161 Values per second
                    X-Layer Integration
                    Jaspersoft report Servers (HA)

                    Comment

                    • cdslaughter
                      Member
                      • Jun 2018
                      • 69

                      #356
                      Additionally, I am running php 7 and am seeing the following error when it tries to load the zabbix logo from the images directory.

                      PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /usr/share/zabbix/reports/class.pdf.php:2641\nStack trace:\n#0 /usr/share/zabbix/reports/pdf.php(127): Cpdf->addPngFromFile('./images/zabbix...', 199, 94.372, 200, 0)\n#1 {main}\n thrown in /usr/share/zabbix/reports/class.pdf.php on line 2641,

                      it looks like the "PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /usr/share/zabbix/reports/class.pdf.php:2641\nStack trace:\n#0 /usr/share/zabbix/reports/pdf.php(127): Cpdf->addPngFromFile('./images/zabbix...', 199, 94.372, 200, 0)\n#1 {main}\n thrown in /usr/share/zabbix/reports/class.pdf.php on line 2641, " function has been removed from php 7.0.

                      Carl

                      Comment

                      • eternalcuriosity
                        Junior Member
                        • Jun 2018
                        • 4

                        #357
                        Originally posted by cdslaughter
                        Additionally, I am running php 7 and am seeing the following error when it tries to load the zabbix logo from the images directory.

                        PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /usr/share/zabbix/reports/class.pdf.php:2641\nStack trace:\n#0 /usr/share/zabbix/reports/pdf.php(127): Cpdf->addPngFromFile('./images/zabbix...', 199, 94.372, 200, 0)\n#1 {main}\n thrown in /usr/share/zabbix/reports/class.pdf.php on line 2641,

                        it looks like the "PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /usr/share/zabbix/reports/class.pdf.php:2641\nStack trace:\n#0 /usr/share/zabbix/reports/pdf.php(127): Cpdf->addPngFromFile('./images/zabbix...', 199, 94.372, 200, 0)\n#1 {main}\n thrown in /usr/share/zabbix/reports/class.pdf.php on line 2641, " function has been removed from php 7.0.

                        Carl
                        Are you using the older version? Try the new one recompiled by martinm_7


                        Or the ones in Github. I was able to run this successfully with Zabbix 3.4 in centos 7. Only problem is in hostroup report generation.

                        Comment

                        • cdslaughter
                          Member
                          • Jun 2018
                          • 69

                          #358
                          Looks like I found the root cause, but unfortunately, I have not found the solution.

                          The root cause is that the PHP function "get_magic_quotes_runtime()" and the "set_magic_quotes_runtime()" have been depricated and REMOVED from PHP 7.0 and later.
                          from the research I have been doing, it looks like that function's purpose was to automagically escape any special characters that were passed to it in the form of a string.

                          Thank you,
                          Carl Slaughter
                          Network Systems Engineer
                          IBM Cloud (SoftLayer)
                          Managed Services

                          Comment


                          • eternalcuriosity
                            eternalcuriosity commented
                            Editing a comment
                            Edit the file inc/class.pdf.php and replace set_magic_quotes_runtime() with ini_set("set_magic_quotes_runtime", $value):
                            For example: Replace set_magic_quotes_runtime(0); with ini_set("set_magic_quotes_runtime", 0);
                        • Dazor59
                          Junior Member
                          • Jul 2018
                          • 2

                          #359
                          Hi,

                          I'm french user.

                          I have error " Unable to logout: Array ( [code] => -32602 [message] => Invalid params. [data] => Invalid parameter "/": unexpected parameter "user". ) "

                          Can you help me ?

                          Thank you
                          Last edited by Dazor59; 30-07-2018, 17:54.

                          Comment

                          • martinm_76
                            Member
                            • Mar 2015
                            • 57

                            #360
                            With regards to the login issues, I have modified the __logout call in inc/ZabbixAPI.class.php - it was apparently implemented in the wrong way from the beginning, but the API didn't nag about it until 3.4:

                            /**
                            * Private login function to perform the login
                            */
                            private function __logout() {
                            // Try to logout of our API
                            // $data = $this->__callAPI('user.logout', array( 'user' => $this->username, 'auth' => self::$instance->auth_hash ));
                            $data = $this->__callAPI('user.logout', '');

                            if ($this->debug)
                            echo "__logout() Got response from API: ($data)\n";

                            if (isset($data) && strlen($data) == 1) {
                            $this->auth_hash = NULL;
                            return true;
                            } else {
                            $this->auth_hash = $data;
                            return false;
                            }
                            }

                            I'm looking to upload a new version soon, but this should fix it in the meantime, without requiring any changes outside of the PDF report itself.
                            You should use the 0.9.4 report with this change.

                            Comment

                            Working...