Live Twitter Feeds in Text Widgets
Below is a fairly simple process to add any public facing twitter feed to widgets on a dashboard. Some use cases I hear a lot from customers is that they liketo see companies twitter feeds along their own service health dashboards because sometimes social media moves faster than status pages or email updates. This will all be done within a Text Widget. There is an option to utilize source code, we’ll be working in there. Make sure you have the frame of an HTML page set up, You can add any title you want. Tags with spaces will have sections added to them below. <html> <title> </title> <body> </body> </html> <script> </script> The first step is to go tohttps://publish.twitter.com/. Put in the URL of the profile you want,ex: twitter.com/Microsoft365, and select its embedded feed. The website will give you an <a class>HTML code to copy. Put the<a class>section into the <body>. It should look like this: <html> <title> </title> <body> <a class="twitter-timeline" href="https://twitter.com/Microsoft365?ref_src=twsrc%5Etfw">Tweets by Microsoft365</a> </body> </html> <script> </script> There will be a <script>portion of the copied code, paste that into a notepad and take it out of the above. We will be using it in the next section. Next, we need to navigate to that .js link in the <script> section, you should do this in a separate tab. That page will lead you to the full JS code. Copy that code and paste it into the <script> section in your HTML frame. It should look like this: <html> <title> </title> <body> <a class="twitter-timeline" href="https://twitter.com/Microsoft365?ref_src=twsrc%5Etfw">Tweets by Microsoft365</a> </body> </html> <script> JS Code here </script> From there, save and close the widget. If done correctly it should look like this (It may take a few seconds to load): Some helpful tips: Changing the widget refresh frequency also changes the feed update frequency Once created, the widget can be cloned and changed to another twitter handle with relative ease Usually goes alongside Dashboards for Health/Status Monitoring and can give additional context106Views15likes2CommentsSDT 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"27Views0likes5CommentsHow about a Redlight/Greenlight dashboard widget?
I think it would be useful to have a widget that was a simple red/green light. Maybe red/green/off. Maybe one big light or a grid of lights with description (to save space), or both! This would be great for Windows (or other) services on dashboards. Any metric that is represented by a graph that is either a 1 or a 0 is pretty boring to look at. A simple green light = 1, red light = 0, lights out = NULL would be aesthetically pleasing. I'm a SQL DBA and having this for my SQL services would be a great way to jump on and see if anything is not running that should be (even if I don't necessarily want to be alerted that it is not running). Thanks!2Views0likes2Comments