ContributionsMost RecentMost LikesSolutionsRe: Logic.Monitor (PowerShell) module Thanks for creating this. We’ve been using it for a while and ran into a strange issue with authentication on Linux. It works perfectly when we run from a Windows machine, but if we run from a Linux machine (pwsh), we get authentication errors even though the credentials aren’t changed. I’m not sure if this is generally an issue with Linux PowerShell or specific to the module, but thought I’d mention in case it was perhaps a known issue. Here is the type of error we see (the error shows on the LM logs too…but again, the auth credentials are unchanged from what works when the same script is run from a Windows box): Out-PsLogging: [ERROR] 2024-03-02T17:47:29: Unexpected error getting device groups. To prevent errors, Get-LogicMonitorDeviceGroup will exit. If present, the following details were returned: Error message: Authentication failed Error code: 1401 Invoke-Request: Response status code does not indicate success: 401 (). Headers: Name Value ---- ----- X-Version 3 Content-Type application/json Authorization LMv1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx… Body: Need a property for LogicMonitor license consumed We need a way to be able to confirm what type of LogicMonitor license is being consumed by a given Resource or Website. Ideally there would be a system.license or similar property we can look at to be sure of the license type being counted for that resource. This would allow proper audit and chargeback to customers who are using the service as well as a way to validate total billing on our account. There must be some way you are counting these in order to bill us, so if this can be exposed as a property it would be helpful. Re: Basic Freshdesk Integration @Chris Seiber - It looks like this is actually working despite the above now. I think the problem was I had some additional attributes set for Freshdesk that despite being supported by the API didn't seem to go through (which caused the entire update to fail). So I think I'm good now on this but do still think the HTML formatting I mentioned may be helpful to others. Re: Basic Freshdesk Integration I've also just done a test to create a new escalation chain with only the ticket update integration on it, but no improvement. I get this for ##EXTERNALTICKETID##: Freshdesk - Create and Update Tickets : 20024 I will report back if I find anything new. Re: Basic Freshdesk Integration Correction on the above - I do see that "id" can also work but results in the same thing. I was just going off of what I was aware of as "proper" path syntax... but in any case, it still seems to work that way. So, again, the main issue now seems to be the extra text added to the ##EXTERNALTICKETID## property which has nothing to do with the JSON response AFAIK. Re: Basic Freshdesk Integration @Chris Seiber thanks for posting this. I have found a couple of things when setting this up and thought I'd share (and ask for feedback): 1. To properly format the message in the ticket you need to use HTML. In other words you need to use <br> instead of \n for a line break. 2. The JSON path you have doesn't seem valid. I was able to use $.id to get the ticket ID... however there is an issue with that (see below). When I get the ##EXTERNALTICKETID## it is coming back like this: Slack Integration : -1, Freshdesk - Create and Update Tickets : 20018 Where the first part before the colon are the display names of all integrations used on the alert (note the first one is for Slack and the second is for Freshdesk). If I only had the Freshdesk integration configured, it would likely say "Freshdesk - Create and Update Tickets". The part after the colon is the actual ticket number. Do you have any thoughts on how to strip off the first part? I know you support regular expressions but then that doesn't seem to be usable at teh same time as JSON for the ##EXTERNALTICKETID## mapping. Is this a bug in your software that is including this in the property to begin with given I don't see how we could possibly get those values (the integration labels) from the JSON response itself (I don't see them when I do a test). Rasberry Pi Collector Any thoughts on making it possible to install a collector on a Raspberry Pi device? Has this been tested/tried since this feature request 4 years ago? /topic/164-collector-on-arm-raspberry-pi-the-35-computer/ Re: LogicMonitor PowerShell module Minor update - we found it was better to only do this for EC2 since for other devices it made it a bit harder to find things. I've updated the script above with the following on the third line (right after the $aws= line): $ec2=$aws | Select-Object | where {$_.systemProperties.value -eq "AWS/EC2"} Then update the foreach loop to use $ec2 instead of $aws and you will only update EC2 devices. Sync AWS display names I’m not sure if your product group has this on their radar, but for AWS in particular it would be very useful to have a “keep display name in sync with AWS name tag” checkbox that is selected for AWS sync since it is possible for AWS names to get changed and no longer match what’s in LM. Azure doesn’t seem to have this problem (I don’t think Google would have this issue either). In order to deal with this, I ended up writing this script (which can be scheduled), but hopefully it can just be added to the product: a href="https://communities.logicmonitor.com/topic/1525-logicmonitor-powershell-module/?tab=comments#comment-4385" rel="">https://communities.logicmonitor.com/topic/1525-logicmonitor-powershell-module/?tab=comments#comment-4385 Re: LogicMonitor PowerShell module I was able to get this figured out and used the following to update the LM display names with the AWS system tag and only when the AWS tag is present. I could use a way to better handle errors when LM finds a duplicate or when there are invalid characters in the tag, but it does the job: #Get AWS devices with name tag set (not null) $aws=Get-LogicMonitorDevices -AccessId $lmid -AccessKey $lmkey -AccountName $lmacct | select id,displayName,systemProperties | where {$_.systemProperties -like "*system.aws.tag.name*"} #Build list of devices including ID, LM Display Name, and AWS Tag Name $list = @() foreach ($device in $aws) { $item = New-Object psobject $item | Add-Member -type NoteProperty -Name 'id' -Value $device.id $item | Add-Member -type NoteProperty -Name 'displayName' -Value $device.displayName $item | Add-Member -type NoteProperty -Name 'awsTag' -Value (Get-LogicMonitorDeviceProperties -AccessId $lmid -AccessKey $lmkey -AccountName $lmacct -DeviceId $device.id | select name,value | where {($_.name -eq "system.aws.tag.Name")} | select value) $list += $item } #Create list of objects to update where the display name does not currently equal the AWS tag name. $update=$list|where{$_.displayName-ne$_.awsTag.value} #Process Update foreach ($item in $update) {Update-LogicMonitorDeviceProperties-AccessId$lmid-AccessKey$lmkey-AccountName$lmacct-DeviceId$item.id-PropertyNamesdisplayName-PropertyValues$item.awsTag.value}
Top ContributionsNeed a property for LogicMonitor license consumedRe: Basic Freshdesk IntegrationRasberry Pi CollectorSync AWS display namesRename WarningsRe: LogicMonitor PowerShell moduleRe: LogicMonitor PowerShell moduleRe: LogicMonitor PowerShell moduleRe: LogicMonitor PowerShell moduleRe: LogicMonitor PowerShell module