
Those who follow me on LinkedIn might have noticed already that this morning I mentioned about the recently revamped zabbix-cli. The tool has been rewritten from ground up and now it's really cool thing to use! Here are some examples how I can use it for monitoring my home.
Now it looks cool
It has colours, tables, advanced auto-completion, all kinds of goodies! Below is a short snippet from --help option.

List and acknowledge alerts through shell
Here's some of the active alerts. Observe how I really have not gotten any better with my facial cream usage since March 2022, I'm hopeless.

Now, what if I want to acknowledge my facial cream alert? See how the auto-completion already helps me just after few characters.

Let's continue that until the end.

Creating a new host
Let's try if we can create new hosts with this tool.

Great, it worked! But we are not there yet, as without templates Zabbix has no clue how to monitor this new host. No worries, that is easily done via zabbix-cli, too.

Finally, let's remove this dummy demo host.

Exporting and importing Zabbix configuration
Now, if you would need to export and import your Zabbix configuration, there's of course many ways of doing that. But zabbix-cli makes it super easy. Just type export_configuration and you're done.

If you don't want to export everything but just only for example your hosts or templates, that's very much doable.

There would be so much more, but...
... makes no sense for me to go through each and every option of the new zabbix-cli in this way. You get the idea -- it gives you the flexibility of command line and APIs but is easier to work with than pure API scripting.
For additional machine processing, you can also change the output from human-readable tables to JSON. You can pass your authentication to Zabbix via several different methods. You can skip the zabbix-cli shell part and give commands as one-liners or in batch mode with the set of commands read from a separate text file. there's a lot this small tool can give you.
Comments
thanks for this awesome tool!
awesome