SDT scheduling using REST API and PowerShell
Trying to schedule a new SDT for January 1, 2018 1:00 AM to 1:30 AM for a device group, but getting a Status:1007 and a blank response. <# account info #> $accessId = 'SHj6Hub8e63FUwkc5' $accessKey = 'xz37=(][{qb6ANLp}5$-S9Hvn6HV292P' $company = 'api' # stdTYpe (integer) # 1 - one time, 2 - Weekly SDT, 3 - Monthly SDT, 4 - Daily SDT # we have to use "one time" style values because LM has no concept of day of month $stdTYpe = 1 # type (string) # ServiceGroupSDT, DeviceGroupSDT, CollectorSDT $type = "DeviceGroupSDT" # deviceGroupId (string) # $deviceGroupId = 18 # dataSourceId (integer) # 0 = ALL $dataSourceId = 0 <# request details #> $httpVerb = 'POST' $resourcePath = '/sdt/sdts' #serviceGroupSDTs # data $data = '{"sdtType":'+$stdTYpe+',"type":"'+ $type +'","deviceGroupId":'+ $deviceGroupId +',"dataSourceId":'+ $dataSourceId +',"startDateTime":1514786400,"endDateTime":1514788200}' <# Construct URL #> $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath <# 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 #> $requestVars = $httpVerb + $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') <# Make Request #> $response = Invoke-RestMethod -Uri $url -Method $httpVerb -Body $data -Header $headers <# Print status and body of response #> $status = $response.status $body = $response.data| ConvertTo-Json -Depth 5 Write-Host "Status:$status" Write-Host "Response:$body"11Views0likes5CommentsMultiple Device Select when setting SDT
As an MSP we also manage a number of customerpatching cycles, this entails a number of servers needing to be placed into SDT individually for a customer across a number of there groups, with some of our customers this means 60+ servers at a time. (devices can be spread across several groups & not all devices within each said group willbepatched at the same time, so setting at the grouplevel is out). Can we please have the function of being able to select a group and then a number of individualdevices from that group (+sub-group) at the same time - ideally being able to see a list of devices contained with group (+ sub-group) and have checkboxesalongside them so that multiple selections can be made at once. This will make life a lot easier and faster for such scenarios.7Views4likes1CommentAdd SDT for multiple groups and services
Please add an option to add an SDT for multiple groups and services at the same time. I just had to add a SDT for a few groups that are all on the same hosting facility and had to move all of these groups under one parent so I can add the SDT on that parent and today once the SDT is over I will break down this group back into it's sub groups as I do not need this top level group4Views0likes0Comments[Feature Request] SDT on multiple devices
Team, Is is possible to make a feature request to allow us to add an SDT on multiple devices but not at the group level? Context: one of our customers have hundreds of servers in one group, and might be turning off a few dozens that need to go in SDT to prevent alerts flooding out, though because they are not turning them all off in the group this involves a lot of manual input. The option to select multiple devices with a tick box, with a select all option, which then allows to apply an SDT to selected would be very helpful. Many thanks, Auriane2Views0likes0CommentsCustom Alert-Groups for SDT
When we reboot a Server or a Application Set our NOC does not know all the Devices, Instances and/or services impacted so we get flooded with alerts for a known event. Example: I need to reboot device WebServer-xyz - TheServer, the Switch ports, Storage Sessions and HTTP/S Service are all monitoredin LM Like to be able to SDT just these items with one SDT, and not entire switches or devices. So be able to create an "Alert-Group"ie "WebServer-xyz" where you can then add Instances from multiple devices, entire device, Service, Instance Groups, Device Group aka any defined in LM. Then just Add one SDT to the Alert-Group aka one-stop-shopping.2Views0likes1CommentWeekly SDT extending more than 24 hrs.
My use case is we want to set weekly SDT for almost 109 hours. Environment shuts down on Wednesday @8 PM,comes back up Monday @ 9 AM. In current scenario I have to use Multiple SDT's to achieve this task. Requesting feature request which will allow to select day exceeding more than 24 Hrs that way such task can be accomplished.1View0likes0Comments