Some of our hosts have the template Backup Node. For each such, there is (or should be) a directory /somewhere/ConfigBackups/{hostid} containing backup files. Backups should be taken daily so the newest backup should be no more than 24 hours old. The directory /somewhere/ConfigBackups is mounted on the Zabbix server instance (an LXC container).
It does not seem to be possible to model discovery of the directories with discovery rules etc. There is key vs.dir.get but this is not the answer: we want a list of directories that should exist (based on hosts having the template), not what actually exists.
There's also the zabbix[host] family of internal check keys which comes infuriatingly close but returns only a count of hosts, not an enumeration thereof.
It is possible to do it with the API host.get request but not, it seems through any built-in discovery rules or other system. What I'm looking for is a Zabbix agent rule called zabbix.host[,,,template] or similar.
It cannot be through the hosts representing backed-up nodes themselves, since they do not have access to or visibility of /somewhere/ConfigBackups. In most cases they are routers and switches and an external system pulls their configuration via ssh or otherwise and writes it into the backup directory.
It seems remarkable to me that Zabbix cannot enumerate its own hosts. Tell me how it can.
I did look at setting-up a second agent interface on each backup host, with the IP address of the Zabbix server, to 'trick' Zabbix into querying itself rather than the actual host. It is possible, but is not amenable to configuration by template; i.e., templates don't provide for adding interfaces to a host, and template items cannot specify a particular agent interface.
It does not seem to be possible to model discovery of the directories with discovery rules etc. There is key vs.dir.get but this is not the answer: we want a list of directories that should exist (based on hosts having the template), not what actually exists.
There's also the zabbix[host] family of internal check keys which comes infuriatingly close but returns only a count of hosts, not an enumeration thereof.
It is possible to do it with the API host.get request but not, it seems through any built-in discovery rules or other system. What I'm looking for is a Zabbix agent rule called zabbix.host[,,,template] or similar.
It cannot be through the hosts representing backed-up nodes themselves, since they do not have access to or visibility of /somewhere/ConfigBackups. In most cases they are routers and switches and an external system pulls their configuration via ssh or otherwise and writes it into the backup directory.
It seems remarkable to me that Zabbix cannot enumerate its own hosts. Tell me how it can.
I did look at setting-up a second agent interface on each backup host, with the IP address of the Zabbix server, to 'trick' Zabbix into querying itself rather than the actual host. It is possible, but is not amenable to configuration by template; i.e., templates don't provide for adding interfaces to a host, and template items cannot specify a particular agent interface.