APMIA App Synthetic Monitor extension
search cancel

APMIA App Synthetic Monitor extension

book

Article ID: 367436

calendar_today

Updated On:

Products

DX APM SaaS

Issue/Introduction

We have installed ASM On-premise location server and now we are trying to get the ASM metrics to APM SaaS component using apmia extension. To do the same I'm getting error "A JSONObject text must begin with '{' at 1 [character 2 line 1]. 

[ERROR] [IntroscopeAgent.Asm.RestClient] A JSONObject text must begin with '{' at 1 [character 2 line 1]
[INFO] [IntroscopeAgent.Asm.AsmEventProducer] Exception occurred while running AsmEventProducer thread .
java.lang.RuntimeException: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
    at com.ca.agent.extensions.asm.RestClient.authRequest(RestClient.java:158)
    at com.ca.agent.extensions.asm.AsmAccessor.login(AsmAccessor.java:197)
    at com.ca.agent.extensions.asm.AsmRequestHelper.connect(AsmRequestHelper.java:84)
    at com.ca.agent.extensions.asm.AsmEventProducer.work(AsmEventProducer.java:77)
    at com.ca.agent.extensions.asm.AsmEventProducer.run(AsmEventProducer.java:66)

Resolution

This is happening during API authentication. 

In your bundle.properties, you have the following set:

# URL of the ASM V3 API to get authentication token
#
# Changing this property requires restarting the Monitored Process
asm.BasicAuthURL=https://api.asm.saas.broadcom.com/v3/<token>

You are using an actual token above, however this is the default setting in the bundle.properties file in the agent.

# URL of the ASM V3 API to get authentication token
#
# Changing this property requires restarting the Monitored Process
asm.BasicAuthURL=https://api.asm.saas.broadcom.com/v3/api-token

By default, we use "api-token" and not a specified token as the Agent must obtain its own token. 

Modifying the above resolved the issue, however led to a 401 unauthorized issue.  This was because user was using a subaccount for the API.  You must use the master account credentials to access the ASM API.