Adding Weather to Map Widgets
LogicMonitor's Map widgets are a great and easy way to plot resources/groupsgeographically, including their status. A question that comes up occasionally is if it's possible to show weather information on top of these maps. While there's currently not a native option to show weather on a Map widget, it is possible to inject a weather layer onto an existing map with a bit of JavaScript. Below is a link to a sample dashboard that can insert various types of weather info onto Map widgets.Simply save the linked JSON file to your local workstation, then in your LogicMonitor portal go to Dashboards and click Add > From File. Dynamic_Weather_Overlay.json The magic happens in JavaScript embedded in the source of the Text widget. Feel free to explore the source code by entering the Text widget's Configure dialog and clicking the 'Source' button. In typical overkill fashion, I included the option for several differenttypes of weather information. The script looks for the following text (regardless of case) in the Map widget's title and adds the appropriate weather/info layer: "Radar" or "Precip" "NEXRAD Base" "NEXRAD Echo Tops" "MRMS" "Temperature" (OpenWeatherMap.org API key required) "Wind Speed" (OpenWeatherMap.org API key required) "Cloud Cover" or "Satellite" (OpenWeatherMap.org API key required) "fire"(for including perimeters of active wildfires) Prerequisites If you want to use one of the map types noted above as needing an API key (the other types use free APIs that don't require a key), you'll need to register for a free account on OpenWeatherMap.org. Once you've obtained an API key, just add a new dashboard token named 'OpenWeatherAPIKey' and paste your key into its value field.Alternatively, you can also hard-code the key directlyin the 'openWeatherMapsAPIKey' variable near the top of the script. The weather overlays should auto-update when the widgets performtheir regular timed refresh. For instance, new radar imagery is made available every 10 minutes and will update automatically. Weather sources currently defined within this script: RainViewer.com- Excellent source of global weather imaging data. Updates approx. every 10 minutes. Used by the script for radar/precipitation maps. Open Geospatial Consortium- Hosted by Iowa State University, an excellent free source of weather data. Since it sources data from the US National Weather Service, its data is local just US and Canada. Used by the script for NEXRAD and MRMS data. OpenWeatherMap.org- Good source for some weather data such as wind speed, temperature, and cloud cover. Requires use of an API key, which is available for free. National Interagency Fire Center - For data about active US wildfires. Known Issues: When switching to a different dashboard containing a Map widget, it's possible weather may still be visible on the new dashboard. If that happensjust refresh the page.389Views23likes3CommentsLive 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 context105Views15likes2CommentsAPI - Posting widget updates via powershell
Hello, Trying to get the below script to work, but hitting a snag. I've tried to repurpose the DataSource Upload Example script from this page to get the desired result but no dice. Param([Parameter(Mandatory=$true)][string]$name,[string]$GetInstance,[string]$GetType,[string]$Computername)<# Use TLS 1.2 #>[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $accessId = '###'$accessKey = '###'$company = '###'$httpVerb = 'PUT'$widgetID = "350"$resourcePath = "/dashboard/widgets/$widgetID"$queryParams = ''$boundary = [System.Guid]::NewGuid().ToString()$LF = "\r\n"$data = @" "items":[{"deviceGroupFullPath":"*","deviceDisplayName":"$computername","dataSourceDisplayName":"$name","instanceName":"$Name","dataPointName":"FolderGT60","groupBy":"instance","name":"$getinstance"}]"@$url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath + $queryParams$epoch = [Math]::Round((New-TimeSpan -start (Get-Date -Date "1/1/1970") -end (Get-Date).ToUniversalTime()).TotalMilliseconds)$requestVars = $httpVerb + $epoch + $data + $resourcePath$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()))$auth = 'LMv1 ' + $accessId + ':' + $signature + ':' + $epoch$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"$headers.Add("Authorization",$auth)$headers.Add("Content-Type","multipart/form-data; boundary=----$boundary")$response = Invoke-RestMethod -Uri $url -Method $httpVerb -body $data -Header $headers $status = $response.status$body = $response.dataWrite-Host "Status:$status"Write-Host "Response:$body" I assume that the '$headers.Add("Content-Type","multipart/form-data; boundary=----$boundary")' section, or '$boundary', is incorrect but have only really been looking into anything Logicmonitor-API-Powershell in the last 24 hours. I'm getting HTTP 415 error Unsupported Media Typeh1 which I thought originally was from the $data section but I can't figure out any other way to pass the JSON into the variable. Thanks, Amir.11Views0likes2CommentsWebsite response times on Big Number & Chart widget
We have a use case to show "Response Times" from a subset of configured Websites. Ideally I'd like this to be in the Big Number widget. We also want to able to chart a subset of my Websites' response times over time in the Chart widget. Anyone found a useful workaround to achieve this? Would LM consider "upgrading" widgets to allow the presentation of Website data? Currently only the SLA widget seems capable of handling Website data.5Views3likes1CommentHow to group widgets in a group in a single dashboard?
Willing to create a single dashboard which would show the utilisation of multiple routers. The widgets for each routershall be grouped under the routers host name as a group The widgets could be CPU , memory, status like up/down/shutdown and so on4Views0likes1CommentDatapoint expression for widgets similar to un() when no active instances
We'd like to see a datapoint expression for widgets similar to the un() expression which returns a value when there are no active instances, rather than throwing an error. For example if Icreate an aggregated datapoint to sumall Netapp volumes containing "_ABC_"but there are no volumes that match this the graph throws an error that there are no active instances. It would be useful if we had an expression that could return a value instead of creating an error, ex. if(noInstances(ABC_Volumes),0,ABC_Volumes).2Views0likes0Comments