Ad Widget

Collapse

Zabbix api for linking the existing template to existing host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vaibhav Ubale
    Junior Member
    • Mar 2021
    • 9

    #1

    Zabbix api for linking the existing template to existing host

    Hi ,
    I am trying to update the existing host by linking the existing template but seems im not using the right api. Can some one please help with this

    I am using curl with as below

    curl --header "Content-Type: application/json" --request POST --data '
    {
    "jsonrpc": "2.0",
    "method": "host.update",
    "params": {
    "hostid": "10325",
    "templates": [
    {
    "templateid": "10284"
    }
    ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
    }' "http://127.0.0.1/zabbix/api_jsonrpc.php"


    I have even tried mass update but still no luck,

    curl --header "Content-Type: application/json" --request POST --data '{
    "jsonrpc": "2.0",
    "method": "template.massadd",
    "params": {
    "templates": [
    {
    "templateid": "10284"
    }
    ],
    "hosts": [
    {
    "hostid": "10325"
    },
    {
    "hostid": "10326"
    }
    , "auth": "76a7a5e3c03e3867df510e743e4c80eb", "id": 1}' http://127.0.0.1/zabbix/api_jsonrpc.php"


    any pointers?

    Thanks in advance
    Last edited by Vaibhav Ubale; 04-05-2022, 21:16.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4811

    #2
    And your error is? ...

    Comment

    Working...