Using the Zabbix API for extending functionality
An API is your gateway to getting started with extending the functionality of any piece of software. Luckily, Zabbix offers a solid working API that we can use to extend our functionality with ease. Zabbix has also released zabbix-utils
for Python, making building scripts a lot easier for everyone. It’s an amazing addition, but as it’s not allowed in every environment and we want to keep the dependencies to a minimum, we won’t utilize it in our test here. Nevertheless, check out the library here:
https://github.com/zabbix/python-zabbix-utils
In this recipe, we’ll explore the use of the Zabbix API to do some tasks, creating a good basis to start working with the Zabbix API in your actual production environments.
Getting ready
We are going to need a Zabbix server with some hosts. I’ll be using our lar-book-centos
host from the previous chapters, but feel free to use any Zabbix server. I will...