该API将获取与查询字符串和搜索条件匹配的监视器/业务组列表。搜索也将在分配给用户的监视器列表中进行。
XML响应API:
http://[ APM Host ]:[ APM Port ]/AppManager/xml/Search?apikey=[ API Key]&query=[query]&searchCondition=[searchCondition]
JSON响应的API:
http://[ APM Host ]:[ APM Port ]/AppManager/json/Search?apikey=[ API Key]&query=[query]&searchCondition=[searchCondition]
字段 | 描述 |
---|---|
query | 该值指定必须在与用户关联的监视器列表中搜索的字符串。 |
字段 | 描述 |
---|---|
searchCondition | 此值指定必须在与用户关联的监视器列表中搜索的监视器的类型。例如-显示名称,监视器类型,IP地址和自定义字段。如果您希望在所有监视器类型中搜索,也可以将searchCondition指定为全部。 |
字段 | 描述 |
---|---|
Type | 这表示搜索结果中获得的元素的类型 |
HealthStatus | 这是搜索元素的健康状态 |
AvailabilityMessage | 这是搜索元素的可用性消息 |
DisplayName | 这是搜索元素的显示名称 |
ManagedServer | 这是添加了监视器或组的被管服务器名称。专业版的值将为NA |
AvailabilityStatus | 这是搜索元素的可用性状态 |
SubGroup | 这是元素所属的类别。 |
ResourceId | 这是搜索元素的resourceid。 |
HealthMessage | 这是搜索元素的健康信息 |
HealthSeverity | 这是搜索元素的健康严重级别 |
ImagePath | 这是监视器类型/业务组图像路径 |
AvailabilitySeverity | 这是搜索元素的可用性严重级别 |
DetailsPageURL | 这是搜索元素的详细信息页面。 |
<response response-code="4000"><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource karthi linux is available." DisplayName="karthi linux" ManagedServer="Admin Server" AvailabilityStatus="up" SubGroup="Linux" ResourceId="10000117" HealthMessage="Health of karthi linux is clear. <br>Root Cause : <br>1. karthi linux is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=10000117&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource app-centos32-1 is available." DisplayName="app-centos32-1" ManagedServer="Admin Server" AvailabilityStatus="up" SubGroup="Linux" ResourceId="10000108" HealthMessage="Health of app-centos32-1 is clear. <br>Root Cause : <br>1. app-centos32-1 is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=10000108&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource prasadh linux is available." DisplayName="prasadh linux" ManagedServer="Admin Server" AvailabilityStatus="up" SubGroup="Linux" ResourceId="10000071" HealthMessage="Health of prasadh linux is clear. <br>Root Cause : <br>1. prasadh linux is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=10000071&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/></response> |
搜索所有输入: http://apm-prod1:9090/AppManager/xml/Search?apikey=4f77fe9c75f4472764a07846bf7f032d&query=linux&searchCondition=all 响应: <AppManager-response uri="/AppManager/xml/Search"><result><response response-code="4000"><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource linux is available." DisplayName="linux" AvailabilityStatus="up" SubGroup="Linux" ResourceId="20000107" HealthMessage="Health of linux is clear. <br>Root Cause : <br>1. linux is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=20000107&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource app-centos32-2 is available." DisplayName="app-centos32-2" AvailabilityStatus="up" SubGroup="Linux" ResourceId="20000786" HealthMessage="Health of app-centos32-2 is clear. <br>Root Cause : <br>1. app-centos32-2 is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=20000786&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="critical" AvailabilityMessage="Resource up. <br>The resource app-centos5-64-1 is available." DisplayName="app-centos5-64-1" AvailabilityStatus="up" SubGroup="Linux" ResourceId="20001014" HealthMessage="Health of app-centos5-64-1 is critical. <br>Root Cause : <br>1. CPU Utilization 22 > 0 % (threshold).<br>2. Response Time 2 > 0 ms (threshold).<br>" HealthSeverity="1" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=20001014&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/></response></result></AppManager-response> |
JSON 输入 http://apm-prod1:9090/AppManager/json/Search?apikey=4f77fe9c75f4472764a07846bf7f032d&query=linux&searchCondition=monitortype JSON 响应 {"response":{"result":[{"Type":"Linux","HealthStatus":"clear","AvailabilityMessage":"Resource up. <br>The resource app-centos32-1 is available.","DisplayName":"app-centos32-1","ManagedServer":"Admin Server","AvailabilityStatus":"up","SubGroup":"Linux","ResourceId":"10000108","HealthMessage":"Health of app-centos32-1 is clear. <br>Root Cause : <br>1. app-centos32-1 is up<br>2. Data Collection Successful<br>","HealthSeverity":"5","ImagePath":"/images/icon_monitors_linux.gif","AvailabilitySeverity":"5","DetailsPageURL":"/showresource.do?resourceid=10000108&method=showResourceForResourceID&PRINTER_FRIENDLY=true"},{"Type":"Linux","HealthStatus":"clear","AvailabilityMessage":"Resource up. <br>The resource linux is available.","DisplayName":"linux","ManagedServer":"Admin Server","AvailabilityStatus":"up","SubGroup":"Linux","ResourceId":"10000117","HealthMessage":"Health of karthi linux is clear. <br>Root Cause : <br>1. linux is up<br>2. Data Collection Successful<br>","HealthSeverity":"5","ImagePath":"/images/icon_monitors_linux.gif","AvailabilitySeverity":"5","DetailsPageURL":"/showresource.do?resourceid=10000117&method=showResourceForResourceID&PRINTER_FRIENDLY=true"},{"Type":"Linux","HealthStatus":"clear","AvailabilityMessage":"Resource up. <br>The resource prasadh linux is available.","DisplayName":"prasadh linux","ManagedServer":"Admin Server","AvailabilityStatus":"up","SubGroup":"Linux","ResourceId":"10000071","HealthMessage":"Health of linux1 is clear. <br>Root Cause : <br>1. linux1 is up<br>2. Data Collection Successful<br>","HealthSeverity":"5","ImagePath":"/images/icon_monitors_linux.gif","AvailabilitySeverity":"5","DetailsPageURL":"/showresource.do?resourceid=10000071&method=showResourceForResourceID&PRINTER_FRIENDLY=true"}],"uri":"/AppManager/json/Search"},"response-code":"4000"} |