# Checking Thing Connection via Event Logs

Another very reliable, but more difficult method of checking if SIM card is connected to a network is to check out Thing Event Logs.

There are 2 main ways to check out Thing Event logs:

### Checking Thing Events Logs via self-service console:

1\.       Login to the Monogoto porta&#x6C;***.***

2\.       Go to **Things** section of the porta&#x6C;***.***

![](https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2F9oGvGBkKWZWoG314BEHy%2F1.PNG?alt=media\&token=d482c8e1-f54c-40ac-8aa3-0e249e2628c0)

3\.       Select a Thing from the list of seen Things in the porta&#x6C;***.***

![](https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2Fu8RrDFdeKcVo1WGSGesA%2F2.PNG?alt=media\&token=de1e52c8-616c-4e1b-ae15-592ce793c5fc)

4\.       Use scroll bar, to scroll down to the end of the Thing Menu page.

![](https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FRIJ6ZWW8MXkXgjWkXVIE%2F3.PNG?alt=media\&token=1af91664-41fd-4411-ba3e-cd00d63f5d3b)

5\.       Check Events section of the Thing Menu page.

![](https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FoqoOampehJUozbQIqUnC%2F4.PNG?alt=media\&token=92d2aef7-3e73-45ac-b968-ed6fe1db9400)

6\.       Search in Thing Menu newest events for one of the below provided examples:

| Event Message example                                                                                                                  | Description                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success authenticate\_pdp\_context for Thing ICCID 8912372646888991 MNO= OMNITEL. Session ID =8275846, Allowed Bytes= 20971520         | Event showing successfully open data session                                                                                                                                                                                 |
| Network registration of ICCID 8912372646888991 (123456789101112), MNO: OMNITEL                                                         | <p></p><p>Event showing successful registration to a network</p><p></p>                                                                                                                                                      |
| Success SCP\_INITIAL\_RESULT of Thing Name=ICCID 8912372646888991 IMSI=123456789101112. MNO=OMNITEL. Allowed quota=20971520 bytes.     | Event showing that SIM card has opened a new data session using APIN "uinternet"                                                                                                                                             |
| Success SCP\_UPDATE\_RESULT of Thing Name=ICCID 8912372646888991 IMSI=123456789101112. MNO=OMNITEL. Allowed quota=20971520 bytes.&#xD; | Event showing that SIM card data session using APN "uinternet" got updated to allow more data to be used                                                                                                                     |
| delete\_pdp\_context for Thing=ICCID 8912372646888991, Session ID=8275846, Used bytes=1270086                                          | Event showing that the data session was closed and mentioning used data amount                                                                                                                                               |
| ICCID 8912372646888991 used 1270086 bytes                                                                                              | Event showing how much data SIM card has used                                                                                                                                                                                |
| VLR PURGE\_MS request from 3706111111111                                                                                               | <p>Event showing that SIM card was purged (removed) from the network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>          |
| SGSN PURGE\_MS request from 370611111111                                                                                               | <p>Event showing that SIM card was purged (removed) from the used 2G/3G network. <br><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p> |
| MME PURGE\_MS request from lt-sto1-mme-1.epc.mnc003.mcc246.3gppnetwork.org                                                             | <p>Event showing that SIM card was purged (removed) from the used 4G network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>  |

To see most of the Event Messages and information about them, [please follow this link](https://docs.monogoto.io/guides/thing-menu-events/event-messages).

### Checking Thing Events Logs via an API command:

To view Thing Events logs, please use following request:

```
curl -X POST "https://console.monogoto.io/thing/searchCDR" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer <<<_TOKEN_HERE_>>>" -d "{ \"ThingIdELK\": \"<<<_THING_ICCID_ID_>>>\", \"SeverityELK\": \"<<<_EVENT_SEVERITY_>>>\", \"gteTimestampELK\": \"<<<_GREATER_OR_EQUAL_TIMESTAMP_>>>\", \"ltTimestampELK\": \"<<<_LESS_TIMESTAMP_>>>\", \"EsDataTypeELK\": \"<<<_EVENT_DATA_TYPE_>>>\", \"MessageTypeELK\": \"s<<<_EVENT_MESSAGE_TYPE_>>>\", \"limit\": \"<<<_RESULTS_LIMIT_>>>\"}"
```

{% hint style="info" %}
Please note that the above shown command needs to be replaced with information: \
\&#xNAN;**<<<\_TOKEN\_HERE\_>>>** - replace with your token\
\&#xNAN;**<<<\_THING\_ICCID\_ID\_>>>** - replace with *ThingId\_ICCID\_ABC*, where *ABC* is your thing *ICCID*. Example: *ThingId\_ICCID\_8912372646888991*\
\&#xNAN;**<<<\_EVENT\_SEVERITY\_>>>** - replace with the severity of the Event you wish to be displayed.\
\&#xNAN;**<<<\_GREATER\_OR\_EQUAL\_TIMESTAMP\_>>>** - replace with the timestamp of date/time to show greater or equal date/time Events. Please enter date/time in epoch format with milliseconds. [You may use a converter that can be found following this link.](https://www.epochconverter.com/)\
\&#xNAN;**<<<\_LESS\_TIMESTAMP\_>>>** - replace with the timestamp of date/time to show less than entered date/time Events. Please enter date/time in epoch format with milliseconds. [You may use a converter that can be found following this link.](https://www.epochconverter.com/)\
\&#xNAN;**<<<\_EVEN\_MESSAGE\_TYPE\_>>>** - replace with the Event message type to be displayed. \
\&#xNAN;**<<<\_RESULTS\_LIMIT\_>>>** - replace with how many results you want to be displayed. Default when not using this line is 10 results.
{% endhint %}

{% hint style="warning" %}
Please note that only API command lines **<<<\_TOKEN\_HERE\_>>>** and **<<<\_THING\_ICCID\_ID\_>>>** are mandatory, others can be removed from API command if not needed
{% endhint %}

Example of request that will show last 50 Events for our Thing:

```
curl -X POST "https://console.monogoto.io/thing/searchCDR" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJhb6IkpXVCJ9.eyJSb2xlIjoiVXN4lclByb2ZpbGVJZF9kZGM2MThhNC0wNTI1LTQ2MmUtYWN3NzhhMGQxYmbSI6Im4zgFkbWluIiwiQ3VzdG9tsbCwiVXNlcklkIjoiVklkXzg5Yj5Y2OGEyUtNDQThhLTEzZjA0MzJhZDE3YyINTAzgZmUtZGI51My00ZjRiLTktN2U5Yjc0ZWU1ZThlIiwiaWNzM3MjI5L2MDY3NTE2Mjl9.99aSLzP7kTgK6TZGW-xalrMu0GkW6viunt3XxbNng" -d "{ \"ThingIdELK\": \"ThingId_ICCID_8912372646888991\", \"limit\": \"50\"}"
```

Expected result will show 50 last Events for our Thing:

```
{
  "totalResults": 151,
  "hits": [
    {
      "_source": {
        "EsDataType": "GGSN_AUTHENTICATE_PDP_CONTENT_RESULT",
        "Severity": "Info",
        "message": "Success authenticate_pdp_context for Thing ICCID 8912372646888991 MNO= UAB TELE2. Session ID =8993090, Allowed Bytes= 20971520",
        "Timestamp": 1609154365332,
        "MessageType": "EVENT"
      }
    },
    {
      "_source": {
        "EsDataType": "GGSN_AUTHENTICATE_PDP_CONTENT",
        "Severity": "Info",
        "message": "authenticate_pdp_context v2 for Thing=ICCID 8912372646888991 from SGSN 10.99.5.34 RAI=null . Allowed Bytes = 20971520",
        "Timestamp": 1609154365331,
        "MessageType": "EVENT"
      }
    },
    {
      "_source": {
        "EsDataType": "GGSN_DELETE_PDP_CONTENT",
        "Severity": "Info",
        "message": "delete_pdp_context for Thing=ICCID 8912372646888991, Session ID=8986961, Used bytes=18464019",
        "Timestamp": 1609154364198,
        "MessageType": "EVENT"
      }
      
      
      ...
```

Search in Thing Menu newest events for one of the below provided examples:

| Event Message example                                                                                                                     | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success authenticate\_pdp\_context for Thing ICCID 8997211240710951969 MNO= OMNITEL. Session ID =8275846, Allowed Bytes= 20971520         | Event showing successfully open data session                                                                                                                                                                                 |
| Network registration of ICCID 8997211240710951969 (240075817195196), MNO: OMNITEL                                                         | <p></p><p>Event showing successful registration to a network</p><p></p>                                                                                                                                                      |
| Success SCP\_INITIAL\_RESULT of Thing Name=ICCID 8997211101234564532 IMSI=425019700000453. MNO=OMNITEL. Allowed quota=20971520 bytes.     | Event showing that SIM card has opened a new data session using APIN "uinternet"                                                                                                                                             |
| Success SCP\_UPDATE\_RESULT of Thing Name=ICCID 8997211101234564532 IMSI=425019700000453. MNO=OMNITEL. Allowed quota=20971520 bytes.&#xD; | Event showing that SIM card data session using APN "uinternet" got updated to allow more data to be used                                                                                                                     |
| delete\_pdp\_context for Thing=ICCID 8912372646888991, Session ID=8275846, Used bytes=1270086                                             | Event showing that the data session was closed and mentioning used data amount                                                                                                                                               |
| ICCID 8912372646888991 used 1270086 bytes                                                                                                 | Event showing how much data SIM card has used                                                                                                                                                                                |
| VLR PURGE\_MS request from 37068499200                                                                                                    | <p>Event showing that SIM card was purged (removed) from the network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>          |
| SGSN PURGE\_MS request from 37068499200                                                                                                   | <p>Event showing that SIM card was purged (removed) from the used 2G/3G network. <br><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p> |
| MME PURGE\_MS request from lt-sto1-mme-1.epc.mnc003.mcc246.3gppnetwork.org                                                                | <p>Event showing that SIM card was purged (removed) from the used 4G network.</p><p><strong>To get the SIM card reconnected to the network, please restart the device or remove/reinsert the Monogoto SIM card</strong></p>  |

To see most of the Event Messages and information about them, [please follow this link](https://docs.monogoto.io/guides/thing-menu-events/event-messages).
