当用户名包含 时,Monit 会给出语法错误@
,这种情况很常见。例如,[email protected]
如下所示:
check host somesite with address monitoring.somesite.com
if failed url https://[email protected]:[email protected]/
[...]
似乎没有提到文档。
在用户名中包含特殊字符的正确方法是什么?
答案1
Monit 无法解析%40
但@
它支持 HTTP 标头
例如网址:
https://[email protected]:[email protected]
应转换为
Authorization: Basic dXNlckBtYWlsLmNvbTpwYXNzd29yZA==
例如:
check host BasicAuth with address monit.test.basic
if failed
port 443
with protocol https method GET
with http headers [Authorization: Basic dXNlckBtYWlsLmNvbTpwYXNzd29yZA==]
then alert
else if succeeded then alert