Search the Community

Showing results for tags 'downloading collector'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • LogicModule Exchange
    • LM Exchange
    • LM Staff Contributions
  • Product Announcements
    • LogicMonitor Notices
  • LogicMonitor Product Q&A
    • Feature Requests
    • Ask the Community
    • From the Front

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 1 result

  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 }