Forum Discussion

Vitor_Santos's avatar
5 years ago

API not working properly?

Hello guys,

I've raised a case with LM support already but I want to share this with the community (to make sure you guys experience this as well or no).

We've created a simple Python script (about 4/5 months ago) that checks on a specific device (using its ID) & look for the presence of a certain DataSource (in this specific scenario 'snmp64_If-').

 

  • I believe I found the solution.
    I'm pretty sure something changed at the API level b/c the stated query was working before.

    However, instead of using the 'dataSourceId' property I tried with the 'id' instead [seems a local ID at the device instead of the 'General' one].
    It worked properly!

    Thanks anyway!

    Regards,

  • 20 minutes ago, Vitor Santos said:

    Hello guys,

    I've raised a case with LM support already but I want to share this with the community (to make sure you guys experience this as well or no).

    We've created a simple Python script (about 4/5 months ago) that checks on a specific device (using its ID) & look for the presence of a certain DataSource (in this specific scenario 'snmp64_If-').

     


    [EDITING MY QUESTION]

    Hello to everyone,

    I've raised a case with LM support already but I want to share this with the community (to make sure if you guys experience this as well or no).

    We've created a simple Python script (about 4/5 months ago) that checks on a specific device (using its ID) & look for the presence of a certain DataSource (in this specific scenario 'snmp64_If-').
    The objective is to identify the datasource presence & further enable alarming on a couple of instances (that we identify) - This has been working properly for us in the past 4 months

    However, I noticed that we started retrieving errors while doing this (on 05/29/2020).
    Basically if I query the device for its datasources it returns a proper response & I can confirm that the datasource we want is there (ID: 352)

    Params I'm using:

    resourcePath = '/device/devices/6496/devicedatasources'
    queryParams = '?size=1000&filter=instanceNumber>0'

    JSON reponse (only including the wanted DataSource portion):

    {'id': 323940, 'deviceId': 6496, 'dataSourceId': 352, 'dataSourceName': 'snmp64_If-', 'dataSourceDescription': 'Monitors interface performance statistics for 64-bit interfaces.', 'dataSourceDisplayName': 'Interfaces (64 bit)-', 'graphs': [{'id': 7322, 'name': 'Drops / Errors', 'title': 'Drops / Errors', 'displayPrio': 6}, {'id': 7323, 'name': 'Interface Utilization', 'title': 'Interface Utilization', 'displayPrio': 3}, {'id': 7324, 'name': 'Operating Status', 'title': 'Operating Status', 'displayPrio': 7}, {'id': 7325, 'name': 'Packet Transmission', 'title': 'Packet Transmission', 'displayPrio': 5}, {'id': 7326, 'name': 'Throughput', 'title': 'Throughput', 'displayPrio': 1}], 'overviewGraphs': [{'id': 2312, 'name': 'Top 10 Interfaces by Egress Throughput', 'title': 'Top 10 Interfaces by Egress Throughput', 'displayPrio': 1}, {'id': 2313, 'name': 'Top 10 Interfaces by Ingress Throughput', 'title': 'Top 10 Interfaces by Ingress Throughput', 'displayPrio': 1}, {'id': 2314, 'name': 'Top 10 Interfaces by Total Packets', 'title': 'Top 10 Interfaces by Total Packets', 'displayPrio': 2}], 'groupName': '', 'deviceName': '172.16.30.250', 'deviceDisplayName': 'Sonicwall
    Bethlehem', 'monitoringInstanceNumber': 3, 'instanceNumber': 3, 'instanceAutoGroupEnabled': False, 'groupsDisabledThisSource': None, 'status': 0, 'createdOn': 1590776721, 'updatedOn': 1590967798, 'assignedOn': 1590967796, 'nextAutoDiscoveryOn': 1591054136, 'autoDiscovery': True, 'isMultiple': True, 'alertStatus': 'none', 'alertStatusPriority': 100000, 'sdtStatus': 'none-none-none', 'alertDisableStatus': 'none-none-none', 'stopMonitoring': False, 'alertingDisabledOn': None, 'sdtAt': '', 'dataSourceType': 'DS', 'collectMethod': 'snmp'}

    I can see that the dataSourceId is '352'.

    If I try to query the datasource instances:

    resourcePath = '/device/devices/6496/devicedatasources/352/instances/'
    queryParams = ''

    It's returning the error below:

    {'data': None, 'errmsg': 'DeviceDataSource(352) is not found for device(id=6496)', 'status': 1069}

    This started to occur last Friday (05/29). It was working just fine on 05/28 (since I've ran the same exact query with success).
    Are you guys aware of any change in the API structure?
     
    Thank you!
     
    Regards,
  • I believe I found the solution.
    I'm pretty sure something changed at the API level b/c the stated query was working before.

    However, instead of using the 'dataSourceId' property I tried with the 'id' instead [seems a local ID at the device instead of the 'General' one].
    It worked properly!

    Thanks anyway!

    Regards,