Ad Widget

Collapse

Import hosts with limited fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix-user007
    Junior Member
    • Jan 2025
    • 25

    #1

    Import hosts with limited fields

    hello,

    I am creating a new Zabbix server to replace one that has seen too many updates and things are breaking.
    I want to import hosts from the old server but only certain fields in hosts, effectively just the first page of a new host. no templates, groups, etc. If necessary, i can add a group (virual servers) or generic template like ICMP to all.
    i.e. just these fields
    Host
    Name
    interfaces
    macros

    i had hoped to use the export from the current server but there are a number of errors during import.

    it seems this is more challenging than i thought.
    any help appreciated


    EDIT:
    tried using the API to get the hosts host.get method (to see if i can hack up the export json) using one of the documentation examples and i get an invalid request error



    {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Session terminated, re-login, please."},"id":1}


    my json is below from the reference material.i have hosts with linux in the name


    {
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
    "countOutput": true,
    "search": {
    "host": ["MySQL", "Linux"]
    },
    "editable": true,
    "startSearch": true,
    "searchByAny": true
    },
    "id": 1
    }
    Last edited by zabbix-user007; 23-01-2025, 07:30.
  • zabbix-user007
    Junior Member
    • Jan 2025
    • 25

    #2
    Looks like issues with the server as i can use the API on another one.

    Comment

    Working...