Forum Discussion

Will_Holland's avatar
2 years ago

LogicMonitor API Datasource Not Showing

Since my previous issue a href="https://communities.logicmonitor.com/topic/7818-logicmonitor-api-datasource-shows-no-instances-but-returns-data/#comment-88158" rel="">here, I have been given access to the "/setting/datasources" resource and have been digging around inside API V2. 

I am able to grab all datasources and subsequently their devices, and I see the device I want to grab data from. This device is shown in both responses by using "/setting/datasources/{id}/devices" and "/device/devices/{device_id}". The device that is listed in both have the same id as well.

There are oddities within the datasources I'm able to access (it's not a permission issue). I know this device is using the WinCPU datasource and I can see it is using it by calling the "/setting/datasource/{id}/devices" for the WinCPU id, but when using the "/device/devices/{device_id}/devicedatasources" resource, the WinCPU datasource does not show up and I cannot make the "/device/devices/{device_id}/devicedatasources/{id}/data" resource fetch the data that is clearly shown in the dashboard view in the browser. 

Why would this device act weird like this? I can see that it is using the WinCPU datasource under the resources tab in the browser, but I can't fetch any data from it. Is there any reason why WinCPU wouldn't be listed when using the "/device/devices/{device_id}/devicedatasources" resource through the API?

Thanks

3 Replies

  • 26 minutes ago, Will Holland said:

    Since my previous issue a href="https://communities.logicmonitor.com/topic/7818-logicmonitor-api-datasource-shows-no-instances-but-returns-data/#comment-88158" rel="">here, I have been given access to the "/setting/datasources" resource and have been digging around inside API V2. 

    I am able to grab all datasources and subsequently their devices, and I see the device I want to grab data from. This device is shown in both responses by using "/setting/datasources/{id}/devices" and "/device/devices/{device_id}". The device that is listed in both have the same id as well.

    There are oddities within the datasources I'm able to access (it's not a permission issue). I know this device is using the WinCPU datasource and I can see it is using it by calling the "/setting/datasource/{id}/devices" for the WinCPU id, but when using the "/device/devices/{device_id}/devicedatasources" resource, the WinCPU datasource does not show up and I cannot make the "/device/devices/{device_id}/devicedatasources/{id}/data" resource fetch the data that is clearly shown in the dashboard view in the browser. 

    Why would this device act weird like this? I can see that it is using the WinCPU datasource under the resources tab in the browser, but I can't fetch any data from it. Is there any reason why WinCPU wouldn't be listed when using the "/device/devices/{device_id}/devicedatasources" resource through the API?

    Thanks

     

    I just ran a debug call on one of our portals and definitely see the CPU datasource.  They did replace it with a new one (below), so perhaps yours also has the new one?

       62  HASH(0x56202b1e0638)
          'dataSourceName' => 'Microsoft_Windows_CPU'
          'id' => 779406
          'instanceNumber' => 1

    Mark

  • 22 hours ago, mnagel said:

      62  HASH(0x56202b1e0638)
          'dataSourceName' => 'Microsoft_Windows_CPU'
          'id' => 779406
          'instanceNumber' => 1

    Looking at the "/setting/datasources", I don't have the same datasource listed at id = 62 and Microsoft_Windows_CPU is not listed in the datasources section of logicmodules. Is this Microsoft_Windows_CPU a drop-in replacement that will build on top of existing WinCPU data?

  • 1 hour ago, Will Holland said:

    Looking at the "/setting/datasources", I don't have the same datasource listed at id = 62 and Microsoft_Windows_CPU is not listed in the datasources section of logicmodules. Is this Microsoft_Windows_CPU a drop-in replacement that will build on top of existing WinCPU data?

    Well sure, mine was from one of our devices -- IDs will not match.  Main point was I dumped the results of /device/devices/$device->{id}/devicedatasources for a Windows server and it did include the CPU datasource info.  It could be the old WinCPU or this new one, but either way both datasources with and without multiple instances should be included in the result.