---
sourceDocument: 요코하마 IT 운영 관리
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/yokohama/it-operations-management

 Release :

    - yokohama

ft:locale :

    - ko-KR

ft:publication_title :

    - 요코하마 IT 운영 관리

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# 라이브 에이전트와 연결된 API 검증

# 라이브 에이전트와 연결된 API 검증 {#ariaid-title1}

* 릴리스 버전: Yokohama
* 
* 업데이트 날짜 2025년 01월 30일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 1분

AgentNowHandler.hasAgent API를 호출하여 CI가 라이브 에이전트와 연결되어 있는지 확인합니다. API는 CI의 sys_id를 가져오고 True/False 결과를 반환합니다.
hasAgent() 메서드는 CI의 sys_id를 문자열 매개변수로 사용하고 CI가 다음 조건 중 하나를 충족하면 True를 반환합니다.

* CI가 `sn_agent_cmdb_ci_agent`이고 이 에이전트가 활성 상태입니다.
* CI는 호스트(`cmdb_ci_hardware` 확장)이고 라이브 에이전트와 연결됩니다.
* CI는 애플리케이션(`cmdb_ci_appl` 확장)이며 라이브 에이전트에 연결된 호스트와의 실행 관계가 있습니다.

{#acc-api-live-agent__ul_yvz_tsg_3kb}

예:

    var agentNow = new sn_agent.AgentNowHandler(); 
    gs.info('Agent assocation with CI? ' + 
    agentNow.hasAgent('158279505372b30034b8ddeeff7b1270'); // sys_id of agent 


