如何自动重新启用标记为“不支持”的自定义主动工作由于执行shell脚本时“超时”在zabbix?
我正在使用Zabbix监视一些服务器,并且已经实现了一些自定义功能。
在这个特定问题中,问题是,如果发生连接错误(我正在面对),则Zabbix项目将被主机标记为“不支持”,并且不会执行大约10分钟。
我对脚本没有返回数据的事实没有问题,但是我确实需要每分钟执行它。
我可以在Zabbix上调整配置来克服这一点吗?我更喜欢某些内容,而不是按模板进行模板,逐项逐项进行模板,向每个函数添加shell超时。
我还想避免通过在超时配置中添加更多时间来解决此问题,其目标是让Zabbix在要执行时再次执行功能而不是避免超时。
代理商的版本是Zabbix_agentd(Daemon)(Zabbix)4.0.17
自定义函数的示例是此
UserParameter=agent.CheckIP[*],fping $1 | grep -c alive
检查日志文件,我得到了此文件
569:20220628:123534.628 Failed to execute command "fping 192.168.xxx.xxx | grep -c alive": Timeout while executing a shell script.
569:20220628:123534.628 active check "ioagent.CheckIP[192.168.xxx.xxx]" is not supported: Timeout while executing a shell script.
569:20220628:124731.420 Failed to execute command "fping 192.168.xxx.xxx | grep -c alive": Timeout while executing a shell script.
569:20220628:124731.420 active check "ioagent.CheckIP[192.168.xxx.xxx]" is not supported: Timeout while executing a shell script.
I´m using zabbix to monitor some servers and I have implemented some custom functions.
the problem in this particular one is that in case of a connection error (which I'm facing), the zabbix item will be marked as "Not Supported" by the Host, and won't be executed for like 10 minutes.
I don't have an issue with the fact of the script returning no data, but I do need it to be executed every minute.
Is there a configuration I can tweak on zabbix to overcome this? I would prefer something global instead of going template by template, item by item, adding a shell timeout to each function.
I would also like to avoid solving this by adding more time to the timeout configuration, the goal is for zabbix to execute the functions again when they are meant to be executed instead of avoiding the timeout.
The agent's version is zabbix_agentd (daemon) (Zabbix) 4.0.17
An example of custom function is this
UserParameter=agent.CheckIP[*],fping $1 | grep -c alive
Checking the log file, I got this
569:20220628:123534.628 Failed to execute command "fping 192.168.xxx.xxx | grep -c alive": Timeout while executing a shell script.
569:20220628:123534.628 active check "ioagent.CheckIP[192.168.xxx.xxx]" is not supported: Timeout while executing a shell script.
569:20220628:124731.420 Failed to execute command "fping 192.168.xxx.xxx | grep -c alive": Timeout while executing a shell script.
569:20220628:124731.420 active check "ioagent.CheckIP[192.168.xxx.xxx]" is not supported: Timeout while executing a shell script.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论