Ad Widget

Collapse

Host.delete for Zabbix 3.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MauPV
    Junior Member
    • Feb 2020
    • 2

    #1

    Host.delete for Zabbix 3.0

    Hello

    I need some help when using Zabbix API "host.delete"

    I already checked the documentation:



    I'm using host ID = 18925 and this would be script that deletes hosts:

    deleting = @{
    body = @{
    "jsonrpc"= "2.0"
    "method"= "host.delete"
    "params" = @{
    18925}


    auth = 1234566789
    id =0
    I also tried this:

    deleting = @{
    body = @{
    "jsonrpc"= "2.0"
    "method"= "host.delete"
    "params" = @{
    "hostid" = "18925"}


    auth = 1234566789
    id =0
    Getting this response:

    {"jsonrpc":"2.0","error":{"code":-32500,"message":"Application error.","data":"SQL statement execution has failed "DELETE
    FROM screens_items WHERE resourceid=Array AND resourcetype='16'""},"id":3}

    It doesn't matter if I use a 'variable' or enter the value for the host id.

    I have check several posts on this forum and also within Zabbix support, but I can't find a way to make it work.

    Could you please shed some light?





  • MauPV
    Junior Member
    • Feb 2020
    • 2

    #2
    Done!

    My script is working, there was a syntax error

    Comment

    Working...