本节介绍了 HTTP 和 HTTPS 运行状况监控器的 NTLM 和基本身份验证支持。

为 HTTPS 运行状况监控器配置 NTLM 身份验证

以下是为 POST 方法创建新的 HTTPS 监控器并启用 NTLM 身份验证的步骤:

[admin:ctrl2]: > configure healthmonitor NTLM-POST

[admin:ctrl2]: healthmonitor> type health_monitor_https
[admin:ctrl2]: healthmonitor> https_monitor
[admin:ctrl2]: healthmonitor:https_monitor> http_request "POST /EWS/Exchange.asmx HTTP/1.1\r\nContent-Typ
e: text/xml; charset=utf-8 "
[admin:ctrl2]: healthmonitor:https_monitor> http_request_body "[?xml version=\"1.0\" encoding=\"UTF-8\"?]
[soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"http://schemas.microsoft.com/e
xchange/services/2006/types\" xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"][soap:Hea
der][/soap:Header][soap:Body][GetFolder xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\"][
FolderShape][t:BaseShape>IdOnly[/t:BaseShape][/FolderShape][FolderIds][t:DistinguishedFolderId Id=\"inbox\"][t:M
ailbox][t:EmailAddress][/t:EmailAddress][/t:Mailbox][/t:DistinguishedFolderId][/FolderIds][/GetFolder][/soap:Body][/soap:Envelope]"

[admin:ctrl2]: healthmonitor:https_monitor> http_response "GetFolderResponseMessage ResponseClass=\"Success\""

[admin:ctrl2]: healthmonitor:https_monitor> http_response_code http_2xx
[admin:ctrl2]: healthmonitor:https_monitor> auth_type auth_ntlm
[admin:ctrl2]: healthmonitor:https_monitor> ssl_attributes 
[admin:ctrl2]: healthmonitor:https_monitor:ssl_attributes> ssl_profile_ref System-Standard  
[admin:ctrl2]: healthmonitor:https_monitor:ssl_attributes> save 
[admin:ctrl2]: healthmonitor:https_monitor> save
[admin:ctrl2]: healthmonitor> authentication
[admin:ctrl2]: healthmonitor:authentication> username aviuser
[admin:ctrl2]: healthmonitor:authentication> password aviuserpassword
[admin:ctrl2]: healthmonitor:authentication> save
[admin:ctrl2]: healthmonitor> save

+-------------------------+--------------------------------------------------------------------------------------------------------------------------+ 
|  Field                  | Value                             											    								         |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
| uuid                    | healthmonitor-b8b7cd94-7076-4a55-a90a-77d6e768f4b1        				   										         |
| name                    | NTLM                             											 									         |
| send_interval           | 10 sec                            											 									         |
| receive_timeout         | 4 sec                            											 									         |
| successful_checks       | 2                                											 									         |
| failed_checks           | 2                                 											 									         |
| type                    | HEALTH_MONITOR_HTTPS           											     									         |
| https_monitor           |                                   											 									         |
|   http_request          | POST /EWS/Exchange.asmx HTTP/1.1  											 									         |
|                         | Content-Type: text/xml; charset=utf-8                                        									         |
|   http_response_code[1] | HTTP_2XX                           											 									         |
|   http_response         | GetFolderResponseMessage ResponseClass="Success"                             									         |
|   ssl_attributes        |                                    											 									         | 
|     ssl_profile_ref     | System-Standard                                                              									         | 
|   exact_http_request    | False                                                                        									         | 
|   auth_type             | AUTH_NTLM                                                                    									         | 
|   http_request_body     | <?xml version="1.0" encoding="UTF-8"?><																         |
|						  |	soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 											         |
|						  |	xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 											         |
|						  |	xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">										         |
|						  |	<soap:Header><soap:Header><soap:Body>															         |
|						  |	<GetFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">								     |
|						  |	<FolderShape><t:BaseShape>IdOnly</t:BaseShape>												         |
|						  |	</FolderShape><FolderIds>																			         |
|						  |	<t:DistinguishedFolderId Id="inbox"> <t:Mailbox>													         |
|						  |	<t:EmailAddress></t:EmailAddress> </t:Mailbox>												         |
|						  |	</t:DistinguishedFolderId><</FolderIds>																         |
|						  |	</GetFolder></soap:Body></soap:Envelope> 														         | 
| authentication          |                                                                                 								         | 
|   username              | <sensitive>                                                              								             | 
|   password              | <sensitive>                                                               								         | 
| is_federated            | False                                                                           								         | 
| tenant_ref              | admin                                                                           								         | 
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
注:

您可以使用类似的方式为 GET 方法和 HTTP 运行状况监控器配置 NTLM 身份验证。

在 HTTP(S) 运行状况监控器中启用基本身份验证

HTTP(S) 运行状况监控器提供用户名和密码等基本信息以支持基本身份验证类型。

为运行状况监控器配置基本身份验证

您可以提供用户名和密码等基本信息,以便为 GETPOST 方法配置基本身份验证。

以下示例为 HTTP 运行状况监控器上的 GET 方法配置基本身份验证:

[admin:ctrl2]: > configure healthmonitor HTTP-Basic-Authentication

[admin:ctrl2]: healthmonitor> type health_monitor_http
[admin:ctrl2]: healthmonitor> http_monitor
[admin:ctrl2]: healthmonitor:http_monitor> auth_type auth_basic
[admin:ctrl2]: healthmonitor:http_monitor> save
[admin:ctrl2]: healthmonitor> authentication
[admin:ctrl2]: healthmonitor:authentication> username aviuser
[admin:ctrl2]: healthmonitor:authentication> password aviuser
[admin:ctrl2]: healthmonitor:authentication> save
[admin:ctrl2]: healthmonitor> save

您可以使用类似的方式为 POST 方法配置基本身份验证,或者在 HTTPS 运行状况监控器中启用基本身份验证。

注:
  • 只能为 HTTP 和 HTTPS 监控器启用身份验证。

  • 您无法为使用 NTLM 身份验证的 HTTP(S) 运行状况监控器配置 exact_http_request

运行状况监控器中的基本身份验证

以下是基本身份验证选项。

  • 您无法为使用基本身份验证的 HTTP(S) 运行状况监控器配置 exact_http_request

  • 要将 exact_http_request 用于使用基本身份验证的 HTTP(S) 运行状况监控器,您必须在请求中提供授权基本标头,并将凭据作为使用 Base64 编码的用户 ID:密码对。

下面提供了一个示例代码。

GET / HTTP/1.1
Host: 10.79.168.55 
Authorization: Basic <encoded credentials>
Accept: /