Zabbix 监控RabbitMQ提示Preprocessing failed for: HTTP/1.1 500 Internal Server Error..content-length: 0

释放双眼,带上耳机,听听看~!
🤖 由 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

Zabbix 监控RabbitMQ提示Preprocessing failed for: HTTP/1.1 500 Internal Server Error..content-length: 0

原因

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 选择监控项

Zabbix 监控RabbitMQ提示Preprocessing failed for: HTTP/1.1 500 Internal Server Error..content-length: 0

找到RabbitMQ: Get nodes 监控项
Zabbix 监控RabbitMQ提示Preprocessing failed for: HTTP/1.1 500 Internal Server Error..content-length: 0

将下面配置进行修改删除

旧配置如下

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"]

点击更新

我们到主机下面的触发器中,进行测试

Zabbix 监控RabbitMQ提示Preprocessing failed for: HTTP/1.1 500 Internal Server Error..content-length: 0

给TA打赏
共{{data.count}}人
人已打赏
报错锦集

Kubernetes Ingress 代理GRPC 双向流量1分钟关闭连接Received RST_STREAM with code 0

2023-12-27 18:03:09

RabbitMQZabbix

Zabbix 使用RabbitMQ node by Zabbix agent监控RabbitMQ

2024-1-4 17:51:55

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索