Hi,
we are trying to set up a script which on certain conditions disables a host before rebooting it, and then enables back the host once this has rebooted.
To do this we have set up on the server:
- a python script that updates the "status" field of the host to be disabled and enabled. this script, if invoked by hand, works perfectly.
- a trapper that gets its value from from the host
- a trigger, that if in "Problem" condition runs the script
The trapper value is set from the host, using zabbix_sender.
The problem comes when re-enabling the host after its reboot. It get correctly disabled before rebooting, but every time zabbix_sender fails when trying to enable back the host, with no log whatsover in both stdout and server logs. The only output we have on the host is similar to this:
In the previous 192.168.0.6:10051 are the correct IP:Port of the zabbix server, host_status is the trapper name and 0 is the character to be passed to the trapper (which is supposed to take a character as a value, not and integer or anything else).
The interesting thing is that we also tried to modify the configuration of the CacheUpdateFrequency parameter of the Zabbix server, and:
- if set to the max value (3600), everything works like a charm
- if set to less than the max value, we always get the error
Any suggestion or pointers? Are we missing anything?
we are trying to set up a script which on certain conditions disables a host before rebooting it, and then enables back the host once this has rebooted.
To do this we have set up on the server:
- a python script that updates the "status" field of the host to be disabled and enabled. this script, if invoked by hand, works perfectly.
- a trapper that gets its value from from the host
- a trigger, that if in "Problem" condition runs the script
The trapper value is set from the host, using zabbix_sender.
The problem comes when re-enabling the host after its reboot. It get correctly disabled before rebooting, but every time zabbix_sender fails when trying to enable back the host, with no log whatsover in both stdout and server logs. The only output we have on the host is similar to this:
Code:
[root@test_host zabbix]# zabbix_sender -vv -z 192.168.0.6 -p 10051 -s "test_host" -k "host_status" -o "0"
zabbix_sender [11082]: DEBUG: answer [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000037"}]
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000037"
The interesting thing is that we also tried to modify the configuration of the CacheUpdateFrequency parameter of the Zabbix server, and:
- if set to the max value (3600), everything works like a charm
- if set to less than the max value, we always get the error
Any suggestion or pointers? Are we missing anything?