Hello Zabbix experts,
Maybe someone faced similar problem before and could advise what I can do.
We have 3 identical servers with different IP addresses (kind of cluster) where each server has full information about other two. I built Zabbix host pointing to the first node IP and using discovery rule to pull information about others. However, those servers must be taken offline for maintenance so when first node is down I lose all metrics.
I’ve built simple “script item” which checks IP availability and need to pass this information to other “HTTP agent” items. I know it is not possible to pass value of one item to another item and tried to assign first item value either to host {$ALIVE} macro or to {INVENTORY.LOCATION} field. No errors from Javascript but it looks like macro values actually did not change.

Question: are host macros immutable and could be set only manually?
Or maybe there is an alternative solution of passing values between items via some temporary variable on the host level?
Also found 2 feature requests related this issue but they are unresolved for many years.
https://support.zabbix.com/browse/ZBXNEXT-9059
Thanks,
Maybe someone faced similar problem before and could advise what I can do.
We have 3 identical servers with different IP addresses (kind of cluster) where each server has full information about other two. I built Zabbix host pointing to the first node IP and using discovery rule to pull information about others. However, those servers must be taken offline for maintenance so when first node is down I lose all metrics.
I’ve built simple “script item” which checks IP availability and need to pass this information to other “HTTP agent” items. I know it is not possible to pass value of one item to another item and tried to assign first item value either to host {$ALIVE} macro or to {INVENTORY.LOCATION} field. No errors from Javascript but it looks like macro values actually did not change.
Code:
var obj = JSON.parse(value);
try {
var request2 = new HttpRequest();
request2.get("http://172.26.24.33/........");
var result2 = "good33";
obj.is_alive = "172.26.24.33";
obj.location = "172.26.24.33";
return result2 + obj.is_alive + obj.location;
} catch (error) {
var result2 = "bad33";
}
try { <next node> }.....
Question: are host macros immutable and could be set only manually?
Or maybe there is an alternative solution of passing values between items via some temporary variable on the host level?
Also found 2 feature requests related this issue but they are unresolved for many years.
https://support.zabbix.com/browse/ZBXNEXT-9059
Thanks,
Comment