Zabbix API 一些错误的解决办法

2012年12月23日 发表评论 阅读评论

调用方法:

require_once("ZabbixAPI.class.php");
// This enables debugging, this is rather verbose but can help debug problems
ZabbixAPI::debugEnabled(TRUE);

// This logs into Zabbix, and returns false if it fails
//ZabbixAPI::debugEnabled(true);
ZabbixAPI::login('host','user','passwd');

$a = ZabbixAPI::fetch_array('template','get');
1. Javier commented on January 25th, 2012 at 9:54 AM PST
I found the solution in the next commentary: tcpsyn commented on March 22nd, 2011 at 8:45 AM PST Interesting. I found somewhere that the issue was solved by uncommenting ZabbixAPI::debugEnabled(TRUE); ... This was not in this version of your wrapper. I added it to line 89 and now can use the api. Weird.

2. Michel Groenescheij commented on February 22nd, 2012 at 1:47 AM PST
As we successfully worked with your API under Zabbix 1.8, we now run into problems after we upgraded to Zabbix 2.0. Can you tell us if your API is compatible with ZabbixAPI 2.0?

3. korvet commented on February 22nd, 2012 at 10:55 AM PST
How to return hostid using ZabbixAPI::query 'host','create'

4. Chris commented on May 2nd, 2012 at 5:30 AM PST
If you got the "Call to undefined method stdClass::__login()" error (like I did in php 5.3), then fix the ZabbixAPI.class.php file by replacing the line: if (get_class(self::$instance) != "ZabbixAPI") with if (!self::$instance || get_class(self::$instance) != "ZabbixAPI")

5. Clark commented on May 7th, 2012 at 3:32 PM PST
I want to get a list of a specific host. How can I use the filter option? $host_details = ZabbixAPI::fetch_array('host','get',array('extendoutput'=>1, 'filter'=>'dns:am-akiban02.nj1.afcv.net'))


转载请注明来自:[MSN Spaces]http://msn.shandian.biz/447.html

  1. 本文目前尚无任何评论.