LoginSignup
1
1

More than 5 years have passed since last update.

Zabbix API の利用例

Posted at

テンプレートが所属するグループ、そのテンプレートを適用しているホストを含め取得する。

request:

{
    "jsonrpc": "2.0",
    "method": "template.get",
    "params": {
        "output": [
            "templateid",
            "host"
        ],
        "selectGroups": [],
        "selectHosts": [],
        "search": {
            "host": [
                "Linux"
            ]
        }
    },
    "auth": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "id": 2
}

respons:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "templateid": "10001",
            "host": "Template OS Linux",
            "groups": [
                {
                    "groupid": "10"
                }
            ],
            "hosts": [
                {
                    "hostid": "10084"
                }
            ]
        },
        {
            "templateid": "10248",
            "host": "Template OS Linux SNMPv2",
            "groups": [
                {
                    "groupid": "10"
                }
            ],
            "hosts": []
        }
    ],
    "id": 2
}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1