Ad Widget

Collapse

Zabbix Dynamic PDF Report Generation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Hi All,

    I'm new to Zabbix. I have installed Zabbix 4.0 recently on centOs and it is running good. I wanted to generate zabbix report in PDF and came across this link " https://github.com/martinm76/zabbix-pdf-report " by martinm76. I downloaded and configured based on the instructions in that link. But still I'm not able to launch report UI.It says 404 not found.

    Here is want I did.

    1. Download https://github.com/martinm76/zabbix-pdf-report and unzipped in /etc/zabbix as root user.

    [[email protected] zabbix]# ls
    web zabbix-pdf-report-master zabbix-pdf-report-master.zip zabbix_server.conf zabbix_server.conf.bak
    [[email protected] zabbix]#

    [[email protected] zabbix]# cd zabbix-pdf-report-master/
    [[email protected] zabbix-pdf-report-master]# ls
    Changelog chooser.php config.inc.php config.inc.php.dist createpdf.php css fixrights.sh fonts images inc index.php js LICENSE logout.php README.md reports tmp
    [[email protected] zabbix-pdf-report-master]#

    2. Ran fixrights.sh script which created reports and tmp dir in /etc/zabbix/zabbix-pdf-report-master/ folder

    3. Configured config.inc.php variables .

    $user_login=0;
    # zabbix server info(user must have API access)
    // $z_server = 'http://localhost/zabbix/';
    $z_server = 'http://10.x.x.x/zabbix/'; // Replace YourServerHere with either en IP or an FDQN (e.g. zabbix.company.com). Remove the s in https if for some reason you don't use https yet. Or better yet, get Let's Encrypt installed and use https!
    $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";
    $pdf_report_url = "./reports";

    4) I have php5.4 installed

    [[email protected] zabbix-pdf-report-master]# rpm -qa | grep php
    php-mysql-5.4.16-46.el7.x86_64
    php-gd-5.4.16-46.el7.x86_64
    php-common-5.4.16-46.el7.x86_64
    php-5.4.16-46.el7.x86_64
    php-bcmath-5.4.16-46.el7.x86_64
    php-cli-5.4.16-46.el7.x86_64
    php-ldap-5.4.16-46.el7.x86_64
    php-mbstring-5.4.16-46.el7.x86_64
    php-xml-5.4.16-46.el7.x86_64
    php-pdo-5.4.16-46.el7.x86_64

    5) I have curl

    [[email protected] zabbix-pdf-report-master]# curl --version
    curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.36 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
    Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
    Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets

    [[email protected] zabbix]# php -i | grep -i curl
    /etc/php.d/curl.ini,
    curl
    cURL support => enabled
    cURL Information => 7.29.0


    My questions are
    1) what is the proper value for $pdf_report_url in my case?
    2) What will be the url to lanuch reports UI?
    3) I unzipped package as root user. Is this correct?.
    4) do I need php-curl even though I have curl?

    Spent so much of time on fixing it but no use. I need helping hand please.
    Last edited by srinivasreddykesari; 31-12-2018, 05:19.

    Comment


      Hi, how can i generate this PDF automatically for each of my host, plus you have to update this pdf every month. Could someone help me ? A script can be but how?

      Comment


        Hello,

        I'm using zabbix 4.0.2 and pdf report version 1.1.1.

        When
        PHP Code:
        $user_login=0
        in config.inc.php,

        change this in index.php, line 11

        Code:
        if ( $user_login = 0 ) {
          header("Location: chooser.php");
          exit(0);
        }
        to

        Code:
        if ( $user_login == 0 ) {
          header("Location: chooser.php");
          exit(0);
        }
        Without that, even you have user_login=0 it will show you the login/password screen.

        ---
        I'm facing this problem when acessing the report page.

        Unable to login:
        And this error on apache log:

        [Tue Jan 29 08:57:17.599879 2019] [:error] [pid 27398] [client 177.35.6.112:19050] PHP Warning: Creating default object from empty value in /---/inc/ZabbixAPI.class.php on line 123

        I have php(5.6.38) and curl(7.29.0). User and password used in config.inc.php is a "Supper Administrator Zabbix".

        Someone can help with that error? Thanks.


        Thanks @martinm76 for the project!

        Comment


          Hi, thanks for this reporting plugin! I'd like to add Windows/Linux services and processes to report but haven't got them to show up with name Processes or Number of processes. I added those to config.inc.php: $items = array and $mygraphs.

          $items = array('Processes'=>'number','system information'=>'string'...
          $mygraphs = '#(Ping|Processes|...
          Or same with 'Number of processes'

          Any advise?

          Comment


            Hello, i have install version 1 on zabbix 4.0, but when i am loggin in the page is show me this, i try do this with a administrator user and normal user, same behaivor, any idea?

            Thanks for your help.
            Attached Files

            Comment


              Hello Team,

              I am having issue with zabbix-dynamic-pdf generator. I have installed php7.0 for my zabbix-server. While generating the pdf report the image is not shown. Only the topic of the graphs is available.

              I am having another zabbix server it has php 5.59. It will give the proper pdf report

              My suspection is the version of php 7.0 is not supported for the image for pdf.


              Attached Files
              Last edited by Aslmafarook; 28-03-2019, 14:36.

              Comment


                Hi all - I'm having a couple of display problems with this plugin (Zabbix 4.0.7, php 7.3.5, CentOS 7).

                I can get it to generate reports, just fine, however I have a load of text (as shown in my attachment) above the report form.
                Also, when I generate the report, the result page is 100% text; I have to get to the report by manually typing it's filename in the URL.
                Finally, the "Old reports (click to show") URL is not a URL, it's just plain text and doesn't do anything.

                Any ideas at all?
                The only error I can see anywhere is in the apache logs, but I think it might be irrelevant to this problem?;

                PHP Warning: get_class() expects parameter 1 to be object, null given in /usr/share/zabbix/reports/inc/ZabbixAPI.class.php on line 208, referer: http://10.30.194.120/zabbix/screens.php?ddreset=1

                Thanks!
                Attached Files

                Comment


                  Originally posted by neqinox View Post
                  Hi all - I'm having a couple of display problems with this plugin (Zabbix 4.0.7, php 7.3.5, CentOS 7).

                  I can get it to generate reports, just fine, however I have a load of text (as shown in my attachment) above the report form.
                  Also, when I generate the report, the result page is 100% text; I have to get to the report by manually typing it's filename in the URL.
                  Finally, the "Old reports (click to show") URL is not a URL, it's just plain text and doesn't do anything.

                  Any ideas at all?
                  The only error I can see anywhere is in the apache logs, but I think it might be irrelevant to this problem?;

                  PHP Warning: get_class() expects parameter 1 to be object, null given in /usr/share/zabbix/reports/inc/ZabbixAPI.class.php on line 208, referer: http://10.30.194.120/zabbix/screens.php?ddreset=1

                  Thanks!
                  Fixed. It seems php v7 is not supported; rolled it back to 5 and all is well, however the 'click to show old reports' link still isn't working.

                  Comment


                    Hi all,
                    I'm using v 1.1.1 with zabbix 4.2.1, but i can't get graph about switch/router bandwidth, but icmp ping, CPU, memory still well, any advise?
                    Thanks

                    Comment


                      Hi everyone,

                      Firstly thanks martinm_76 for this great work.

                      I'm currently trying to install the catonrug's fork on zabbix 4.2 under centos 7.
                      All is working fine, except that i can't find only one hostgroup (i have three) and the associate hosts.
                      My knowledge of javascript is nearly poor, and i really need some help because zabbix is using in my compagny to supervise our clients.
                      Thanks by advances

                      Comment


                        Hello, Can anyone help with this error on logs? PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /usr/share/zabbix/report/inc/ZabbixAPI.class.php:324\nStack trace:\n#0 /usr/share/zabbix/report/inc/ZabbixAPI.class.php(257): ZabbixAPI::__jsonRequest('http://10.10.50...', '{"auth":null,"m...')\n#1 /usr/share/zabbix/report/inc/ZabbixAPI.class.php(285): ZabbixAPI->__callAPI('user.login', Array)\n#2 /usr/share/zabbix/report/inc/ZabbixAPI.class.php(100): ZabbixAPI->__login()\n#3 /usr/share/zabbix/report/index.php(30): ZabbixAPI::login('http://10.10.50...', 'root', '*********')\n#4 {main}\n thrown in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 324, referer: http://mnl-zabbix/zabbix/report/
                        I was able to go to the login page but once I click login the result is that the "Page is not working"

                        Comment

                        Announcement

                        Collapse
                        No announcement yet.
                        Working...
                        X