Recent Discussions
Add Cloud Account (AWS) from API
Greetings all, I thought someone would have asked this, but unable to find anything via search Is there an API path that can be used to add a AWS Cloud account? I currently can fully spin up a new AWS account, provision collectors etc, but I can't seem to find a way to add the AWS account and populate the created IAM Role into LogicMonitor.Unless I'm missing something in the swagger/docs. Anyone know if this is supported? Thanks!Solved6Views0likes1CommentSmoothing Datapoints
We have datapoints that are very spiky by nature. In order to see the signal through the noise so to speak we need to average like 10 datapoints together... effectively smoothing the data. For example if we took 1 minute polls of CPU Processor Queue or CPU ready we would want to plot the average of the past 10 datapoints. If anyone has suggestions on how to do this or how they approach datasets that are inherently to noisy for threshold based alerting I would love to hear about it.Solved11Views0likes4CommentsMonitoring Logoff/Logon Events for Anomalies
Background - We have a fairly large citrix environment(70 customers, 1200 users). Each customer has 1 or more xenapp servers depending on how many users. The environment is setup in a manner that often times the first step in troubleshooting is having the users logon/log off(which obviously creates an event id). We would like to plot the number of logon/logoffs(via event ids)per every 10 minute period and look for anomalies(periods of high logons/logoffs relative to normal or relative to number of users in environment). First step for us is simply plotting the data. Any ideas ideas on the best way to approach this problem. My initial thought is simply to write a powershell script to search for the eventids over the 10 minutes and return the number...then apply this to each xenapp server in logicmonitorbut maybe there is a better approach? I also don't know the best approach to aggregate by customer or evenfactor in the number of users...assuming we would need to export to excel to handle some of that. Ideas welcomed.Solved6Views0likes5CommentsAccess Raw Data via API
Hey I'm wanting to access the ping data of a device. I've not found an example in the v1 API document that shows how to do this. I've tried the below but haven't found what I expect, i.e. a long list of ping + time + result. $resourcePath = '/device/devices/465103/devicedatasources/376/data' $epochseconds = Get-Date (Get-Date).ToUniversalTime() -UFormat %s $fields = '?start=' + $epochseconds $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath + $fields ThanksSolved6Views0likes5CommentsAWS_ClassicELB_ServiceLimits -- ListenerLimit & ListenerUsage
AWS lists that the Listener limit is on a per ELB basis. TheAWS_ClassicELB_ServiceLimits datasource seems to intimate that the ListenerUsage is returning the total number of listeners for the given region. Is this useful information to capture on a regional basis or should this be refactored to apply to each classic ELB?Solved4Views0likes1CommentGroovy Expect Scripting -- "]$" prompts
Most of the Linux environments I work with are RHEL or CentOS and our prompts look like: [username@hostname ~]$ I can't seem to find a prompt pattern that works for both the closing square bracketand the dollar sign when writing a script using thecom.santaba.agent.groovyapi.expect.Expectpackage. No amount of escaping seems to work like '\\]\\$' or ']\\$'. I do need the multi-character prompt because the output I want to parse will include errant $, but not ]$. Multi-character prompts are generally not a problem because I often have to expect a sudo password prompt using a 'username:' pattern and this works without issue. Any ideas on how to tackle this?SolvedJoe_Tran6 years agoAdvisor8Views0likes1CommentIssues With Creating A Datasource
I took a working groovy script datasource and am now trying to adjust it to some needs we have. This data will end up giving us alert totals for each month so we can build reports. Any ideas? Here is what I have so far. import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Hex; import groovy.json.JsonSlurper; //define credentials and url def accessId = hostProps.get('lmaccess.id'); def accessKey = hostProps.get('lmaccess.key'); def account = hostProps.get('lmaccount'); def alertgroup = hostProps.get('lmaccess.group'); def collectionFailures = 0 def failures = [:] def client = new LogicMonitorRestClient(accessId, accessKey, account, this.&println) try { def alerts = client.get("/device/groups/" + alertgroup + "/alerts", fields: "severity", filter: "startEpoch>:1538370000,endEpoch<:1541048399,cleared:*") //warnings = alerts.findAll {it.severity == 2}.size() println "WarningCount: ${alerts.findAll {it.severity == 2}.size()}" println "ErrorCount: ${alerts.findAll { it.severity == 3 }.size()}" println "CriticalCount: ${alerts.findAll { it.severity == 4 }.size()}" println "TotalAlerts: ${alerts.size()}" } catch (Throwable e) { failures["alerts"] = e.toString() collectionFailures += 1 } // Do error reporting println "CollectionFailures:${collectionFailures}" failures.each{ query, exception -> println "Exception while querying $query:" println exception } return 0 ////////////////////// // HELPER FUNCTIONS // ////////////////////// class LogicMonitorRestClient { String userKey String userId String account int maxPages = 20 int itemsPerPage = 1000 def println LogicMonitorRestClient(userId, userKey, account, printFunction) { this.userId = userId this.userKey = userKey this.account = account this.println = printFunction } def generateHeaders(verb, path) { def headers = [:] def epoch = System.currentTimeMillis() def requestVars = verb + epoch + path // Calculate signature def hmac = Mac.getInstance('HmacSHA256') def secret = new SecretKeySpec(userKey.getBytes(), 'HmacSHA256') hmac.init(secret) // Sign the request def hmac_signed = Hex.encodeHexString(hmac.doFinal(requestVars.getBytes())) def signature = hmac_signed.bytes.encodeBase64() headers["Authorization"] = "LMv1 " + userId + ":" + signature + ":" + epoch headers["Content-Type"] = "application/json" return headers } def packParams(params) { def pairs = [] params.each{ k, v -> pairs << ("${k}=${v}")} return pairs.join("&") } // Non paginating, raw version of the get function def _rawGet(path, params) { def baseUrl = 'https://' + account + '.logicmonitor.com' + '/santaba/rest' + path def packedParams = "" if(params) { packedParams = "?"+packParams(params) } def query = baseUrl+packedParams def url = query.toURL() def response = url.getText(useCaches: true, allowUserInteraction: false, requestProperties: generateHeaders("GET", path)) return response } // Public interface for getting stuff. def get(Map args=[:], path) { def itemsReceived = [] def pageReads = 0 // Impose our own paging parameters. args.size = itemsPerPage args.offset = 0 while(true) { // Do da nastieh def response = new JsonSlurper().parseText(_rawGet(path, args)) if (response.errmsg == "OK") { // Catch individual items if (response.data.items == null) { return response.data } itemsReceived += response.data.items // Check if there are more items // if (response.data.total > itemsReceived.size()) // { args.offset = args.size + args.offset // } // else // { // break // we are done // } } else { // Throw an exception with whatever error message we got. throw new Exception(response.errmsg) } pageReads += 1 // Check that we don't exceed max pages. if (pageReads >= maxPages) { break } if (response.data.total > 0) { break } } return itemsReceived } } If I run the URL with the API creds in my test powershell script, it works perfectly. When I test it in LM as a datasource, I get the attached error. Quote Exception while querying alerts: java.io.IOException: Server returned HTTP response code: 400 for URL https://XXX.logicmonitor.com/santaba/rest/device/groups/224/alerts?fields=severity&filter=startEpoch>:1538370000,endEpoch<:1541048399,cleared:*Solved11Views0likes5CommentsAdd device to Collector with least devices in rest api
I hope someone here can help, Using powershell and the rest API I would like to do a lookup of selected collectors find which has the least amount of devices on it then add the a new device. I have the script for adding the device and that works greatjust need the collector lookup, has anyone done something similar. Thank you in advanced for all help provided PaulSolved31Views0likes49CommentsHow to find Average value of a metric/field for a particular time range
Hi, I am trying to collect the average/max value of a field or metric only for a particular time range which we choose. I am unaware through which kind of Widget I can show the average/max value of a particular time period as a single value. I tried using Gauge & Big Number Widget to show my single average value for a specific time period. But theproblems are as follows: 1. Big Number Widget - will show only the single value but it does not have any type of aggregation function (Min, max, avg) 2. Gauge widget - Contains Aggregation function to select. But not sure whether it is aggregating the field values according to the time range we select. Because everytime when the Dashboard/Widget is refreshed according to the Refresh Frequency, it is showing different values. For example, if I select the time range from March 1st to March 31st, then aggregatevalues should be same as it is not the real-time occurence. I tried with Graph Widget (refer the attached screenshot Avg_metric_CPU), it is providing me the proper values of that time. But I need the data to be shown as single average value, monthly-wise. Could anyone please help me on this.Solved20Views0likes5CommentsTuning a collector to work on a t2.micro EC2 instance?
I know that it is not exactly recommended/reliable to use a 1GB/1CPU Core machine to monitor...but it seems that installing a "nano" sized collector on a t2.micro AWS instance and having it just monitoritself brings the AWS instance to a screeching halt. I am seeing that when the collector is running, top shows that CPU pegs to 100% almost nonstop. Memory is not hit quite as bad..but it does get up there to use 500mb+ But the CPU load average is 5+ cores and it makes the systemunusable. Sometimes this causes the instance to throwstatus alerts & even crash. Question: Has anybodybeen able to tweak the wrapper.conf etc files to make the collector CPU load less demanding?Solved5Views1like1Comment