Hi
We've evaluated Zabbix for a big environment and we've nearly finished w/ the proof of concept. But now I'm stuck!
For TLDR users:
Is it possible to delete screen items via API, instead of whole screens and how can I do that?
For everybody else, here's a short description of the current situation and solution I'm going for:
Situation:
Since the hosts & graphs are configured, we're now looking for a view to display a specific graph for all hosts in a hostgroup. I'm really a fan of Zabbix, but while nearly every other monitoring system is supporting such a view (e.g. Cacti, Zenoss, Ganglia), Zabbix is missing this (IMHO important) feature!
There are some bug reports and a feature request:
I know this is possible via screens and this might work for a bunch of servers. But if you've hundreds of servers, it's nearly impossible to manage that. The initial work to generate such a screen by hand is huge, and every time you shut down / add a server, you've to update your screen. Of course you can add the new host at the end of the screen, but if you want the graphs sorted by hostname, or add a new graph it's a f* pain in the ass!
Solution:
Now... since there is a well documented API available, I've built a PHP script.
The script is parsing an XML config, which contains the definition of screens and it's corresponding graphs (e.g. CPU, memory) and a list of hostgroups to render in this screen. Example:
Then the script is deletes the existing screens (i.e. web production, web staging). Afterwards it's looking up all hosts in the corresponding hostgroups and adds the screens w/ all defined graphs of each hosts.
So far, everything works fine...
Problem:
As I'm always deleting the existing screens and adding them again, the users will lose all their favorites and the screen is getting a new ID. This means the old screen becomes invalid and everybody which has opened that screen becomes an "access denied or item not found" error after the auto refresh.
So my question: Is it possible to delete screen items via API, instead of whole screens and how can I do that?
What I've tried is item.delete and graphitem.delete (always w/ the screenitemid).
cheers
domi
We've evaluated Zabbix for a big environment and we've nearly finished w/ the proof of concept. But now I'm stuck!
For TLDR users:

Is it possible to delete screen items via API, instead of whole screens and how can I do that?
For everybody else, here's a short description of the current situation and solution I'm going for:
Situation:
- there are a bunch of hosts, which will automatically be discovered (always in specific IP ranges) [WORKS]
- discovered hosts will automatically be added to the correct host group (depends on retrieved values) [WORKS]
- discovered hosts will automatically be linked to the correct templates (depends on retrieved values) [WORKS]
- graphs and items are configured in the templates, so they will automatically be built after the host is added [WORKS]
Since the hosts & graphs are configured, we're now looking for a view to display a specific graph for all hosts in a hostgroup. I'm really a fan of Zabbix, but while nearly every other monitoring system is supporting such a view (e.g. Cacti, Zenoss, Ganglia), Zabbix is missing this (IMHO important) feature!
There are some bug reports and a feature request:
I know this is possible via screens and this might work for a bunch of servers. But if you've hundreds of servers, it's nearly impossible to manage that. The initial work to generate such a screen by hand is huge, and every time you shut down / add a server, you've to update your screen. Of course you can add the new host at the end of the screen, but if you want the graphs sorted by hostname, or add a new graph it's a f* pain in the ass!
Solution:
Now... since there is a well documented API available, I've built a PHP script.
The script is parsing an XML config, which contains the definition of screens and it's corresponding graphs (e.g. CPU, memory) and a list of hostgroups to render in this screen. Example:
HTML Code:
<config> <screens> <screen name="web production"> <screenConfig columns="2" /> <hostgroups> <hostgroup name="web-prod-01" /> <hostgroup name="web-prod-02" /> <hostgroup name="web-prod-03" /> <hostgroup name="web-prod-04" /> </hostgroups> <graphs> <graph name="CPU" width="500" height="100" /> <graph name="memory" width="500" height="100" /> </graphs> </screen> <screen name="web staging"> <screenConfig columns="2" /> <hostgroups> <hostgroup name="web-staging-01" /> <hostgroup name="web-staging-02" /> </hostgroups> <graphs> <graph name="CPU" width="500" height="100" /> <graph name="memory" width="500" height="100" /> </graphs> </screen> </screens> </config>
So far, everything works fine...
Problem:
As I'm always deleting the existing screens and adding them again, the users will lose all their favorites and the screen is getting a new ID. This means the old screen becomes invalid and everybody which has opened that screen becomes an "access denied or item not found" error after the auto refresh.
So my question: Is it possible to delete screen items via API, instead of whole screens and how can I do that?
What I've tried is item.delete and graphitem.delete (always w/ the screenitemid).
cheers
domi