Recent Discussions
Issues with Set-LMWebsiteGroup
I'm working with the lm-powershell-module and I'm able to get all my website information and the groups id's but when I try to update the group information so I can bulk move websites nothing seems to happen. I have tried many different ways such as: Set-LMWebsiteGroup -Name 'CNVPABACUSS252/Servicing/Loan' -ParentGroupName 'Production/Internal/DevOps/Individual Nodes/Abacus Sync' Set-LMWebsiteGroup -Name $website.name -ParentGroupName 'Production/Internal/DevOps/Individual Nodes/Abacus Sync' -ParentGroupId 77 Set-LMWebsiteGroup -Id 3526 -ParentGroupId 77 I'm sure my syntax is not correct somewhere, but I'm drawing a blank on what it is. Thanks for your help.7Views0likes1CommentESX Host Services?
I'm looking for a way to monitor ESX Host Services. Right now I have a script that I believed to be working but after spot checking a few hosts it seems to not be totally accurate. Or, I just don't fully understand the backend on a host as far as the services go vs the data I am collecting. My datasource is reporting services to be Running on hosts that clearly state certain services to be Stopped. Active Discovery import com.santaba.agent.groovyapi.esx.ESX import com.vmware.vim25.mo.InventoryNavigator def hostname = hostProps.get("system.hostname") def user = hostProps.get("esx.user") def pass = hostProps.get("esx.pass") def custom_url = hostProps.get("esx.url") def display_name = hostProps.get("system.displayname") // Connect to the ESX service def url = custom_url ?: "https://${hostname}/sdk" def svc = new ESX() svc.open(url, user, pass, 10 * 1000) // Timeout in 10 seconds // Get the service instance and root folder def si = svc.getServiceInstance() def rootFolder = si.getRootFolder() // Search for managed entities of type 'HostSystem' def hosts = new InventoryNavigator(rootFolder).searchManagedEntities("HostSystem") // Iterate over each host system hosts.each { host -> // Get the services for the current host def services = host.getConfig().getService() // Iterate over each service services.each { service -> // Get the label and key of each service def labels = service?.service?.label def keys = service?.service?.key def running = service?.service?.running ? "Running" : "Stopped" // If label is an array, print each element on its own line if (labels instanceof List) { labels.eachWithIndex { singleLabel, index -> println "${keys[index]}##${keys[index]}##${singleLabel}" } } else { // If label is not an array, print it normally //println "Service Label: ${labels}, Key: ${keys}, Status: ${running}" } } } // Close the ESX service connection svc.close() Data Collection import com.santaba.agent.groovyapi.esx.ESX import com.vmware.vim25.mo.InventoryNavigator def hostname = hostProps.get("system.hostname") def user = hostProps.get("esx.user") def pass = hostProps.get("esx.pass") def custom_url = hostProps.get("esx.url") def display_name = hostProps.get("system.displayname") // Connect to the ESX service def url = custom_url ?: "https://${hostname}/sdk" def svc = new ESX() svc.open(url, user, pass, 10 * 1000) // Timeout in 10 seconds // Get the service instance and root folder def si = svc.getServiceInstance() def rootFolder = si.getRootFolder() // Search for managed entities of type 'HostSystem' def hosts = new InventoryNavigator(rootFolder).searchManagedEntities("HostSystem") // Iterate over each host system hosts.each { host -> // Get the services for the current host def services = host.getConfig().getService() // Iterate over each service services.each { service -> // Get the label and key of each service def labels = service?.service?.label def keys = service?.service?.key //def running = service?.service?.running ? "Running" : "Stopped" def status = service?.service?.running ? "1" : "0" // If label is an array, print each element on its own line if (labels instanceof List) { labels.eachWithIndex { singleLabel, index -> def wildvalue = "${keys[index]}" //println "Service Label: ${singleLabel}, Key: ${keys[index]}, Status: ${running}" println "${wildvalue}.status=${status}"; } } else { // If label is not an array, print it normally //println "Service Label: ${labels}, Key: ${keys}, Status: ${running}" } } } // Close the ESX service connection svc.close()18Views0likes2CommentsWhat not to do when developing code
FYI, this shows a level of ignorance when it comes to troubleshooting and usability of return codes. if (!organization) { println "Organization ID missing; device property meraki.api.org must be set." return 1 } if (!network) { println "Network ID missing; device property meraki.api.network must be set." return 1 } if (!serial) { println "Serial missing; device property auto.endpoint.serial_number or meraki.serial must be set." return 1 } if (!productType) { println "Serial missing; device property auto.meraki.productype or meraki.productType must be set." return 1 } Each different return statement could have a different non-zero return code (yes, it's an integer!). By returning a different value for each problem, the troubleshooter can identify exactly what the issue is just by looking at the return code. This shows that the developer possibly is laboring under the delusion that a return code can only be 0 or 1. While we're at it, this also evidences a lack of coding performance knowledge: def category = it.category def clientDescription = it.clientDescription def clientId = it.clientId def clientMac = it.clientMac def description = it.description def deviceName = it.deviceName def deviceSerial = it.deviceSerial def eventData = it.eventData.toString() def networkId = it.networkId def occurredAt = it.occurredAt def type = it.type def events = [:] events.put("message", description) events.put("category", category) events.put("clientDescription", clientDescription) events.put("clientId", clientId) events.put("clientMac", clientMac) events.put("description", description) events.put("deviceName", deviceName) events.put("deviceSerial", deviceSerial) events.put("eventData", eventData) events.put("networkId", networkId) events.put("occurredAt", occurredAt) events.put("type", type) There's no point in defining a variable and storing it in memory to only use it once. If you're going to use it twice, it makes sense, but only barely. You're just wasting memory. Instead, do this: def events = [ "message": it.description, "category": it.category, "clientDescription": it.clientDescription, "clientId": it.clientId, "clientMac": it.clientMac, "description": it.description, "deviceName": it.deviceName, "deviceSerial": it.deviceSerial, "eventData": it.eventData.toString(,) "networkId": it.networkId, "occurredAt": it.occurredAt, "type": it.type ]26Views3likes2CommentsREST API 503 errors
Hello everyone We have been using various PowerShell scripts for years and have never had any problems with them. Now, since last week Monday, we are getting random 503 “server is busy” HTTP errors on some GET queries such as Devices, Device DataSources, Dashboards, etc. There is no recognizable pattern to the errors. Does this problem also occur for others using script automation via the REST API (occurs in V2 and V3)? I have submitted a support request to LM, but progress is slow... Have a nice day everyone Dorian77Views0likes12CommentsAnyone else have issues logging into these new forums with Firefox?
Every time I try to log in, I get an error at the bottom of the screen that says: After messing with it, it seems like it really did log me in, it just doesn't look like it logged me in until I refresh the page. Then it will show my username in the corner and everything looks normal. Really annoying though.7Views0likes1CommentWhy are websites missing so many features and treated differently than computers?
Every time I try to do something with websites I just get angry. I can't change settings at the group level like I can with resources. Can't easily change thresholds or anything. The Info tab is blank so I can't see any detail about a website. If I try to use the API, the formatting is all different so I can't get any tree/group information to filter results. Everything just sucks about how websites are different than resources. Why is this? Is there any way to pull a list of all the websites under s certain folder in the tree? I can't find any way to do that. I can't even pull a list of all and then filter by a Group field because it only shows the immediate group and nothing about the higher level groups it's in. I need to check all the sites under a particular top level folder, to make sure the alerting is the same. There appear to be absolutely no way to do this without manually going to each sites and checking it by hand. Thanks.47Views0likes9CommentsTrial Account
I'm not sure what's happening, maybe you're not interested in new customers anymore or what, but I've been trying to set up a Trial for almost a week now with no response from LM whatsoever. I filled out and submitted the form last week, I called your sales several times this week but nobody reached to me and all calls went to the voicemail. This seems bizarre to me that the trial option is locked behind sales but the sales process seems to be completely dysfunctional. Any help here would be greatly appreciated before I completely gave up here and moved on to something else. Thank you!92Views2likes5CommentsContainer-based Collector - DNS issues in 35.001
We have found that our 35.001 collector, based on logicmonitor/collector:latest has a /etc/resolv.conf using Google (8.8.8.8 / 8.8.4.4), as well as a domain setting. This seems to be set at install time, based on the /etc/resolv.conf file timestamps. This prevents intra-cluster DNS lookups. Has anyone else experienced this?Solved12Views0likes1Comment