Vinusha

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Vinusha

  • Rank
    Community Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. When we are downloading the collector file using https://www.logicmonitor.com/support/rest-api-developers-guide/collectors/downloading-a-collector-installer/ rest API we're getting corrupted file for few of our products, which is not consistent. We're getting this issue for random products and today we're not able to reproduce the issue for the same products. I would like to know in which scenarios we'll be able to reproduce the issue or is there an issue with API. Any quick update or heads up will be a great help!! Below is the powershell code we're using to download collector file. function downloadCollector { param( [parameter(mandatory = $true)] [string]$CollectorId, [parameter(mandatory = $true)] [string]$portal, [parameter(mandatory = $true)] [string]$AccessId, [parameter(mandatory = $true)] [string]$AccessKey) write-host "In the downloadCollector function.." $verb='GET' $baseLMUrl = 'https://{0}.logicmonitor.com/santaba/rest{1}' #$resourcePath = [string]::Format("/setting/collectors/{0}/installers/Win64?useEA=true", $CollectorId) $resourcePath = [string]::Format("/setting/collectors/{0}/installers/Win64", $CollectorId) $localFile = 'C:\inforbc\tmp\logicmonitoring.exe' <# Construct URL #> $url = [string]::Format($baseLMUrl, $portal, $resourcePath) $url = [string]::Format("{0}?useEA=true?collectorSize=small", $url) <# Get current time in milliseconds #> $epoch = [Math]::Round((New-TimeSpan -start (Get-Date -Date "1/1/1970") -end (Get-Date).ToUniversalTime()).TotalMilliseconds) <# Concatenate Request Details #> if ([String]::IsNullOrEmpty($data)) { $requestVars = $verb + $epoch + $resourcePath } else { $requestVars = $verb + $epoch + $data + $resourcePath } <# Construct Signature #> $hmac = New-Object System.Security.Cryptography.HMACSHA256 $hmac.Key = [Text.Encoding]::UTF8.GetBytes($accessKey) $signatureBytes = $hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($requestVars)) $signatureHex = [System.BitConverter]::ToString($signatureBytes) -replace '-' $signature = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($signatureHex.ToLower())) <# Construct Headers #> $auth = 'LMv1 ' + $accessId + ':' + $signature + ':' + $epoch $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Authorization",$auth) #$headers.Add("Content-Type",'application/json') #(New-Object System.Net.WebClient).DownloadFile($url, $installFile) Invoke-WebRequest -Uri $url -Headers $headers -ContentType 'application/json' -OutFile $localFile }
  2. For few deployments in production, api https://www.logicmonitor.com/support/rest-api-developers-guide/sdts/get-sdts/ is throwing bad request "{"data":null,"errmsg":"Bad request","status":1007}". Will the msg bad request comes only when deleting the sdt which does't exist. We do not have enough information to validate this point, can anyone please confirm on this?
  3. I'm accessing the get device group properties api by using name in filters to get the hostgroupID. I need a confirmation on get device group properties api. In the response output, is the first "items"(response['data']['tems'][0]) having an ID value is the devicegroupid ? Is there any other way I can get the hostroupID by just the name or customerprefix of the deployment.