Ad Widget

Collapse

[API] Cannot create discovery action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sire
    Senior Member
    • Jul 2010
    • 210

    #1

    [API] Cannot create discovery action

    I'm trying to use Zabbix 2.0 rc2. Cannot create discovery action that attaches a template to a discovered host.

    My API JSON request:
    PHP Code:
    {
       
    "params" : {
          
    "recovery_msg" "0",
          
    "status" "0",
          
    "r_shortdata" "",
          
    "name" "Автообнаружение",
          
    "operations" : [
             {
                
    "esc_step_from" "1",
                
    "esc_period" "0",
                
    "optemplate" : [
                   
    "10016"
                
    ],
                
    "operationtype" "6",
                
    "evaltype" "0",
                
    "esc_step_to" "1",
                
    "opconditions" : []
             }
          ],
          
    "esc_period" "0",
          
    "def_shortdata" "",
          
    "evaltype" "0",
          
    "r_longdata" "",
          
    "eventsource" "1",
          
    "actionid" "5",
          
    "def_longdata" "",
          
    "conditions" : [
             {
                
    "operator" "0",
                
    "value" "4",
                
    "conditiontype" "18"
             
    }
          ]
       },
       
    "auth" "0e907e5d00862cb87912c63d294bca05",
       
    "jsonrpc" "2.0",
       
    "method" "action.update",
       
    "id" 178

    I get the following error:
    PHP Code:
    In create_or_update_discovery_actionError: {"data":"JSON-rpc error generation failed. No such error \"\".","message":"System error.","code":-32400
    What's wrong in my request?
    Regards,
    Sergey Syreskin

    Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

    Temporary out of Zabbix business
  • sire
    Senior Member
    • Jul 2010
    • 210

    #2
    However the similar request for adding a host to a group works.
    Regards,
    Sergey Syreskin

    Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

    Temporary out of Zabbix business

    Comment

    • sire
      Senior Member
      • Jul 2010
      • 210

      #3
      My problem was that optemplates should be given as

      "optemplate" : [
      "templateid" : "10016"
      ]
      Regards,
      Sergey Syreskin

      Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

      Temporary out of Zabbix business

      Comment

      Working...