ZABBIX Forums  
  #1  
Old 06-02-2012, 20:56
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default Zabbix Dynamic PDF Report Generation

v0.1 Beta
# - Generate dynamic PDF report from custom graphs
# - All Hosts or Single Host
# - Timeperiods of Hour, Day, Week, Month, Year

v0.2 Beta
Change Log:
# - moved all configuration to a single file.. configuration is now done in config.inc.php
# - removed all MySQL specific calls and replaced with API calls. Now anyone should be able to use the addon who is running 1.8 API.

v0.3 Beta
Change Log:
# - fixed an issue where hosts with no graphs were showing up in selection form
# - added timezone to configuration file
# - added paper size to configuration file
# - added paper orientation to configuration file
# - fixed an alignment issue where graphs were covering up the header

The idea behind this addon is that it will be version independent. This is a screen embeded custom page. NO PATCHING REQUIRED, but still allows you to use it inside the zabbix UI.

This was originally created for self use, but I know it is a much requested feature so, please help test and fix problems

How To:

1. unzip file to your zabbix directory(I like to create a custom_pages directory and place them all there)
2. configure config.inc.php with your zabbix server information
3. make data.txt and your tmp_images directory readable and writeable by apache user
4. Login to zabbix and create a new 1 row 1 column screen with a URL width and height of 800x600 / Centre / Top
5. add URL to pdfform.php to new screen.
6. in php.ini set display_error = OFF
7. restart apache

Development is ongoing please post problems and ideas here.

Known Problems:

# Tested on Zabbix 1.8.8 and 1.8.10 but should work with any 1.8 API and Zabbix.

Download Link: http://www.zabbix.org/mw/images/e/e9...generation.zip
Example Report: http://www.zabbix.org/mw/images/8/8f...generation.pdf

required:
php-curl
php-json

Last edited by Axilla; 09-02-2012 at 16:32.
Reply With Quote
  #2  
Old 06-02-2012, 22:03
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

no longer required.. removed by Axilla.

Last edited by Axilla; 08-02-2012 at 17:08.
Reply With Quote
  #3  
Old 07-02-2012, 20:00
efrain02 efrain02 is offline
Member
 
Join Date: Apr 2011
Location: Around The World
Posts: 82
Default

I got this error:

Code:
Fatal error: Call to undefined function curl_init() in /var/www/ZabbixAPI.class.php on line 287
Should i do something in "ZabbixAPI.class.php"?, because i realize the url variable is empty but i don't now if i need to configure something else.

Thanks!
Reply With Quote
  #4  
Old 07-02-2012, 20:13
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

you shouldn't need to change anything in ZabbixAPI.class.php

in generatereport.php look at the $z_server

you probably have https:// -- in my environment i use secure HTTP you probably just need to change that to http://
Reply With Quote
  #5  
Old 07-02-2012, 20:40
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

v0.1.1 beta uploaded.

Change Log:
- changed https to http in config areas
- fixed incorrect redirect after pdf is generated.

http://www.zabbix.org/mw/images/e/e9...generation.zip

Last edited by Axilla; 07-02-2012 at 20:58.
Reply With Quote
  #6  
Old 07-02-2012, 21:09
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

Note: Make sure that in /etc/php.ini you have display_error = Off

and then restart apache... this will cause problem when generating the PDF if it is On.
Reply With Quote
  #7  
Old 07-02-2012, 22:07
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

v0.2 Beta - 2/7/2012

Change Log:
- moved all configuration to a single file.. configuration is now done in config.inc.php

- removed all MySQL specific calls and replaced with API calls. Now anyone should be able to use the addon who is running 1.8 API.

Download Link: http://www.zabbix.org/mw/images/e/e9...generation.zip
Reply With Quote
  #8  
Old 08-02-2012, 15:10
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

In 0.2 I noticed its a little confusing in the config.inc.php to what pdf_location is.. it should be the tail of the url NOT a absolute path.

Example
z_server = "http://www.mynetworkmonitoring.com/zabbix/

pdf_location = "custom_pages/pdf.php"

together they make http://www.mynetworkmonitoring.com/z..._pages/pdf.php
Reply With Quote
  #9  
Old 08-02-2012, 17:07
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

Thanks for the bug reports/suggestions so far, you can post them here,PM them to me, or find me on #zabbix! keep em coming and i'll keep improving!
Reply With Quote
  #10  
Old 08-02-2012, 18:42
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

v0.3 released see original post for change log
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:27.