Ad Widget

Collapse

Zabbix api debugging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aeson
    Junior Member
    • Feb 2013
    • 11

    #1

    Zabbix api debugging

    Hi,

    I am writing code with zabbix api, and I came to a problem, I first wrote an host.massadd rpc call:
    Code:
    method => "host.massadd",
    			params => {
    				hosts => [
    					{
    						hostid => $hostID
    					}
    				],
    				groups => [
    					{
    						groupid => $hostgroupID
    					}
    				] 
    				},
    Which worked perfectly, than I wanted to do something similar with host.massremove:
    Code:
    method => "host.massremove",
    			params => {
    				hosts => [
    					{
    						hostid => $hostID
    					}
    				],
    				groups => [
    					{
    						groupid => $hostgroupID
    					}
    				] 
    				},
    This failed, the documentation https://www.zabbix.com/documentation...ost/massremove did use other parameters 'hostids' and 'groupids', but it did used 'hosts' in the example. So I was confused and guessed this would work.

    First, if someone has an answer to my problem, that would be very nice .

    But my real question is, how can I turn on debugging or find logging from the zabbix api calls I do? So I can see what has gone wrong, and what is expected?

    Thank you
    Last edited by aeson; 19-03-2013, 16:44. Reason: Typo
  • aeson
    Junior Member
    • Feb 2013
    • 11

    #2
    Found the solution to my specific problem, just needed to really follow the documentation:

    Code:
    method => "host.massremove",
    			params => {
    				hostids => [ $hostID ],
    				groupids => [ $hostgroupID ] 
    				}
    Still want to find out best way to debug using zabbix api?

    Comment

    • Pavels
      Member
      • Oct 2011
      • 83

      #3
      You can enable debug mode for the currently logged in user. Then if an error occurs, the response will also return a PHP call stack under the "debug" property, which you can use to trace the exception.

      Comment

      Working...