{"componentChunkName":"component---src-templates-tutorial-js","path":"/zh/tutorial/AddURLMonitoring/","result":{"data":{"markdownRemark":{"html":"<h2 id=\"添加url监控\"><a href=\"#%E6%B7%BB%E5%8A%A0url%E7%9B%91%E6%8E%A7\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>添加URL监控</h2>\n<p>SuperMap iManager支持添加URL监控，请参照以下步骤添加：</p>\n<ol>\n<li>登录SuperMap iManager，点击左侧导航栏<strong>URL监控</strong>；</li>\n<li>在URL监控页面左上角点击<strong>添加URL监控</strong>；</li>\n<li>\n<p>填入如下信息：</p>\n<p>\n  <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/iManager_K8S/1014/static/771568095f32de02742eb557915537c2/fdaf8/addURLMonitoring.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n  \n  <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block;  max-width: 674px; margin-left: auto; margin-right: auto;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 94.28571428571429%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAIAAAAf7rriAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABsklEQVQ4y41TW3aCMBR0J0oA8yRi0QQEiwSP/LiAnm6jf91M/7rOToLFn0odNScEh7l37rBIgDjOpOScV1XVtq0xRmu9eYw8z5VS4C0CN+aCM8622+1+b3BPPoYIK5TAWozKUgguRFlWznXH42vbnrquO53wBfzOOYdN3zvXn/u+PxwOSkpPTtMUZErZS8BMzShqKhusQE4SnAkh0C3IWZbpWYCPyn3Z+InQLZrWOnsG4Cs1kdmNrDIFfTxVzQL8uzKss9ZgbZrj9XodhsF5X86wDZ8zgIu+h29d506tP9ntdoSQ4HaSUEqxYs6XYajrGpaglmkdNyOwH30ZlZNiV1hrhVQxFavlMopI/ARCSDBkKfFoxnlKefo0PDnES5S2HJWjaBUREkGdkCeUQzzXAeikKAp0VYSuGEM1fwATwXon+9AKboyFo01TI5tVWT6KGp5+M2wic84gaPBmGAs/cTIbkt+3Cu3hApXsbVlDt25gPjI0HxJP5pQi0hg6Ctc8VTQZ/5DP4qYM05EQRuma8c3wri9vSvuM01nA3cmwJCYRobL9/D58fOWFqUr736T8qH4AepnISaZk1goAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n    >\n      <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\"\n        alt=\"addURLMonitoring\"\n        title=\"\"\n        src=\"/iManager_K8S/1014/static/771568095f32de02742eb557915537c2/fdaf8/addURLMonitoring.png\"\n        srcset=\"/iManager_K8S/1014/static/771568095f32de02742eb557915537c2/65ed1/addURLMonitoring.png 210w,\n/iManager_K8S/1014/static/771568095f32de02742eb557915537c2/d10fb/addURLMonitoring.png 420w,\n/iManager_K8S/1014/static/771568095f32de02742eb557915537c2/fdaf8/addURLMonitoring.png 674w\"\n        sizes=\"(max-width: 674px) 100vw, 674px\"\n      />\n    </span>\n  </span>\n  \n  </a>\n    </p>\n<ul>\n<li>名称（必填）：URL监控的名称。</li>\n<li>URL（必填）：URL地址，格式为<code class=\"gatsby-code-text\">protocol://hostname:port/path/;parameters?query#fragment</code>。protocol为传输协议，比如http、https等；hostname为主机名，可以是DNS主机名或IP地址；port为端口号；path为路径；parameters用来指定特殊参数；query给动态网页传递参数；fragment用于指定网络资源中的片断。其中，protocol和hostname为必填项；当hostname为IP地址时，port必填。如果要监控GIS云套件中受保护的服务资源，需在URL后携带token参数，例如：<code class=\"gatsby-code-text\">http://ip:port/test?token=abcd</code>，获取token请参见<a href=\"../../microservices/GrantToken/\">GIS云套件->安全->令牌</a>。</li>\n<li>状态码（必填）：HTTP状态码，详细介绍请参见<a href=\"https://www.restapitutorial.com/httpstatuscodes.html\">https://www.restapitutorial.com/httpstatuscodes.html</a>。</li>\n<li>超时时间（必填）：响应时长限制，超过该时长则判断为超时。</li>\n<li>\n<p>结果断言：对返回的结果数据进行断言，判断返回数据是否符合预期。此选项需要填入<a href=\"https://www.runoob.com/regexp/regexp-syntax.html\" target=\"blank\">正则表达式</a>。如果状态码与结果断言同时存在，优先判断状态码。</p>\n<p>例如，对URL <code class=\"gatsby-code-text\">http://iserver.com/iserver/services/map-small/rest/maps/BaseMap_R@small.json</code> 设置结果断言 “top”:40.7445721689417,“left”:115.84346678320391,“bottom”:38.81091128809847。当返回值如下时，符合预期。</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">{\n &quot;viewBounds&quot;: {\n     &quot;top&quot;: 40.7445721689417,\n     &quot;left&quot;: 115.84346678320391,\n     &quot;bottom&quot;: 38.81091128809847,\n     &quot;leftBottom&quot;: {\n         &quot;x&quot;: 115.84346678320391,\n         &quot;y&quot;: 38.81091128809847\n     },\n     &quot;right&quot;: 117.77712766404714,\n     &quot;rightTop&quot;: {\n         &quot;x&quot;: 117.77712766404714,\n         &quot;y&quot;: 40.7445721689417\n     }\n },\n ...</code></pre></div>\n</li>\n<li>遵循重定向：勾选后，若URL发生重定向，自动监控重定向的URL。不勾选，若URL发生重定向，继续监控原URL。</li>\n</ul>\n<blockquote>\n<p>注意：<br>\n在云原生架构中，由于服务请求统一经过网关，对于未携带token并遵循重定向的URL，URL不能访问时会自动定向到网关，在URL监控中仍显示符合预期状态码200。例如，服务实例<code class=\"gatsby-code-text\">http://192.168.11.122:31124/iserver/services/map-World/rest</code>遵循重定向，预期状态码为200，删除该服务实例后，自动定向到服务网关，监控列表中的状态仍为“符合预期状态”。</p>\n</blockquote>\n<ul>\n<li>\n<p>重启服务：勾选后开启服务自动重启功能，设置与URL关联的服务。</p>\n<ul>\n<li>站点：选择对象服务所在站点。</li>\n<li>服务：选择对象服务。</li>\n<li>连续失败次数（必填）：连续不符合预期的次数，若连续不符合预期的次数达到该设定，则自动重启对象服务。第一次重启后，待监控指标恢复正常后才会重新计数。</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>点击<strong>确定</strong>，完成添加。</li>\n</ol>","frontmatter":{"title":"教程","next":null,"prev":null},"fields":{"path":"content/tutorial/AddURLMonitoring.zh.md","slug":"/zh/tutorial/AddURLMonitoring/","langKey":"zh"}}},"pageContext":{"slug":"/zh/tutorial/AddURLMonitoring/"}}}