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
| <# | |
| .SYNOPSIS | |
| Monitors CPU usage. If it is above the configured percentage, a file is renamed | |
| .DESCRIPTION | |
| Monitors CPU usage. If it is above the configured percentage, a file is renamed | |
| .PARAMETERS | |
| All parameters are requested interactively | |
| .EXAMPLE | |
| ./CPUmonitor.ps1. | |
| .OUTPUTS |
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
| <# | |
| .SYNOPSIS | |
| Add a task to be executed in Task Scheduler | |
| .DESCRIPTION | |
| Add a task to be executed in Task Scheduler. In the example the CPUmonitor.ps1 is configured to run when the computer starts | |
| .PARAMETERS | |
| All parameters are requested interactively | |
| .EXAMPLE | |
| ./AddTaskSchedulerTask.ps1.ps1 | |
| .OUTPUTS |
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
| # Insert here the code that enables monitoring on SQL. Run the commands -asjob | |
| # This will show you the jobs progress | |
| do { | |
| $report = Get-Job | |
| $CompletedJobs = $report | Where-Object { $_.State -in 'Completed', 'Failed' } | |
| $RunningJobs = $report | Where-Object { $_.State -contains 'Running' } | |
| Write-Progress -Activity 'Analyzing Jobs' -Status "Completed $($CompletedJobs.count) of $($report.count)" -PercentComplete (($CompletedJobs.count / $report.count) * 100) | |
| } | |
| until (!$RunningJobs) |
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
| # Optional: Connect to Azure | |
| # Connect-AzAccount | |
| # Optional: Install MySQL module | |
| # Install-Module -Name Az.MySql -AllowPrerelease | |
| Clear-Host | |
| #Variables | |
| $PrimaryServerName = "primaryserverMAU015" |
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
| #-------------------------------------------------------------------------------------- | |
| # Login to Azure | |
| #-------------------------------------------------------------------------------------- | |
| #region login | |
| #Connect-AzAccount | |
| #endregion login | |
| #-------------------------------------------------------------------------------------- |
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
| # Credential | |
| $VMLocalAdminUser = "dockeradmin" | |
| $VMLocalAdminSecurePassword = ConvertTo-SecureString "@DockerWorkshop2020!!" -AsPlainText -Force | |
| # VM name and location | |
| $LocationName = "east us 2" | |
| $ResourceGroupName = "rg-DockerLab-$(Get-Random)" | |
| $ComputerName = "vm-docker" | |
| $VMName = "vm-docker" | |
| $VMSize = "Standard_D8s_v3" |
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
| # Transform managed disk to VHD to mount it in a non-managed VM | |
| # In order to mount a managed disk to a VM with unmanaged disks you need to convert the managed disk to a VHD | |
| # Then you will mount the resultant VHD to your unmanaged VM. | |
| # Follow the procedure below. | |
| # ------------------------------------------ | |
| # Variables | |
| # ------------------------------------------ | |
| # Name of the storage account where the resultant VHD disk will be stored |
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
| # Variables | |
| $storageAccountName = "linux78" | |
| $storageAccountResourceGroup = "rg-Joseph" | |
| $vmName = "linux-7-8-04" | |
| $VMresourceGroup = "rg-Joseph" | |
| $publicSettingsFilePath = "Z:\Mauricio\E\Trabajo\Microsoft\CSA\PwC C-AMS\C-AMS monitoring\publicSettings.json" | |
| $protectedSettingsFilePath = "Z:\Mauricio\E\Trabajo\Microsoft\CSA\PwC C-AMS\C-AMS monitoring\protectedSettings.json" | |
| # Connect |
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
| { | |
| "storageAccountName" : "__DIAGNOSTIC_STORAGE_ACCOUNT__", | |
| "storageAccountSasToken": "__SAS_TOKEN__", | |
| "sinksConfig": { | |
| "sink": [ | |
| ] | |
| } | |
| } |
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
| { | |
| "StorageAccount": "__DIAGNOSTIC_STORAGE_ACCOUNT__", | |
| "ladCfg": { | |
| "diagnosticMonitorConfiguration": { | |
| "eventVolume": "Medium", | |
| "metrics": { | |
| "metricAggregation": [ | |
| { | |
| "scheduledTransferPeriod": "PT1M" | |
| }, |
OlderNewer