释放双眼,带上耳机,听听看~!
🤖 由 ChatGPT 生成的文章摘要
触发器错误日志如下
Preprocessing failed for: HTTP/1.1 500 Internal Server Error..content-length: 0
1. Failed: cannot perform regular expression "\n\s?\n(.*)" match for value of type "none": pattern does not match
原因
https://groups.google.com/g/rabbitmq-users/c/N0EgrLn55XQ
通过查找Google论坛,有人有相同的问题。具体原因是默认RabbitMQ模板采用了FQDN 参数,导致直接访问会有500的状态码
演示如下
curl -v -u zbx_monitor:xxx
'http://127.0.0.1:15672/api/nodes/rabbit@hostname?memory=true'
< HTTP/1.1 200 OK
curl -v -u zbx_monitor:xxx
'http://127.0.0.1:15672/api/nodes/rab...@hostname.domain.com?memory=true'
< HTTP/1.1 500 Internal Server Error
解决办法
修改RabbitMQ模板,找到RabbitMQ node by Zabbix agent
选择监控项
找到RabbitMQ: Get nodes
监控项
将下面配置进行修改删除
旧配置如下
web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}@{HOST.NAME}?memory=true"]
修改为 (删除HOST.NAME
)
web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.HOST}:{$RABBITMQ.API.PORT}/api/nodes/{$RABBITMQ.CLUSTER.NAME}?memory=true"]
点击更新
我们到主机下面的触发器中,进行测试