ContributionsMost RecentMost LikesSolutionsRe: Resource Tree Deprecation? Thanks Mike!!! Resource Tree Deprecation? I missed the latest the recent virtual Roadmap Roadshow. When reviewing the summary notes from the session, I noticed the following statement regarding the resource tree. Resource Explorer: Say goodbye to the traditional resource tree! Our new Resource Explorer is designed for modern environments like Cloud and Kubernetes. It leverages metadata and tagging to help you quickly find and visualize resources. I don't see how resource explorer can provide feature parity when it comes to filtering, setting custom/inherited properties, grouping devices, API query refinement etc. If we lose this functionality, the product loses half it's value. Is there anyone in the community that sat in for this session that can provide some more context? SolvedRe: Performance averages over time Managed to get back to looking at this today. It's an ugly first pass with no debugging or error checking but it appears to validate the approach (I imported more modules that needed :-)). The output lets me set a datapoint for CPU hourly average, I can then present in a dynamic table widget & pull all associated device's avg CPU data in one API call via the /dashboard/widgets/{widgetId}/data endpoint. /***************************************************************************************/ import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.security.MessageDigest import org.apache.commons.codec.binary.Hex; import com.santaba.agent.groovyapi.http.*; import groovy.json.JsonSlurper; import groovy.json.JsonOutput; // Import relevant properties from the device. accessId = hostProps.get("lmaccess.id") accessKey = hostProps.get("lmaccess.key") account = hostProps.get("lmaccount") hostname = hostProps.get("system.hostname") deviceId = '##SYSTEM.DEVICEID##' dataSourceFilter = 3002393 // Set request target and paramaters to get Device Instances resourcePath = '/device/devices/' + deviceId + '/instances' queryParameters = '?filter=dataSourceId:' + dataSourceFilter url = 'https://' + account + '.logicmonitor.com' + '/santaba/rest' + resourcePath + queryParameters; // Make HTTP request HTTP_Request('GET',url,resourcePath) def instanceResult(responseBody){ json_slurper = new JsonSlurper() body = json_slurper.parseText(responseBody) return body } def deviceDataSourceId = (instanceResult(responseBody).items.deviceDataSourceId.flatten().first()) resourcePath = '/device/devices/' + deviceId + '/devicedatasources/' + deviceDataSourceId + '/data' queryParameters = '?aggregate=average&datapoints=CPUBusyPercent' url = 'https://' + account + '.logicmonitor.com' + '/santaba/rest' + resourcePath + queryParameters // Make HTTP request HTTP_Request('GET',url,resourcePath) def result(responseBody){ json_slurper = new JsonSlurper() body = json_slurper.parseText(responseBody) return body } def dataPointsRaw = result(responseBody).dataPoints def valuesRaw = result(responseBody).instances.Microsoft_Windows_CPU.values def timeRaw = result(responseBody).instances.Microsoft_Windows_CPU.time //Cleaned payload objects def dataPoints = (dataPointsRaw.flatten().first()) def values = (valuesRaw.flatten().first()) def time = (timeRaw.flatten().first()) println("dataPoints=${dataPoints}") println("values=${values}") println("time=${time}") return(0) //Auth and Rest Helpers // Get current time def Find_Epoch(){ epoch = System.currentTimeMillis() return epoch } // Calculate signature def Generate_Signature(verb,resourcePath,data=null){ if(verb == "GET"){ requestVars = verb + Find_Epoch() + resourcePath } else{ requestVars = verb + Find_Epoch() + data + resourcePath } hmac = Mac.getInstance("HmacSHA256"); secret = new SecretKeySpec(accessKey.getBytes(), "HmacSHA256") hmac.init(secret); hmac_signed = Hex.encodeHexString(hmac.doFinal(requestVars.getBytes())) signature = hmac_signed.bytes.encodeBase64() return signature } // Build HTTP request. def HTTP_Request(verb,url,resourcePath,data=''){ CloseableHttpClient httpclient = HttpClients.createDefault() switch(verb){ case 'GET': httpReq = new HttpGet(url); break; } httpReq.addHeader("Authorization" , "LMv1 " + accessId + ":" + Generate_Signature(verb,resourcePath) + ":" + Find_Epoch()) httpReq.addHeader("X-Version" , "3") response = httpclient.execute(httpReq) responseBody = EntityUtils.toString(response.getEntity()) httpclient.close() return responseBody } Re: Performance averages over time Thanks Stuart, I kind of came to the same conclusion last night. I've been looking at some of the awesome PS module functions shared by Steve_Villardi . I think I'll try & re-using some of Steve's functions, combined with script cache. This should allow me to set an average usage value datapoint for each metric per device hourly, which I can then add to a dynamic table widget & pull via the widget/data endpoint. Performance averages over time Hi, I’m currently looking for a way to get averages on certain data points & make that data via the API e.g. Average CPU busy per hour, per device. I've played around with the following approaches but none of them are really what I'm after: Looping through datasources, getting devices & looping through instances via “/device/devices/{deviceId}/devicedatasources/{hdsId}/instances/{id}/data”. This approach is too cumbersome for the number of devices we have, combined with the other averages we want to pull. Creating a graph widget & getting the data via the /dashboard/widgets/{widgetId}/data endpoint. This would work if there wasn't a maximum of 100 devices in the widget & deviceIds were clearly linked the graph data. Generating a trend report & grabbing the link via /report/links/{reportId}. I haven't written this approach off yet but the available formats & the expiry on the generated link isn't ideal. Dynamic table data is great via the /dashboard/widgets/{widgetId}/data endpoint but I cannot work out a way create a datapoint that has an hourly average value. I'm not sure if it's possible to do something like grab the last x records for a datasource/datapoint on a device & present them in a different datasource/datapoint that could be used in a table widget or to set a custom property value on the device? Capacity/performance reporting via a 3rd party data warehouse Hi Community, I’m hoping someone can provide some guidance on the best method or REST endpoint to pull granular performance/consumption data from? I’m asking as we’re looking to bring metrics like CPU, memory usage, uptime & storage consumption into our data warehouse. The best LM V3 REST endpoint I can find so far is “/device/devices/{deviceId}/devicedatasources/{hdsId}/instances/{id}/data”. Thanks
Top ContributionsCapacity/performance reporting via a 3rd party data warehouseRe: Performance averages over timePerformance averages over timeRe: Resource Tree Deprecation?Resource Tree Deprecation?SolvedRe: Performance averages over time