API Test with TCP
The TCP tests API allows you to send TCP packets to servers running services with the TCP protocol, allowing you to test whether TCP connections are established or not.
To perform API Test creation with TCP method, follow the instructions below:
Log in to vMonitor Platform here.
Select the Synthetic test folder .
Select API test.
Select Create an API test.
Enter information including:
Test Information: define basic information, select TCP method and specify hostname to test
Test name: name of the API test
Test type : test protocol, you choose TCP
Hostname: select the server or device you need to check, can be domain name or IP address
Port : select the Port you want to check.
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252F0b6L2hKjicF4v34xvbam%252Fimage.png%3Falt%3Dmedia%26token%3D7f003889-84f5-4ce8-94e2-ce00704a175e&width=768&dpr=4&quality=100&sign=6f023500&sv=1)
After filling in the Test Information, you can choose Run Test or Test Again if you have tested before to check, you can see returned information such as whether TCP was successful or not, latency.
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252FsodoXVFlXs553ZOeuUhy%252Fimage.png%3Falt%3Dmedia%26token%3D09ded7eb-63a4-4bea-9c27-66dcc085e2e1&width=768&dpr=4&quality=100&sign=4e49fec9&sv=1)
Test Assertion
Assertion defines what you expect about the API Test results. If the returned results meet what you define, API Test will show that the hostname you are testing is successful, and vice versa, API Test will show that the hostname you are testing is successful. test is failed. The system will automatically add Assertion for you after you Run the test, you need to define at least one Assertion for the API test
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252Fk7vYen7BzhFQpaq1jkLo%252Fimage.png%3Falt%3Dmedia%26token%3D02eb7391-7e02-41c8-8ff1-3306e9833de5&width=768&dpr=4&quality=100&sign=552c091b&sv=1)
Location
Select the Location that will run TCP Tests to your hostname. TCP tests can be run from both Public Locations (managed by VNG Cloud) and Private Locations (installed and managed by customers) based on your needs for running tests from outside (internet) or inside the network. your. Public Locations managed by VNG Cloud currently has 2 locations: HCM and Hanoi.
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252FHkRz7hPhKKVxkRWcyZqn%252Fimage.png%3Falt%3Dmedia%26token%3Dcd0228c6-ccc4-4457-9bd2-9274a82edde9&width=768&dpr=4&quality=100&sign=f8ec96c7&sv=1)
Alarm conditions: Set up alarm conditions to define the cases where you want the test to fail and trigger the alarm.
Interval : how often API Test will test once, default will be 1p
Time of failure : how many consecutive failures will alert
Locations with failure : how many locations fail to warn
For example, when you select Time of failure: 1 and Locations with failure: 2, it will be understood as: you will be warned if the Test fails 1 time in a row from 2 out of 2 locations.
Notifications : you choose notification channels when switching to In-alarm, Up or Undertermine states, the system will notify according to this list.
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252FVimHQPGAHJlr9IbNuKIu%252Fimage.png%3Falt%3Dmedia%26token%3Df2b3b69f-4b29-4f84-b588-817bf3ec909b&width=768&dpr=4&quality=100&sign=1dcfdea2&sv=1)
6. Then press the " Create " button to initialize the API test. After creating, you will see the API test is in Undertermine state, until the next inteval the Test API will be updated to the correct state.
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252F9jUoXIOJh4IB98i2Q6Oe%252Fimage.png%3Falt%3Dmedia%26token%3D52b04fca-3e1d-42b8-974e-dddf8fe2fc9d&width=768&dpr=4&quality=100&sign=6ad336a5&sv=1)
API Test has entered the Up state when the hostname is working normally
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252FgUZcGC1CDPmjuySRINHJ%252Fimage.png%3Falt%3Dmedia%26token%3D140c3714-4135-4e7c-affc-9298a31376b7&width=768&dpr=4&quality=100&sign=c77e93a7&sv=1)
Last updated