ZABBIX Forums  
  #11  
Old 08-02-2012, 19:03
efrain02 efrain02 is offline
Member
 
Join Date: Apr 2011
Location: Around The World
Posts: 82
Default

Almost there....
It would be very appreciated if you could list the requirements in order to use this add-on. For example i notice it uses curl and perl. But i don't know if that's all. So far (for me) only shows a bunch of code when i click generate. I'm going to keep trying in order to see whats wrong or if i need something else. Thanks.
Reply With Quote
  #12  
Old 08-02-2012, 19:05
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

Quote:
Originally Posted by efrain02 View Post
Almost there....
It would be very appreciated if you could list the requirements in order to use this add-on. For example i notice it uses curl and perl. But i don't know if that's all. So far (for me) only shows a bunch of code when i click generate. I'm going to keep trying in order to see whats wrong or if i need something else. Thanks.

if you're seeing a bunch of random letters and things when generating set display_error = off in php.ini and restart apache.. that should clear it up.
Reply With Quote
  #13  
Old 08-02-2012, 19:07
efrain02 efrain02 is offline
Member
 
Join Date: Apr 2011
Location: Around The World
Posts: 82
Default

I already do that. Let me try and i would let you know how is it going.
Reply With Quote
  #14  
Old 08-02-2012, 19:09
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

please do , the more people testing and helping the better!

also, if you haven't updated to the latest version please do!

php-curl is required, that's correct.
Reply With Quote
  #15  
Old 08-02-2012, 19:21
efrain02 efrain02 is offline
Member
 
Join Date: Apr 2011
Location: Around The World
Posts: 82
Default

Ok. So i was trying to see if there's a hint of something missing but i didn't find anything. Here's what i got on "pdfform.php":

CURL URL: http://localhost/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.authenticate","id":1," params":{"password":"mypassword","user":"myusernam e"},"jsonrpc":"2.0"} [10102] => gzip ) Got response from API: ({"jsonrpc":"2.0","result":"fea29a29ee38cf3cc9f57a 2f73c486ae","id":1}) Response decoded: (Array ( [jsonrpc] => 2.0 [result] => fea29a29ee38cf3cc9f57a2f73c486ae [id] => 1 ) __login() Got response from API: (fea29a29ee38cf3cc9f57a2f73c486ae) CURL URL: http://localhost/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":"fea29a29ee38cf3cc9f57a2f73c486ae","method ":"host.get","id":1,"params":{"extendoutput":"shor ten","sortfield":"host"},"jsonrpc":"2.0"} [10102] => gzip ) Got response from API: ({"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"No API access"},"id":1}) Response decoded: (Array ( [jsonrpc] => 2.0 [error] => Array ( [code] => -32602 [message] => Invalid params. [data] => No API access ) [id] => 1 )

In order to show this here i change my real username to "myusername" and my real password to "mypassword".
Reply With Quote
  #16  
Old 08-02-2012, 19:30
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

in config.inc.php for your z_server url it needs to be the actual IP address or domain name, not localhost.

The user you are using in that config file as well needs to have API access.
Reply With Quote
  #17  
Old 08-02-2012, 19:31
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

# added example report to original post.
Reply With Quote
  #18  
Old 08-02-2012, 19:44
efrain02 efrain02 is offline
Member
 
Join Date: Apr 2011
Location: Around The World
Posts: 82
Default

Well.. i just put localhost in order to hide my IP. The user now has API access, so now i can see my hosts (which previously can't) but now more code appears, but at the same time I'm getting closer...
Reply With Quote
  #19  
Old 08-02-2012, 19:46
Axilla Axilla is offline
Senior Member
 
Join Date: Aug 2010
Posts: 128
Default

Quote:
Originally Posted by efrain02 View Post
Well.. i just put localhost in order to hide my IP. The user now has API access, so now i can see my hosts (which previously can't) but now more code appears, but at the same time I'm getting closer...
Please post what you see so I can look into it and figure it out for you
Reply With Quote
  #20  
Old 09-02-2012, 14:22
Frytrix Frytrix is offline
Junior Member
 
Join Date: Feb 2012
Posts: 3
Default

Hi,

first of all thanks for your help yesterday.
CURL and json wasn't installed on the system.

Now i can select my Hosts and time period.
By pressing the button "Generate" something happens and i've been forwarded to another page. But i didn't get a pdf.

the File attached is what i get.
Attached Files
File Type: txt zabbix.txt (11.7 KB, 979 views)
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 17:52.