Forum Discussion

Todd_Theoret's avatar
Todd_Theoret
Icon for Neophyte rankNeophyte
8 years ago

REST API - "No Data"

Anyone know how to pull a list of ALL devices (1000s) with instances reporting "No Data" via the REST API?

Thanks as always!

  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    Hi Todd,

    There isn't an easy way to pull devices with instances reporting "No Data" (in the UI or via API) -  you can do it based on alerts if alerting is set up for No Data, or the long way by iterating through current data for instances, but there's no great solution right now.  It has come up before, so we are exploring what a better solution would look like.  Are you just looking to flag devices that aren't reporting data for possible misconfigurations (on LM or device side)?  Any additional context you can provide will help us come up with the best possible solution.

    Thanks,

    Sarah

  • Exactly what we are trying to accomplish...we are dealing with close to 5K devices and need to know quickly if devices which were working are now reporting "No Data"

    Thank you!

  • There are ways to set this via an alert. We use a complex formula to determine if a device stopped reporting data:
    if(un(CPUUsage),if(un(CPUUsage1),if(un(MemoryActive),if(un(DataRateRx),1,0),0),0),0)

    Using this will give us the ability to create an alert, this would then give you the ability to pull alerts from the API and tell you what devices are no longer reporting data properly (or an alert report via the reports section). We just set this as a warn for visibility. 

  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    Thanks for sharing, Tom!  Hopefully we can make it a bit easier to get this information in app / via API moving forwards :)/emoticons/smile@2x.png 2x" title=":)" width="20">

  • On 7/24/2017 at 8:50 AM, Tom Lasswell said:

    There are ways to set this via an alert. We use a complex formula to determine if a device stopped reporting data:
    if(un(CPUUsage),if(un(CPUUsage1),if(un(MemoryActive),if(un(DataRateRx),1,0),0),0),0)

    Using this will give us the ability to create an alert, this would then give you the ability to pull alerts from the API and tell you what devices are no longer reporting data properly (or an alert report via the reports section). We just set this as a warn for visibility. 

    Thank you Tom (as always)

    Also, just fyi....I came across another post [Using PropertySources for Reporting] by Billy Yuliadi, which presented an additional option. I just shared the PropertySource M44C23.  Thank you Billy!

  • On 7/27/2017 at 1:28 PM, Todd Theoret said:

    Thank you Tom (as always)

    Also, just fyi....I came across another post [Using PropertySources for Reporting] by Billy Yuliadi, which presented an additional option. I just shared the PropertySource M44C23.  Thank you Billy!

     

    that's a great idea too, Good find. you can then create a new group for it too. Also was looking into using instance properties for alerts (for something different), store the property source as a number (or do a match w/ groovy) and a complex groovy datapoint and you could create an alert on it as well. 

    https://www.logicmonitor.com/support/datasources/creating-managing-datasources/creating-complex-datapoints-with-groovy/

    scroll to the bottom of that post.