[ZBX-4124] template.get with select_triggers return none Created: 2011 Sep 09  Updated: 2017 May 30  Resolved: 2012 Mar 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 1.8.7, 1.8.9
Fix Version/s: 1.8.11

Type: Incident report Priority: Blocker
Reporter: gescheit Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: api, trivial
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File class.ctemplate.php.patch     File class.ctemplate.php.patch    

 Description   

query:
'{"params":

{"select_triggers": "extend"}

, "jsonrpc": "2.0", "method": "template.get", "auth": "", "id": 1}
return:

{u'hostid': u'100100000010496', u'triggers': [], u'templateid': u'100100000010496'} {u'hostid': u'100100000010593', u'triggers': [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None], u'templateid': u'100100000010593'}

count of "none" coincide with number of triggers on that template



 Comments   
Comment by gescheit [ 2011 Nov 16 ]

fixed by this patch

Comment by Igor Danoshaites (Inactive) [ 2011 Nov 25 ]

Hi,

Can reproduce the similar problem in the latest v1.8.9 when using "template.get" method with the following parameters:

{"select_triggers":"extend","output":"extend","host":"H1"}

, but in the output I am getting "null" values:

{"hostid":"100100000010004","proxy_hostid":"0","host":"Template_Standalone","dns":"","useip":"0","ip":"","port":"10050","status":"3","disable_until":"0","error":"","available":"0","errors_from":"0","lastaccess":"0","inbytes":"0","outbytes":"0","useipmi":"0","ipmi_port":"623","ipmi_authtype":"0","ipmi_privilege":"2","ipmi_username":"","ipmi_password":"","ipmi_disable_until":"0","ipmi_available":"0","snmp_disable_until":"0","snmp_available":"0","maintenanceid":"0","maintenance_status":"0","maintenance_type":"0","maintenance_from":"0","ipmi_ip":"","ipmi_errors_from":"0","snmp_errors_from":"0","ipmi_error":"","snmp_error":"","templateid":"100100000010004","triggers":[null,null,null,null,null,null,null]}

The same "null" output when using "select_graphs" and "select_applications" parameters.

Comment by gescheit [ 2011 Nov 26 ]

also fixed graphs and applications

Comment by gescheit [ 2012 Jan 07 ]

1.8.10 - still not fixed.

Comment by Alexei Vladishev [ 2012 Feb 20 ]

Resolved in development branch svn://svn.zabbix.com/branches/dev/ZBX-4124. Ready to test.

A quick note, the code now is made in sync with host.get. I made also one formatting fix to make it absolutely similar to host.get.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Feb 28 ]

(1) The "select_macros" option doesn't work with API_OUTPUT_REFER.

<alexei> discussed with Sasha. Code of usermacro.get is broken, it should be fixed under ZBX-4719 in trunk, no fix will be available for 1.8.x.

<pavels> ok, CLOSED then.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Mar 02 ]

1.8 fix is TESTED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Mar 08 ]

Fixed for 1.8 in r25895. The trunk doesn't have this problem.

CLOSED.

Generated at Thu Apr 25 04:32:39 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.