Here is a short tutorial on how to use the Zabbix API:
- Create an API user: You need to create an API user in Zabbix before you can start using the API. To do this, go to Administration > Users and click on the Create User button. In the User tab, select the API role and enter a username and password for the user.
- Get an API token: Once you have created an API user, you need to get an API token for the user. To do this, go to Administration > Users and click on the API Tokens tab. Click on the Create Token button and enter a name for the token.
- Use the API: Now that you have an API token, you can start using the API. The Zabbix API documentation provides a detailed overview of the API. You can also use the Zabbix API Explorer to test the API calls.
Here are some examples of how to use the Zabbix API:
To get a list of hosts:
curl -X GET -H "Authorization: Bearer <API_TOKEN>" https://zabbix.example.com/api/v1/host
To create a new item:
curl -X POST -H "Authorization: Bearer <API_TOKEN>" -H "Content-Type: application/json" -d '{
"hostid": 10001,
"key": "system.cpu.load[all]",
"type": "0",
"value_type": "0",
"multiplier": 1,
"units": "percent"
}' https://zabbix.example.com/api/v1/item
# To get the list of host
curl --request POST --url 'http://54.197.199.105/zabbix/api_jsonrpc.php' --header 'Authorization: Bearer bc2dde7c3014a0cd77d662b40225bc634e922e7e4146a9f3a7da20fcf389f696' --header 'Content-Type: application/json-rpc' --data @data.json
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024