This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $company = "your-lm-company" # Replace with your LogicMonitor company name | |
| $bearerToken = "your-lm-bearer-token" # replace with your LM bearer token | |
| $daysAgo = 2 # Number of days to look back for alerts | |
| # calculates the epoch time for the start of the query | |
| $startEpoch = (Get-Date (Get-Date).AddDays(-$daysAgo) -UFormat %s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function invoke-lmapi { | |
| # Function to interact with the LogicMonitor API. | |
| # DL 14/01/23 - Does not handle paging at the moment so will only return the first 50 results in large resultsets. This hasn't been a problem so far as I've been using | |
| # queries for individual items but something that the function does need to be able to deal with. | |
| param ( | |
| [parameter(Mandatory)][string]$company, | |
| [parameter(Mandatory)][string]$accessId, | |
| [parameter(Mandatory)][string]$accessKey, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.json.JsonSlurper | |
| import java.time.LocalDateTime | |
| import com.logicmonitor.mod.Snippets | |
| // switch on to enable debug output | |
| def debug = true | |
| // get the info we need to call the API | |
| def client_key = hostProps.get("ciscosupportapi.key") | |
| def client_secret = hostProps.get("ciscosupportapi.pass") |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Available aliases as at 23-Jan-2020 | |
| Generated using: (Get-AzPolicyAlias).Aliases | Select Name | |
| "Microsoft.CDN/profiles/sku.name" | |
| "Microsoft.Cdn/profiles/sku" | |
| "Microsoft.Cdn/profiles/resourceState" | |
| "Microsoft.Cdn/profiles/provisioningState" | |
| "microsoft.cdn/profiles/endpoints/isHttpAllowed" | |
| "microsoft.cdn/profiles/endpoints/isHttpsAllowed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Generated using: (Get-AzPolicyAlias -NamespaceMatch 'DocumentDB').Aliases | Select Name | |
| Name | |
| ---- | |
| Microsoft.DocumentDB/databaseAccounts/sku.name | |
| Microsoft.DocumentDB/databaseAccounts/virtualNetworkRules[*] | |
| Microsoft.DocumentDB/databaseAccounts/virtualNetworkRules[*].id | |
| Microsoft.DocumentDB/databaseAccounts/isVirtualNetworkFilterEnabled | |
| Microsoft.DocumentDB/databaseAccounts/consistencyPolicy.defaultConsistencyLevel | |
| Microsoft.DocumentDB/databaseAccounts/enableAutomaticFailover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # created as part of the Future Learn course on Physical Computing with Raspberry Pi | |
| # sets off epilepsy inducing LED flashing | |
| from gpiozero import LED | |
| from time import sleep | |
| red_led = LED(17) | |
| blue_led = LED(27) | |
| green_led = LED(22) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # created as part of the Future Learn course on Physical Computing with Raspberry Pi | |
| # takes a message entered and flashes it out in morse code to an LED on gpio pin 17 | |
| # numbers are missing so only letters work | |
| from gpiozero import LED | |
| from time import sleep | |
| import sys | |
| red_led = LED(17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-VDCVMDetails { | |
| # Adapted from original code from http://geekafterfive.com/2013/03/21/simple-vm-reporting-in-vcloud-with-powercli/ | |
| # Added MAC Address, Network Connection, Storage Profile and setup as a function | |
| $objects = @() | |
| $vms = $input | Get-CIVM | |
| foreach($vm in $vms) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script is intended to be used as part of a script to automatically create Organisation VDCs in vCloud Director. | |
| # Find the Storage Profile in the Provider vDC to be added to the Org vDC | |
| $BronzePvDCProfile = search-cloud -QueryType ProviderVdcStorageProfile -Name "Bronze Storage" | Get-CIView | |
| # Create a new object of type VdcStorageProfileParams and fill in the parameters for the new Org vDC passing in the href of the Provider vDC Storage Profile | |
| $spParams = new-object VMware.VimAutomation.Cloud.Views.VdcStorageProfileParams | |
| $spParams.Limit = 512000 | |
| $spParams.Units = "MB" | |
| $spParams.ProviderVdcStorageProfile = $BronzePvDCProfile.href |
NewerOlder