Testing DIS Agent
Testing DIS Agent on a Linux Server
- Start PuTTY and log in to the server on which logs reside.
- Run the following command to navigate to the directory in which the DIS Agent stores logs:
cd /opt/dis-agent-X.X.X/logs
- Run the following command to view logs:
tail -100f dis-agent.log
- If information similar to the following appears, the DIS Agent is running properly.
Agent: Startup completed in xx ms
- If any of the following information appears, the DIS Agent is not running properly and you need to troubleshoot the DIS Agent:
- HttpClientErrorException: 400 Bad Request
Possible cause: The value of DISStream or projectId in Configuring DIS Agent is incorrect.
Solution: Stop the DIS Agent process and correct the parameter values.
- HttpClientErrorException: 403 Forbidden
Possible cause: The DIS gateway blacklists the IP address of the Linux server on which the DIS Agent is installed and consequently the request to view logs is blocked. Usually, the Linux server IP address is blacklisted because a DIS API is repeatedly called using incorrect configuration.
Solution: Stop the DIS Agent process, modify the agent.yml file (see Configuring DIS Agent). Restart the DIS Agent process 30 minutes after it stops.
- UnknownHttpStatusCodeException: Unknown status code [441]
Possible cause: AK/SK configuration is incorrect.
Solution: Stop the DIS Agent process and correct the AK/SK configuration.
- ConnectTimeoutException: Connect to DOMAIN[DOMAIN/IP] failed: connect timed out
Possible cause: The connection between the Linux server on which the DIS Agent is installed and the DIS gateway times out.
Solution: Ensure that the Linux server on which the DIS Agent is installed can connect to the Internet.
- HttpClientErrorException: 400 Bad Request
- If information similar to the following appears, the DIS Agent is running properly.
- Check whether the DIS Agent can upload logs.
- If the monitoring directory configured in agent.yml contains matched files, logs will record the information similar to the following, indicating that [N1 records (B1 bytes)/N2 files (B2 bytes)] are parsed and [N3 records/N4 files] are successfully uploaded.
Agent: Progress: [N1 records (B1 bytes) / N2 files (B2 bytes)] parsed, and [N3 records / N4 files] sent successfully to destinations. Uptime: 30146ms
- If no files match the filePattern, run the following command to generate log files required for testing log uploading:
echo "`date` Hello world." >> /tmp/test.log
- If the monitoring directory configured in agent.yml contains matched files, logs will record the information similar to the following, indicating that [N1 records (B1 bytes)/N2 files (B2 bytes)] are parsed and [N3 records/N4 files] are successfully uploaded.
- Log in to the DIS console and view monitoring data of the DIS stream specified by the DISStream or CustomFileStream parameter in Configuring DIS Agent. If the stream monitoring data shows that data has been uploaded to the DIS stream, the DIS Agent has been successfully installed.
Testing DIS Agent on a Windows Server
- Use a file manager to navigate to the logs directory.
- Open the dis-agent.log file using an editor. View logs in the file.
- If information similar to the following appears, the DIS Agent is running properly.
Agent: Startup completed in xx ms
- If any of the following information appears, the DIS Agent is not running properly and you need to troubleshoot the DIS Agent:
- HttpClientErrorException: 400 Bad Request
Possible cause: The value of DISStream or projectId in Configuring DIS Agent is incorrect.
Solution: Stop the DIS Agent process and correct the parameter values.
- HttpClientErrorException: 403 Forbidden
Possible cause: The DIS gateway blacklists the IP address of the Linux server on which the DIS Agent is installed and consequently the request to view logs is blocked. Usually, the Linux server IP address is blacklisted because a DIS API is repeatedly called using incorrect configuration.
Solution: Stop the DIS Agent process, modify the agent.yml file (see Configuring DIS Agent). Restart the DIS Agent process 30 minutes after it stops.
- UnknownHttpStatusCodeException: Unknown status code [441]
Possible cause: AK/SK configuration is incorrect.
Solution: Stop the DIS Agent process and correct the AK/SK configuration.
- ConnectTimeoutException: Connect to DOMAIN[DOMAIN/IP] failed: connect timed out
Possible cause: The connection between the Linux server on which the DIS Agent is installed and the DIS gateway times out.
Solution: Ensure that the Linux server on which the DIS Agent is installed can connect to the Internet.
- HttpClientErrorException: 400 Bad Request
- If information similar to the following appears, the DIS Agent is running properly.
- Check whether the DIS Agent can upload logs.
- If the monitoring directory configured in agent.yml contains matched files, logs will record the information similar to the following, indicating that [N1 records (B1 bytes)/N2 files (B2 bytes)] are parsed and [N3 records/N4 files] are successfully uploaded.
Agent: Progress: [N1 records (B1 bytes) / N2 files (B2 bytes)] parsed, and [N3 records / N4 files] sent successfully to destinations. Uptime: 30146ms
- If no files match the filePattern, run the following command to generate log files required for testing log uploading:
echo %date%time%Hello world. >> C:\test.log
- If the monitoring directory configured in agent.yml contains matched files, logs will record the information similar to the following, indicating that [N1 records (B1 bytes)/N2 files (B2 bytes)] are parsed and [N3 records/N4 files] are successfully uploaded.
- Log in to the DIS console and view monitoring data of the DIS stream specified by the DISStream or CustomFileStream parameter in Configuring DIS Agent. If the stream monitoring data shows that data has been uploaded to the DIS stream, the DIS Agent has been successfully installed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot