--- title: AccAgentsAPI - Scoped description: The AccAgentsAPI script include enables you to perform management actions on available agents.Creates an AccAgentsAPI instance.Checks the status of a grab log request.Gets the information of a specified agent.Gets a list of agents with related information.Restarts a specified agent with alive/up status.Runs a discovery check to locate CIs related to an agent. The specified agent must be in alive/up status.Set the given data collection status \(true/false if enabled or not\) for a specified agent.Requests the log of a specified agent with alive/up status. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/AccAgentsAPIAPIScoped.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 10 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # AccAgentsAPI- Scoped The AccAgentsAPI script include enables you to perform management actions on available agents. This script include requires the Agent Client Collector Framework \(sn\_agent\) store application and is provided within the `sn_agent` namespace. For more information, refer to [Agent Client Collector](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-operations-management/acc-landing-page.md). For the REST API solution, refer to [Agent Client Collector API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/agnt_clnt_cll-api.md). This script include provides methods that enable the following: - Getting extensive information of one or more agents. - Submitting a request to grab an agent log and retrieving information about the request progress. - Starting or stopping data collection. - Restarting an agent. - Running discovery on an agent. **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## AccAgentsAPI - AccAgentsAPI\(\) Creates an AccAgentsAPI instance. |Name|Type|Description| |----|----|-----------| |None| | | The following example shows how to initialize AccAgentsAPI. ``` var agentsApi = new sn_agent.AccAgentsAPI(); ``` ## AccAgentsAPI - checkGrabLogRequestProgress\(String requestId\) Checks the status of a grab log request. Run the [submitGrabLogRequest\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/AccAgentsAPIAPIScoped.md) method to get a request ID. |Name|Type|Description| |----|----|-----------| |requestId|String|Sys\_id of a request in the Agent Client Collector Requests \[sn\_agent\_request\] table.|
| Properties | Description |
|---|---|
| <Object> | JSON object containing the grab log request status.``` { "status": Number, "output": "String" } ``` |
| status | Number indicating status of the grab log request.Possible values: - 0: Grab log request is complete. - 1: Grab log request in progress. - 2: Grab log request timed out. - 3: Grab log request has an error. - 4: Grab log request was not found. |
| output | Information describing the status. |
| Properties | Description |
|---|---|
| <Object> | Object containing extended agent information.``` { "error": String, "agent": Object } ``` |
| error | Error message. Null if there is no error.Data type: String |
| agent | ``` "agent": { "agent_id": "String", "data_collection": Number, "ip_address": "String", "is_duplicate": Boolean, "is_restart_enabled": Boolean, "name": "String", "number_of_running_checks": Number, "status": Number, "up_since": "String", "version": "String" } ``` |
| agent.agent\_id | ID of the agent as submitted.Data type: String |
| agent.data\_collection | Data collection indicates whether scheduled checks are to be run. These checks are a part of the policies scheduled for this agent to run.Possible values: - 0: On – Checks run as scheduled. - 1: Off \(manual\) – Checks have been disabled manually. - 2: Off \(auto\) – Checks have been disabled automatically due to high CPU consumption by the Data type: Number |
| agent.ip\_address | Agent IP address.Data type: String |
| agent.is\_duplicate | Flag that indicates whether this agent is a duplicate of another. There should be only a single agent on a given host. Possible values: - true: The agent has the same host as an Alive/Up agent with a different agent ID. Turn off or uninstall the duplicate - false: This agent has no duplicates in the Alive/Up state. Data type: Boolean |
| agent.is\_restart\_enabled | Flag that indicates whether restart is enabled. Agent restart is not configurable. It depends on the OS and the version of the OS the agent is running on. Possible values: - true: Restart is enabled for this agent. - false: Restart is disabled for this agent. Data type: Boolean |
| agent.name | Name of the agent.Data type: String |
| agent.number\_of\_running\_checks | The number of checks the agent is scheduled to run. These checks are a part of the policies scheduled for this agent to run.Data type: Number |
| agent.status | Status of the agent.Possible values: - 0: Alive/Up – The agent is active. - 1: Warning – The agent has not received a keep-alive message in the past few minutes. - 2: Down – The agent has not received a keep-alive message in a long time. - 3: Restarting – The agent is restarting. Data type: Number |
| agent.up\_since | UTC time since the agent's status became alive/up. The value is in [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeScoped.md) format.Data type: String |
| agent.version | Version of Agent Client Collector the agent is running.Data type: String |
| Name | Type | Description |
|---|---|---|
| encodedQuery | String | Encoded query string in the standard platform format. |
| limit | Number | Optional. Restricts results to a maximum number of agents. Use null or undefined for both if they are not required.Default/Max: 20,000 |
| Property | Description |
|---|---|
| <Array> | Array of JSON objects containing extended agent information.``` [ { "agent_id": "String", "data_collection": Number, "ip_address": "String", "is_duplicate": Boolean, "is_restart_enabled": Boolean, "name": "String", "number_of_running_checks": Number, "status": Number, "up_since": "String", "version": "String" } ] ``` |
| agent\_id | ID of the agent as submitted.Data type: String |
| data\_collection | Data collection indicates whether scheduled checks are to be run. These checks are a part of the policies scheduled for this agent to run.Possible values: - 0: On – Checks run as scheduled. - 1: Off \(manual\) – Checks have been disabled manually. - 2: Off \(auto\) – Checks have been disabled automatically due to high CPU consumption by the Data type: Number |
| ip\_address | Agent IP address.Data type: String |
| is\_duplicate | Flag that indicates whether this agent is a duplicate of another. There should be only a single agent on a given host. Possible values: - true: The agent has the same host as an Alive/Up agent with a different agent ID. Turn off or uninstall the duplicate - false: This agent has no duplicates in the Alive/Up state. Data type: Boolean |
| is\_restart\_enabled | Flag that indicates whether restart is enabled. Agent restart is not configurable. It depends on the OS and the version of the OS the agent is running on. Possible values: - true: Restart is enabled for this agent. - false: Restart is disabled for this agent. Data type: Boolean |
| name | Name of the agent.Data type: String |
| number\_of\_running\_checks | The number of checks the agent is scheduled to run. These checks are a part of the policies scheduled for this agent to run.Data type: Number |
| status | Status of the agent.Possible values: - 0: Alive/Up – The agent is active. - 1: Warning – The agent has not received a keep-alive message in the past few minutes. - 2: Down – The agent has not received a keep-alive message in a long time. - 3: Restarting – The agent is restarting. Data type: Number |
| up\_since | UTC time since the agent's status became alive/up. The value is in [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeScoped.md) format.Data type: String |
| version | Version of Agent Client Collector the agent is running.Data type: String |
| Name | Type | Description |
|---|---|---|
| agentID | String | Unique ID of an agent listed in the Agent ID column of the Agent Client Collectors \[sn\_agent\_cmdb\_ci\_agent\] table. |
| status | Boolean | Flag that indicates whether data collection is enabled for the agent. Valid values: - true: Enables data collection for this agent. - false: Disables data collection for this agent. Default: true |
| Properties | Description |
|---|---|
| <Object> | JSON object containing the request ID and any error information.``` { "error": "String", "request_id": "String" } ``` |
| error | Error message. Null if there is no error.Data type: String |
| request\_id | Sys\_id of a request in the Agent Client Collector Requests \[sn\_agent\_request\] table. You can use this ID to get the status of the request using GET /agents/\{request\_id\}/. Data type: String |