3 回答
TA贡献2003条经验 获得超2个赞
您尚未提供有关语言等的任何详细信息:
您可以简单地向管理api发出HTTP GET请求。
$ curl -i -u guest:guest http://localhost:15672/api/whoami
TA贡献1802条经验 获得超5个赞
这是使用Python进行检查的一种方法:
#!/usr/bin/env python
import socket
from kombu import Connection
host = "localhost"
port = 5672
user = "guest"
password = "guest"
vhost = "/"
url = 'amqp://{0}:{1}@{2}:{3}/{4}'.format(user, password, host, port, vhost)
with Connection(url) as c:
try:
c.connect()
except socket.error:
raise ValueError("Received socket.error, "
"rabbitmq server probably isn't running")
except IOError:
raise ValueError("Received IOError, probably bad credentials")
else:
print "Credentials are valid"
TA贡献1856条经验 获得超5个赞
你可以尝试用rabbitmqctl
为好,
rabbitmqctl authenticate_user username password
并检查Bash中的返回码。
添加回答
举报