I am thinking of the new Zabbix 6.0 and the widget geomap. To use it, the correct coordinates must be in the inventory fields (latitude, longitude). So I need to update these inventory fields. Now there are only two ways to do this:
1) manual update on each host,
2) add an item to collect latitude, longitude from somewhere.
The first solution is only good if you have a small number of hosts.
The second solution also has drawbacks:
- we need internet connection to get coordinates from services like ipwhois.io
- if our hosts use private subnets (192.168.x.x, 10.x.x.x, 172.16.x.x) services like ipwhois.io are useless
- we need to add an element on each host, item will find coordinates in our internal source by running some script (or whatever), this item will run form time to time and will waste history table space
For people who using agent active autoregistration and have no internet, or using private subnets, there can be easiest solution.
For discovery and autoregistration events, there are operations: https://www.zabbix.com/documentation...tion/operation
We need additional action like "set inventory field [choose field] value to", and with options to select: "static text" or "part of text from HostMetadata (by regex)"
In this way, if we use the addresses 192.168.10.x for one location and 192.168.20.x for the other, we can set the corresponding coordinates in the inventory for both locations by discovery rules (no external services used, no need for additional item and its scripts).
We can add an autoregistration rule based on HostMetadata, if HostMetadata contains specific text, then selected inventory fields are filled with some text from HostMetadata or static text.
This way, we can easily use Zabbix geomaps with private subnets. Also inventory can be filled with information directly send in autoregistration proces (no need for items on host = no vaste in history tables + free some machine resources needed for items).
1) manual update on each host,
2) add an item to collect latitude, longitude from somewhere.
The first solution is only good if you have a small number of hosts.
The second solution also has drawbacks:
- we need internet connection to get coordinates from services like ipwhois.io
- if our hosts use private subnets (192.168.x.x, 10.x.x.x, 172.16.x.x) services like ipwhois.io are useless
- we need to add an element on each host, item will find coordinates in our internal source by running some script (or whatever), this item will run form time to time and will waste history table space
For people who using agent active autoregistration and have no internet, or using private subnets, there can be easiest solution.
For discovery and autoregistration events, there are operations: https://www.zabbix.com/documentation...tion/operation
We need additional action like "set inventory field [choose field] value to", and with options to select: "static text" or "part of text from HostMetadata (by regex)"
In this way, if we use the addresses 192.168.10.x for one location and 192.168.20.x for the other, we can set the corresponding coordinates in the inventory for both locations by discovery rules (no external services used, no need for additional item and its scripts).
We can add an autoregistration rule based on HostMetadata, if HostMetadata contains specific text, then selected inventory fields are filled with some text from HostMetadata or static text.
This way, we can easily use Zabbix geomaps with private subnets. Also inventory can be filled with information directly send in autoregistration proces (no need for items on host = no vaste in history tables + free some machine resources needed for items).
Comment