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
| ((Get-EC2Instance).instances) | Select InstanceId, @{Name="tagName";Expression={($_.Tags | Where {$_.Key -eq "Name"}).Value}} |
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
| $bucket = "mi_bucket" | |
| $objeto = "mi_objeto" | |
| (Get-S3Version -BucketName $bucket).versions | where {$_.Key -eq $objeto} | Select Key,lastmodified,versionId,size |
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
| $topicARN = "arn:aws:sns:us-east-1:123445-miARN" | |
| Write-CWMetricAlarm ` | |
| -AlarmName "mi_alarma" ` | |
| -Namespace "AWS/S3" ` | |
| -MetricName BucketSizeBytes ` | |
| -ComparisonOperator GreaterThanOrEqualToThreshold ` | |
| -EvaluationPeriod 1 ` | |
| -Period 86400 ` | |
| -Statistic Maximum ` |
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
| $buckets = (Get-S3Bucket).BucketName | |
| Foreach ($bucket in $buckets) { | |
| $bucket | |
| $s3foldersize = ((Get-S3object -BucketName $bucket).size | Measure-Object -Sum).sum | |
| $foldersizegb = ($s3foldersize / 1073741824) | |
| $foldersizegb | |
| } |
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
| $instance = "mi_instanceId" | |
| ## Info general de la instancia | |
| #(Get-EC2Instance -InstanceId $instance).instances | where {$_.InstanceId -eq $instance} | |
| ## Volumenes | |
| $devices = ((Get-EC2Instance -InstanceId $instance).instances | where {$_.InstanceId -eq $instance}).BlockDeviceMappings | |
| $volumes = $devices.Ebs.VolumeId | |
| Foreach ($volume in $volumes) { | |
| Get-EC2Volume -VolumeId $volume | select VolumeId,Size |
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
| #! /bin/sh | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data '{ "text":"'$1' '$2'" }' \ | |
| https://hooks.slack.com/services/T0xxxxxxx/xxxxxxxxx/1pRj3eXqJtFy74WHK4xxxxxx |
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
| { | |
| "AWSTemplateFormatVersion" : "2010-09-09", | |
| "Description" : "Crear un VPC y 2 subnet, una publica y una privada", | |
| "Parameters" : { | |
| "AZ" : { | |
| "Type" : "String", | |
| "Default" : "us-east-1a", | |
| "AllowedValues" : ["us-east-1a", "us-east-1c", "us-east-1d", "us-east-1e"], |
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
| [general] | |
| state_file = /var/awslogs/state/agent-state | |
| [/var/log/syslog] | |
| file = /var/log/syslog | |
| log_group_name = HMA-test | |
| log_stream_name = vmware-logs | |
| datetime_format = %b %d %H:%M:%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
| { | |
| "AWSTemplateFormatVersion" : "2010-09-09", | |
| "Description" : "Crear una instancia EC2 y la configura para CloudWatch Logs", | |
| "Resources" : { | |
| "EIP" : { | |
| "Type" : "AWS::EC2::EIP", |
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
| ######################################################### | |
| ## Generacion de reporte de utilizacion de espacio | |
| ## en Datastores VMware y envio por correo electronico | |
| ## como HTML/CSS | |
| ######################################################### | |
| ## CSS | |
| $head = @" | |
| <style> | |
| table { |
NewerOlder