├── .gitignore ├── CLOUD ├── .gitignore ├── EXAMPLES │ ├── aws-backup-plans-info-example.json │ ├── aws_DynamoDB_info-example.csv │ ├── aws_backup_costs-example.csv │ ├── aws_ec2_instance_info-example.csv │ ├── aws_ec2_unattached_volume_info-example.csv │ ├── aws_efs_info-example.csv │ ├── aws_eks_clusters_info-example.csv │ ├── aws_eks_nodegroups_info-example.csv │ ├── aws_fsx_filesystem_info-example.csv │ ├── aws_fsx_volume_info-example.csv │ ├── aws_kms_numbers-example.csv │ ├── aws_rds_info-example.csv │ ├── aws_s3_info-example.csv │ ├── aws_secrets_numbers-example.csv │ ├── aws_sqs_numbers-example.csv │ ├── azure_backup_vault_VM_SQL_items-example.csv │ ├── azure_backup_vault_VM_SQL_policies-example.json │ ├── azure_backup_vault_VM_items-example.csv │ ├── azure_backup_vault_VM_policies-example.json │ ├── azure_backup_vault_info-example.csv │ ├── azure_file_share_info-example.csv │ ├── azure_sql_info-example.csv │ ├── azure_vmdisk_info-example.csv │ └── gce_vmdisk_info-example.csv ├── Get-AWSSizingInfo-Permissions.cft ├── Get-AWSSizingInfo.ps1 ├── Get-AzureSizingInfo.ps1 ├── Get-GCPSizingInfo.ps1 ├── README.md └── consolidate.ps1 ├── MSSQL ├── CollectSQLProfile.ps1 ├── Parse-RubrikSizing.ps1 ├── RubrikSQLProfile-DBInfo.sql └── SQLInstances.txt ├── ORACLE ├── README.txt ├── collectionInput.lst ├── collectionInput.lst-EXAMPLE ├── dataCollector.sh ├── rbkDataCollection.sql ├── rbkDataCollection_11g.sql ├── rbkDataCollection_121.sql ├── rbkDataCollection_12c.sql └── rbkDiscovery.csv ├── README.md └── VMWARE └── Get-VMwareDiskStats.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | settings.json 2 | **/.DS_Store 3 | *.csv 4 | !/CLOUD/EXAMPLES/* 5 | CLOUD/*.json -------------------------------------------------------------------------------- /CLOUD/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.zip 3 | *.txt -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws-backup-plans-info-example.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "AdvancedBackupSettings": [], 4 | "BackupPlan": { 5 | "AdvancedBackupSettings": [], 6 | "BackupPlanName": "BackupPlanName-00000", 7 | "Rules": [ 8 | { 9 | "CompletionWindowMinutes": 10080, 10 | "CopyActions": [], 11 | "EnableContinuousBackup": false, 12 | "Lifecycle": { 13 | "DeleteAfterDays": 35, 14 | "MoveToColdStorageAfterDays": 0, 15 | "OptInToArchiveForSupportedResources": false 16 | }, 17 | "RecoveryPointTags": {}, 18 | "RuleId": "RuleId-00000", 19 | "RuleName": "RuleName-00000", 20 | "ScheduleExpression": "cron(0 5 ? * * *)", 21 | "ScheduleExpressionTimezone": "Etc/UTC", 22 | "StartWindowMinutes": 480, 23 | "TargetBackupVaultName": "TargetBackupVaultName-00000" 24 | } 25 | ] 26 | }, 27 | "BackupPlanArn": "BackupPlanArn-00000", 28 | "BackupPlanId": "BackupPlanId-00000", 29 | "CreationDate": "2022-06-06T23:33:40.022Z", 30 | "CreatorRequestId": "CreatorRequestId-00000", 31 | "DeletionDate": "0001-01-01T00:00:00", 32 | "LastExecutionDate": "2024-10-02T05:43:06.3719999Z", 33 | "VersionId": "VersionId-00000", 34 | "ResponseMetadata": { 35 | "RequestId": "RequestId-00000", 36 | "Metadata": {}, 37 | "ChecksumAlgorithm": 0, 38 | "ChecksumValidationStatus": 0 39 | }, 40 | "ContentLength": 1004, 41 | "HttpStatusCode": 200, 42 | "Resources": [] 43 | }, 44 | { 45 | "AdvancedBackupSettings": [], 46 | "BackupPlan": { 47 | "AdvancedBackupSettings": [], 48 | "BackupPlanName": "BackupPlanName-00001", 49 | "Rules": [ 50 | { 51 | "CompletionWindowMinutes": 10080, 52 | "CopyActions": [], 53 | "EnableContinuousBackup": false, 54 | "Lifecycle": { 55 | "DeleteAfterDays": 35, 56 | "MoveToColdStorageAfterDays": 0, 57 | "OptInToArchiveForSupportedResources": false 58 | }, 59 | "RecoveryPointTags": {}, 60 | "RuleId": "RuleId-00001", 61 | "RuleName": "RuleName-00001", 62 | "ScheduleExpression": "cron(0 5 ? * * *)", 63 | "ScheduleExpressionTimezone": "Etc/UTC", 64 | "StartWindowMinutes": 480, 65 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 66 | } 67 | ] 68 | }, 69 | "BackupPlanArn": "BackupPlanArn-00001", 70 | "BackupPlanId": "BackupPlanId-00001", 71 | "CreationDate": "2023-02-02T15:36:57.6909999Z", 72 | "CreatorRequestId": null, 73 | "DeletionDate": "0001-01-01T00:00:00", 74 | "LastExecutionDate": "2024-10-01T07:05:31.052Z", 75 | "VersionId": "VersionId-00001", 76 | "ResponseMetadata": { 77 | "RequestId": "RequestId-00001", 78 | "Metadata": {}, 79 | "ChecksumAlgorithm": 0, 80 | "ChecksumValidationStatus": 0 81 | }, 82 | "ContentLength": 883, 83 | "HttpStatusCode": 200, 84 | "Resources": [] 85 | }, 86 | { 87 | "AdvancedBackupSettings": [], 88 | "BackupPlan": { 89 | "AdvancedBackupSettings": [], 90 | "BackupPlanName": "BackupPlanName-00002", 91 | "Rules": [ 92 | { 93 | "CompletionWindowMinutes": 10080, 94 | "CopyActions": [], 95 | "EnableContinuousBackup": false, 96 | "Lifecycle": { 97 | "DeleteAfterDays": 35, 98 | "MoveToColdStorageAfterDays": 0, 99 | "OptInToArchiveForSupportedResources": false 100 | }, 101 | "RecoveryPointTags": {}, 102 | "RuleId": "RuleId-00002", 103 | "RuleName": "RuleName-00001", 104 | "ScheduleExpression": "cron(0 5 ? * * *)", 105 | "ScheduleExpressionTimezone": "Etc/UTC", 106 | "StartWindowMinutes": 480, 107 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 108 | } 109 | ] 110 | }, 111 | "BackupPlanArn": "BackupPlanArn-00002", 112 | "BackupPlanId": "BackupPlanId-00002", 113 | "CreationDate": "2023-04-27T16:43:22.5239999Z", 114 | "CreatorRequestId": null, 115 | "DeletionDate": "0001-01-01T00:00:00", 116 | "LastExecutionDate": "2024-10-02T05:09:24.1659998Z", 117 | "VersionId": "VersionId-00002", 118 | "ResponseMetadata": { 119 | "RequestId": "RequestId-00002", 120 | "Metadata": {}, 121 | "ChecksumAlgorithm": 0, 122 | "ChecksumValidationStatus": 0 123 | }, 124 | "ContentLength": 893, 125 | "HttpStatusCode": 200, 126 | "Resources": [ 127 | "Resources-00000" 128 | ] 129 | }, 130 | { 131 | "AdvancedBackupSettings": [], 132 | "BackupPlan": { 133 | "AdvancedBackupSettings": [], 134 | "BackupPlanName": "BackupPlanName-00003", 135 | "Rules": [ 136 | { 137 | "CompletionWindowMinutes": 10080, 138 | "CopyActions": [], 139 | "EnableContinuousBackup": false, 140 | "Lifecycle": { 141 | "DeleteAfterDays": 12775, 142 | "MoveToColdStorageAfterDays": 0, 143 | "OptInToArchiveForSupportedResources": false 144 | }, 145 | "RecoveryPointTags": {}, 146 | "RuleId": "RuleId-00003", 147 | "RuleName": "RuleName-00001", 148 | "ScheduleExpression": "cron(0 5 ? * * *)", 149 | "ScheduleExpressionTimezone": "America/Los_Angeles", 150 | "StartWindowMinutes": 480, 151 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 152 | }, 153 | { 154 | "CompletionWindowMinutes": 10080, 155 | "CopyActions": [], 156 | "EnableContinuousBackup": false, 157 | "Lifecycle": { 158 | "DeleteAfterDays": 90, 159 | "MoveToColdStorageAfterDays": 0, 160 | "OptInToArchiveForSupportedResources": false 161 | }, 162 | "RecoveryPointTags": {}, 163 | "RuleId": "RuleId-00004", 164 | "RuleName": "RuleName-00002", 165 | "ScheduleExpression": "cron(0 5 ? * 7 *)", 166 | "ScheduleExpressionTimezone": "America/Los_Angeles", 167 | "StartWindowMinutes": 480, 168 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 169 | }, 170 | { 171 | "CompletionWindowMinutes": 10080, 172 | "CopyActions": [], 173 | "EnableContinuousBackup": false, 174 | "Lifecycle": { 175 | "DeleteAfterDays": 2555, 176 | "MoveToColdStorageAfterDays": 90, 177 | "OptInToArchiveForSupportedResources": true 178 | }, 179 | "RecoveryPointTags": {}, 180 | "RuleId": "RuleId-00005", 181 | "RuleName": "RuleName-00003", 182 | "ScheduleExpression": "cron(0 5 1 * ? *)", 183 | "ScheduleExpressionTimezone": "America/Los_Angeles", 184 | "StartWindowMinutes": 480, 185 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 186 | }, 187 | { 188 | "CompletionWindowMinutes": 10080, 189 | "CopyActions": [], 190 | "EnableContinuousBackup": false, 191 | "Lifecycle": { 192 | "DeleteAfterDays": 30, 193 | "MoveToColdStorageAfterDays": 0, 194 | "OptInToArchiveForSupportedResources": false 195 | }, 196 | "RecoveryPointTags": {}, 197 | "RuleId": "RuleId-00006", 198 | "RuleName": "RuleName-00004", 199 | "ScheduleExpression": "cron(0 1 ? * * *)", 200 | "ScheduleExpressionTimezone": "America/Los_Angeles", 201 | "StartWindowMinutes": 480, 202 | "TargetBackupVaultName": "TargetBackupVaultName-00002" 203 | } 204 | ] 205 | }, 206 | "BackupPlanArn": "BackupPlanArn-00003", 207 | "BackupPlanId": "BackupPlanId-00003", 208 | "CreationDate": "2024-01-30T06:12:18.572Z", 209 | "CreatorRequestId": null, 210 | "DeletionDate": "0001-01-01T00:00:00", 211 | "LastExecutionDate": "2024-10-01T12:43:27.108Z", 212 | "VersionId": "VersionId-00003", 213 | "ResponseMetadata": { 214 | "RequestId": "RequestId-00003", 215 | "Metadata": {}, 216 | "ChecksumAlgorithm": 0, 217 | "ChecksumValidationStatus": 0 218 | }, 219 | "ContentLength": 2250, 220 | "HttpStatusCode": 200, 221 | "Resources": [ 222 | "Resources-00001" 223 | ] 224 | }, 225 | { 226 | "AdvancedBackupSettings": [], 227 | "BackupPlan": { 228 | "AdvancedBackupSettings": [], 229 | "BackupPlanName": "BackupPlanName-00004", 230 | "Rules": [ 231 | { 232 | "CompletionWindowMinutes": 10080, 233 | "CopyActions": [ 234 | { 235 | "DestinationBackupVaultArn": "DestinationBackupVaultArn-00000", 236 | "Lifecycle": { 237 | "DeleteAfterDays": 60, 238 | "MoveToColdStorageAfterDays": 0, 239 | "OptInToArchiveForSupportedResources": false 240 | } 241 | } 242 | ], 243 | "EnableContinuousBackup": false, 244 | "Lifecycle": { 245 | "DeleteAfterDays": 60, 246 | "MoveToColdStorageAfterDays": 0, 247 | "OptInToArchiveForSupportedResources": false 248 | }, 249 | "RecoveryPointTags": {}, 250 | "RuleId": "RuleId-00007", 251 | "RuleName": "RuleName-00005", 252 | "ScheduleExpression": "cron(30 0 1 * ? *)", 253 | "ScheduleExpressionTimezone": "Etc/UTC", 254 | "StartWindowMinutes": 480, 255 | "TargetBackupVaultName": "TargetBackupVaultName-00003" 256 | } 257 | ] 258 | }, 259 | "BackupPlanArn": "BackupPlanArn-00004", 260 | "BackupPlanId": "BackupPlanId-00004", 261 | "CreationDate": "2024-03-26T20:34:49.677Z", 262 | "CreatorRequestId": null, 263 | "DeletionDate": "0001-01-01T00:00:00", 264 | "LastExecutionDate": "2024-10-01T01:16:20.1779999Z", 265 | "VersionId": "VersionId-00004", 266 | "ResponseMetadata": { 267 | "RequestId": "RequestId-00004", 268 | "Metadata": {}, 269 | "ChecksumAlgorithm": 0, 270 | "ChecksumValidationStatus": 0 271 | }, 272 | "ContentLength": 1121, 273 | "HttpStatusCode": 200, 274 | "Resources": [ 275 | "Resources-00002" 276 | ] 277 | }, 278 | { 279 | "AdvancedBackupSettings": [], 280 | "BackupPlan": { 281 | "AdvancedBackupSettings": [], 282 | "BackupPlanName": "BackupPlanName-00005", 283 | "Rules": [ 284 | { 285 | "CompletionWindowMinutes": 10080, 286 | "CopyActions": [], 287 | "EnableContinuousBackup": false, 288 | "Lifecycle": { 289 | "DeleteAfterDays": 35, 290 | "MoveToColdStorageAfterDays": 0, 291 | "OptInToArchiveForSupportedResources": false 292 | }, 293 | "RecoveryPointTags": {}, 294 | "RuleId": "RuleId-00008", 295 | "RuleName": "RuleName-00002", 296 | "ScheduleExpression": "cron(30 0 ? * 3 *)", 297 | "ScheduleExpressionTimezone": "America/Los_Angeles", 298 | "StartWindowMinutes": 480, 299 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 300 | } 301 | ] 302 | }, 303 | "BackupPlanArn": "BackupPlanArn-00005", 304 | "BackupPlanId": "BackupPlanId-00005", 305 | "CreationDate": "2024-07-23T21:47:45.8199999Z", 306 | "CreatorRequestId": null, 307 | "DeletionDate": "0001-01-01T00:00:00", 308 | "LastExecutionDate": "2024-10-01T09:49:18.467Z", 309 | "VersionId": "VersionId-00005", 310 | "ResponseMetadata": { 311 | "RequestId": "RequestId-00005", 312 | "Metadata": {}, 313 | "ChecksumAlgorithm": 0, 314 | "ChecksumValidationStatus": 0 315 | }, 316 | "ContentLength": 894, 317 | "HttpStatusCode": 200, 318 | "Resources": [ 319 | "Resources-00003", 320 | "Resources-00004" 321 | ] 322 | }, 323 | { 324 | "AdvancedBackupSettings": [], 325 | "BackupPlan": { 326 | "AdvancedBackupSettings": [], 327 | "BackupPlanName": "BackupPlanName-00006", 328 | "Rules": [ 329 | { 330 | "CompletionWindowMinutes": 10080, 331 | "CopyActions": [], 332 | "EnableContinuousBackup": false, 333 | "Lifecycle": { 334 | "DeleteAfterDays": 35, 335 | "MoveToColdStorageAfterDays": 0, 336 | "OptInToArchiveForSupportedResources": false 337 | }, 338 | "RecoveryPointTags": {}, 339 | "RuleId": "RuleId-00009", 340 | "RuleName": "RuleName-00001", 341 | "ScheduleExpression": "cron(0 5 ? * * *)", 342 | "ScheduleExpressionTimezone": "Etc/UTC", 343 | "StartWindowMinutes": 480, 344 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 345 | } 346 | ] 347 | }, 348 | "BackupPlanArn": "BackupPlanArn-00006", 349 | "BackupPlanId": "BackupPlanId-00006", 350 | "CreationDate": "2021-02-18T16:36:59.434Z", 351 | "CreatorRequestId": null, 352 | "DeletionDate": "0001-01-01T00:00:00", 353 | "LastExecutionDate": "2024-10-02T06:31:01.263Z", 354 | "VersionId": "VersionId-00006", 355 | "ResponseMetadata": { 356 | "RequestId": "RequestId-00006", 357 | "Metadata": {}, 358 | "ChecksumAlgorithm": 0, 359 | "ChecksumValidationStatus": 0 360 | }, 361 | "ContentLength": 890, 362 | "HttpStatusCode": 200, 363 | "Resources": [] 364 | }, 365 | { 366 | "AdvancedBackupSettings": [], 367 | "BackupPlan": { 368 | "AdvancedBackupSettings": [], 369 | "BackupPlanName": "BackupPlanName-00007", 370 | "Rules": [ 371 | { 372 | "CompletionWindowMinutes": 10080, 373 | "CopyActions": [], 374 | "EnableContinuousBackup": false, 375 | "Lifecycle": { 376 | "DeleteAfterDays": 35, 377 | "MoveToColdStorageAfterDays": 0, 378 | "OptInToArchiveForSupportedResources": false 379 | }, 380 | "RecoveryPointTags": {}, 381 | "RuleId": "RuleId-00000", 382 | "RuleName": "RuleName-00001", 383 | "ScheduleExpression": "cron(0 5 ? * * *)", 384 | "ScheduleExpressionTimezone": "Etc/UTC", 385 | "StartWindowMinutes": 480, 386 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 387 | }, 388 | { 389 | "CompletionWindowMinutes": 10080, 390 | "CopyActions": [], 391 | "EnableContinuousBackup": false, 392 | "Lifecycle": { 393 | "DeleteAfterDays": 365, 394 | "MoveToColdStorageAfterDays": 30, 395 | "OptInToArchiveForSupportedResources": false 396 | }, 397 | "RecoveryPointTags": {}, 398 | "RuleId": "RuleId-00001", 399 | "RuleName": "RuleName-00006", 400 | "ScheduleExpression": "cron(0 5 1 * ? *)", 401 | "ScheduleExpressionTimezone": "Etc/UTC", 402 | "StartWindowMinutes": 480, 403 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 404 | } 405 | ] 406 | }, 407 | "BackupPlanArn": "BackupPlanArn-00007", 408 | "BackupPlanId": "BackupPlanId-00007", 409 | "CreationDate": "2021-04-01T19:27:10.8829998Z", 410 | "CreatorRequestId": null, 411 | "DeletionDate": "0001-01-01T00:00:00", 412 | "LastExecutionDate": "2024-10-01T06:43:19.3859999Z", 413 | "VersionId": "VersionId-00007", 414 | "ResponseMetadata": { 415 | "RequestId": "RequestId-00007", 416 | "Metadata": {}, 417 | "ChecksumAlgorithm": 0, 418 | "ChecksumValidationStatus": 0 419 | }, 420 | "ContentLength": 1308, 421 | "HttpStatusCode": 200, 422 | "Resources": [] 423 | }, 424 | { 425 | "AdvancedBackupSettings": [], 426 | "BackupPlan": { 427 | "AdvancedBackupSettings": [], 428 | "BackupPlanName": "BackupPlanName-00000", 429 | "Rules": [ 430 | { 431 | "CompletionWindowMinutes": 10080, 432 | "CopyActions": [], 433 | "EnableContinuousBackup": false, 434 | "Lifecycle": { 435 | "DeleteAfterDays": 35, 436 | "MoveToColdStorageAfterDays": 0, 437 | "OptInToArchiveForSupportedResources": false 438 | }, 439 | "RecoveryPointTags": {}, 440 | "RuleId": "RuleId-00002", 441 | "RuleName": "RuleName-00000", 442 | "ScheduleExpression": "cron(0 5 ? * * *)", 443 | "ScheduleExpressionTimezone": "Etc/UTC", 444 | "StartWindowMinutes": 480, 445 | "TargetBackupVaultName": "TargetBackupVaultName-00000" 446 | } 447 | ] 448 | }, 449 | "BackupPlanArn": "BackupPlanArn-00008", 450 | "BackupPlanId": "BackupPlanId-00000", 451 | "CreationDate": "2022-06-03T21:05:53.8239998Z", 452 | "CreatorRequestId": "CreatorRequestId-00001", 453 | "DeletionDate": "0001-01-01T00:00:00", 454 | "LastExecutionDate": "2024-10-02T06:07:16.4709999Z", 455 | "VersionId": "VersionId-00008", 456 | "ResponseMetadata": { 457 | "RequestId": "RequestId-00008", 458 | "Metadata": {}, 459 | "ChecksumAlgorithm": 0, 460 | "ChecksumValidationStatus": 0 461 | }, 462 | "ContentLength": 1004, 463 | "HttpStatusCode": 200, 464 | "Resources": [] 465 | }, 466 | { 467 | "AdvancedBackupSettings": [], 468 | "BackupPlan": { 469 | "AdvancedBackupSettings": [], 470 | "BackupPlanName": "BackupPlanName-00008", 471 | "Rules": [ 472 | { 473 | "CompletionWindowMinutes": 120, 474 | "CopyActions": [ 475 | { 476 | "DestinationBackupVaultArn": "DestinationBackupVaultArn-00000", 477 | "Lifecycle": { 478 | "DeleteAfterDays": 35, 479 | "MoveToColdStorageAfterDays": 0, 480 | "OptInToArchiveForSupportedResources": false 481 | } 482 | } 483 | ], 484 | "EnableContinuousBackup": false, 485 | "Lifecycle": { 486 | "DeleteAfterDays": 35, 487 | "MoveToColdStorageAfterDays": 0, 488 | "OptInToArchiveForSupportedResources": false 489 | }, 490 | "RecoveryPointTags": {}, 491 | "RuleId": "RuleId-00003", 492 | "RuleName": "RuleName-00007", 493 | "ScheduleExpression": "cron(45 16 ? * * *)", 494 | "ScheduleExpressionTimezone": "America/Los_Angeles", 495 | "StartWindowMinutes": 60, 496 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 497 | } 498 | ] 499 | }, 500 | "BackupPlanArn": "BackupPlanArn-00009", 501 | "BackupPlanId": "BackupPlanId-00008", 502 | "CreationDate": "2024-02-23T00:41:54.97Z", 503 | "CreatorRequestId": null, 504 | "DeletionDate": "0001-01-01T00:00:00", 505 | "LastExecutionDate": "2024-10-01T23:47:11.3259999Z", 506 | "VersionId": "VersionId-00009", 507 | "ResponseMetadata": { 508 | "RequestId": "RequestId-00009", 509 | "Metadata": {}, 510 | "ChecksumAlgorithm": 0, 511 | "ChecksumValidationStatus": 0 512 | }, 513 | "ContentLength": 1083, 514 | "HttpStatusCode": 200, 515 | "Resources": [ 516 | "Resources-00005" 517 | ] 518 | }, 519 | { 520 | "AdvancedBackupSettings": [], 521 | "BackupPlan": { 522 | "AdvancedBackupSettings": [], 523 | "BackupPlanName": "BackupPlanName-00009", 524 | "Rules": [ 525 | { 526 | "CompletionWindowMinutes": 10080, 527 | "CopyActions": [], 528 | "EnableContinuousBackup": false, 529 | "Lifecycle": { 530 | "DeleteAfterDays": 2, 531 | "MoveToColdStorageAfterDays": 0, 532 | "OptInToArchiveForSupportedResources": false 533 | }, 534 | "RecoveryPointTags": {}, 535 | "RuleId": "RuleId-00004", 536 | "RuleName": "BackupPlanName-00009", 537 | "ScheduleExpression": "cron(30 0 ? * * *)", 538 | "ScheduleExpressionTimezone": "America/Chicago", 539 | "StartWindowMinutes": 240, 540 | "TargetBackupVaultName": "TargetBackupVaultName-00001" 541 | } 542 | ] 543 | }, 544 | "BackupPlanArn": "BackupPlanArn-00000", 545 | "BackupPlanId": "BackupPlanId-00009", 546 | "CreationDate": "2024-08-20T16:09:01.9579999Z", 547 | "CreatorRequestId": null, 548 | "DeletionDate": "0001-01-01T00:00:00", 549 | "LastExecutionDate": "2024-10-02T06:11:01.4619998Z", 550 | "VersionId": "VersionId-00000", 551 | "ResponseMetadata": { 552 | "RequestId": "RequestId-00000", 553 | "Metadata": {}, 554 | "ChecksumAlgorithm": 0, 555 | "ChecksumValidationStatus": 0 556 | }, 557 | "ContentLength": 897, 558 | "HttpStatusCode": 200, 559 | "Resources": [ 560 | "Resources-00006" 561 | ] 562 | } 563 | ] 564 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_DynamoDB_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Region","TableName","TableId","TableArn","TableSizeBytes","TableStatus","TableSizeGiB","TableSizeTiB","TableSizeGB","TableSizeTB","ItemCount","DeletionProtectionEnabled","GlobalTableVersion","ProvisionedThroughputLastDecreaseDateTime","ProvisionedThroughputLastIncreaseDateTime","ProvisionedThroughput.NumberOfDecreasesToday","ProvisionedThroughputReadCapacityUnits","ProvisionedThroughputWriteCapacityUnits","BackupPlans","InBackupPlan" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","TableName-00000","TableId-00000","TableArn-00000","105","ACTIVE","0","0","0","0","1","False",,"1/1/0001 12:00:00 AM","1/1/0001 12:00:00 AM","0","20","20","","False" 3 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_backup_costs-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Time-Period-Start","Time-Period-End","AWSBackupAmortizedCost","AWSBackupBlendedCost","AWSBackupNetAmortizedCost","AWSBackupNetUnblendedCost","AWSBackupNormalizedUsageAmount","AWSBackupUnblendedCost","AWSBackupUsageQuantity" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","2023-10-01","2023-11-01","$1847.87","$1847.87","$1847.87","$1847.87","0","$1847.87","36957.372" 3 | "AwsAccountId-00000","AwsAccountAlias-00000","2023-11-01","2023-12-01","$1848.03","$1848.03","$1848.03","$1848.03","0","$1848.03","36960.552" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","2023-12-01","2024-01-01","$1847.93","$1847.93","$1847.93","$1847.93","0","$1847.93","36958.547" 5 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-01-01","2024-02-01","$1847.29","$1847.29","$1847.29","$1847.29","0","$1847.29","36945.859" 6 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-02-01","2024-03-01","$1847.59","$1847.59","$1847.59","$1847.59","0","$1847.59","36951.705" 7 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-03-01","2024-04-01","$2023.92","$2023.92","$2023.92","$2023.92","0","$2023.92","40910.509" 8 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-04-01","2024-05-01","$2982.29","$2982.29","$2982.29","$2982.29","0","$2982.29","59645.827" 9 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-05-01","2024-06-01","$1847.59","$1847.59","$1847.59","$1847.59","0","$1847.59","36951.806" 10 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-06-01","2024-07-01","$1846.76","$1846.76","$1846.76","$1846.76","0","$1846.76","36935.145" 11 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-07-01","2024-08-01","$1847.42","$1847.42","$1847.42","$1847.42","0","$1847.42","36948.338" 12 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-08-01","2024-09-01","$1847.21","$1847.21","$1847.21","$1847.21","0","$1847.21","36944.18" 13 | "AwsAccountId-00000","AwsAccountAlias-00000","2024-09-01","2024-10-01","$1847.95","$1847.95","$1847.95","$1847.95","0","$1847.95","36958.979" 14 | "AwsAccountId-00001","AwsAccountAlias-00001","2023-10-01","2023-11-01","$0","$0","$0","$0","0","$0","0" 15 | "AwsAccountId-00001","AwsAccountAlias-00001","2023-11-01","2023-12-01","$0","$0","$0","$0","0","$0","0" 16 | "AwsAccountId-00001","AwsAccountAlias-00001","2023-12-01","2024-01-01","$0","$0","$0","$0","0","$0","0" 17 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-01-01","2024-02-01","$0","$0","$0","$0","0","$0","0" 18 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-02-01","2024-03-01","$0","$0","$0","$0","0","$0","0" 19 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-03-01","2024-04-01","$0","$0","$0","$0","0","$0","0" 20 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-04-01","2024-05-01","$0","$0","$0","$0","0","$0","0" 21 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-05-01","2024-06-01","$0","$0","$0","$0","0","$0","0" 22 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-06-01","2024-07-01","$0","$0","$0","$0","0","$0","0" 23 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-07-01","2024-08-01","$0","$0","$0","$0","0","$0","0" 24 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-08-01","2024-09-01","$0","$0","$0","$0","0","$0","0" 25 | "AwsAccountId-00001","AwsAccountAlias-00001","2024-09-01","2024-10-01","$0","$0","$0","$0","0","$0","0" 26 | "AwsAccountId-00002","AwsAccountAlias-00002","2023-10-01","2023-11-01","$0","$0","$0","$0","0","$0","0" 27 | "AwsAccountId-00002","AwsAccountAlias-00002","2023-11-01","2023-12-01","$0","$0","$0","$0","0","$0","0" 28 | "AwsAccountId-00002","AwsAccountAlias-00002","2023-12-01","2024-01-01","$0","$0","$0","$0","0","$0","0" 29 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-01-01","2024-02-01","$0","$0","$0","$0","0","$0","0" 30 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-02-01","2024-03-01","$0","$0","$0","$0","0","$0","0" 31 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-03-01","2024-04-01","$0","$0","$0","$0","0","$0","0" 32 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-04-01","2024-05-01","$0","$0","$0","$0","0","$0","0" 33 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-05-01","2024-06-01","$0","$0","$0","$0","0","$0","0" 34 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-06-01","2024-07-01","$0","$0","$0","$0","0","$0","0" 35 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-07-01","2024-08-01","$0","$0","$0","$0","0","$0","0" 36 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-08-01","2024-09-01","$0","$0","$0","$0","0","$0","0" 37 | "AwsAccountId-00002","AwsAccountAlias-00002","2024-09-01","2024-10-01","$0","$0","$0","$0","0","$0","0" 38 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_ec2_instance_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","InstanceId","Name","Volumes","SizeGiB","SizeTiB","SizeGB","SizeTB","Region","InstanceType","Platform","ProductCode","BackupPlans","InBackupPlan","Tag:TagName-00012","Tag:TagName-00010","Tag:TagName-00009","Tag:TagName-00005","Tag:TagName-00020","Tag:TagName-00003","Tag:TagName-00011","Tag:TagName-00014","Tag:TagName-00000","Tag:TagName-00007","Tag:TagName-00004","Tag:TagName-00013","Tag:TagName-00018","Tag:TagName-00006","Tag:TagName-00021","Tag:TagName-00017","Tag:TagName-00002","Tag:TagName-00001","Tag:TagName-00008","Tag:TagName-00019","Tag:TagName-00022","Tag:TagName-00015","Tag:TagName-00023","Tag:TagName-00016" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00000","Name-00000","2","140","0.1367","150.324","0.1503","us-west-2","m4.xlarge",,,"BackupPlanName-00005","True",,,,,,,,,,,,,,,,,,,,,,,, 3 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00001","Name-00001","2","160","0.1562","171.799","0.1718","us-west-2","m5.4xlarge",,"marketplace","BackupPlanName-00005","True",,,,,,,,,,,,,,,,,,,,,,,, 4 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00002","Name-00002","1","8","0.0078","8.59","0.0086","us-west-2","t2.micro",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 5 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00003","Name-00003","1","8","0.0078","8.59","0.0086","us-west-2","t2.micro",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 6 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00004","Name-00004","1","8","0.0078","8.59","0.0086","us-west-2","t2.micro",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 7 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00005","Name-00005","1","32","0.0312","34.36","0.0344","us-west-2","m5a.4xlarge",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 8 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00006","Name-00006","1","200","0.1953","214.748","0.2147","us-west-2","m5a.4xlarge",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 9 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00007","Name-00007","3","3100","3.0273","3328.6","3.3286","us-west-2","m5a.xlarge","Windows",,"","False",,,,,,,,,,,,,,,,,,,,,,,, 10 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00008","Name-00008","1","20","0.0195","21.475","0.0215","us-west-2","m6a.xlarge",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 11 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00009","Name-00009","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00000",,,,,,,,,"TagValue-00001",,,,,, 12 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00000","Name-00000","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00000",,,,,,,,,"TagValue-00001",,,,,, 13 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00001","Name-00001","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00000",,,,,,,,,"TagValue-00001",,,,,, 14 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00002","Name-00002","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00002",,,,,,,,,"TagValue-00001",,,,,, 15 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00003","Name-00003","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00003",,,,,,,,,"TagValue-00001",,,,,, 16 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00004","Name-00004","1","100","0.0977","107.374","0.1074","us-west-2","t3.xlarge",,,"","False",,,,"TagValue-00007",,"TagValue-00005",,,,,"TagValue-00006",,,,,,"TagValue-00004",,,,,,, 17 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00005","Name-00005","4","1751","1.71","1880.122","1.8801","us-west-2","m5.xlarge",,,"","False",,,,"TagValue-00009",,,,,,"TagValue-00008","Name-00005",,,"Name-00005",,,"TagValue-00000",,"TagValue-00001",,,,, 18 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00006","Name-00006","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00000",,,,,,,,,"TagValue-00001",,,,,, 19 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00007","Name-00007","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00003",,,,,,,,,"TagValue-00001",,,,,, 20 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00008","Name-00008","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00002",,,,,,,,,"TagValue-00001",,,,,, 21 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00009","Name-00009","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00002",,,,,,,,,"TagValue-00001",,,,,, 22 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00010","Name-00010","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00003",,,,,,,,,"TagValue-00001",,,,,, 23 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00011","Name-00011","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00002",,,,,,,,,"TagValue-00001",,,,,, 24 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00012","Name-00012","1","8","0.0078","8.59","0.0086","us-west-2","t2.micro",,,"","False",,,"TagValue-00003",,,,,,"TagValue-00004",,,,,,,,,,,,,,, 25 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00013","Name-00013","13","204","0.1992","219.043","0.219","us-west-2","i4i.8xlarge",,,"","False",,,"TagValue-00005","TagValue-00006",,"TagValue-00012",,,"TagValue-00008",,"TagValue-00011",,,,,,"TagValue-00010","TagValue-00007",,,,,, 26 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00014","Name-00014","1","30","0.0293","32.212","0.0322","us-west-2","t2.large","Windows",,"","False",,,,,,,,,,,,,,,,,,,,,,,, 27 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00015","Name-00015","13","204","0.1992","219.043","0.219","us-west-2","i4i.8xlarge",,,"","False",,,"TagValue-00003","TagValue-00013",,"TagValue-00012",,,"TagValue-00008",,"TagValue-00014",,,,,,"TagValue-00010","TagValue-00007",,,,,, 28 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00016","Name-00016","13","204","0.1992","219.043","0.219","us-west-2","i4i.8xlarge",,,"","False",,,,"TagValue-00015",,"TagValue-00012",,,,,"TagValue-00016",,,,,,"TagValue-00010","TagValue-00007",,,,,, 29 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00017","Name-00017","13","204","0.1992","219.043","0.219","us-west-2","i4i.8xlarge",,,"","False",,,,"TagValue-00017",,"TagValue-00012",,,,,"TagValue-00018",,,,,,"TagValue-00010","TagValue-00007",,,,,, 30 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00018","Name-00018","2","48","0.0469","51.54","0.0515","us-west-2","m5.large",,,"","False",,,,"TagValue-00021",,"TagValue-00012",,,,,"TagValue-00019",,,,,,"TagValue-00022","TagValue-00020",,,,,, 31 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00019","Name-00019","1","8","0.0078","8.59","0.0086","us-west-2","t2.micro",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 32 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00020","Name-00020","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00023",,,,,,,,,"TagValue-00001",,,,,, 33 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00021","Name-00021","1","32","0.0312","34.36","0.0344","us-west-2","m5a.4xlarge",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 34 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00022","Name-00022","1","25","0.0244","26.844","0.0268","us-west-2","t2.micro",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 35 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00023","Name-00023","2","900","0.8789","966.368","0.9664","us-west-2","m6i.4xlarge",,"marketplace","","False",,,,,,,,,"TagValue-00024",,,,,,,,,"TagValue-00001",,,,,, 36 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00024","Name-00024","2","912","0.8906","979.253","0.9793","us-west-2","m5.4xlarge",,"marketplace","","False",,,,,,,,,,,,,,,,,,,,,,,, 37 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00025","Name-00025","1","30","0.0293","32.212","0.0322","us-west-2","t3.medium","Windows",,"","False",,,,,,,,,,,,,,,,,,,,,,,, 38 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00026","Name-00026","1","80","0.0781","85.899","0.0859","us-west-2","m5.large",,,"","False","TagValue-00029","TagValue-00027","TagValue-00030","TagValue-00026",,"TagValue-00012","TagValue-00031",,,"TagValue-00028","TagValue-00025","TagValue-00030",,"TagValue-00027",,,,"TagValue-00032","TagValue-00029",,,,, 39 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00027","Name-00027","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 40 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00028","Name-00028","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 41 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00029","Name-00029","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 42 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00030","Name-00030","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 43 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00031","Name-00031","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 44 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00032","Name-00032","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 45 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00033","Name-00033","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 46 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00034","Name-00034","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 47 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00035","Name-00035","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 48 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00036","Name-00036","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 49 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00037","Name-00037","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 50 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00038","Name-00038","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 51 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00039","Name-00039","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 52 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00040","Name-00040","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 53 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00041","Name-00041","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 54 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00042","Name-00042","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 55 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00043","Name-00043","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 56 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00044","Name-00044","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 57 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00045","Name-00045","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 58 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00046","Name-00046","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 59 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00047","Name-00047","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 60 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00048","Name-00048","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 61 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00049","Name-00049","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 62 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00050","Name-00050","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 63 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00051","Name-00051","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 64 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00052","Name-00052","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 65 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00053","Name-00053","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 66 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00054","Name-00054","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 67 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00055","Name-00055","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 68 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00056","Name-00056","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 69 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00057","Name-00057","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 70 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00058","Name-00058","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 71 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00059","Name-00059","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 72 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00060","Name-00060","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 73 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00061","Name-00061","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 74 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00062","Name-00062","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 75 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00063","Name-00063","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 76 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00064","Name-00064","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 77 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00065","Name-00065","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 78 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00066","Name-00066","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 79 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00067","Name-00067","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 80 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00068","Name-00068","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 81 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00069","Name-00069","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 82 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00070","Name-00070","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 83 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00071","Name-00071","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 84 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00072","Name-00072","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 85 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00073","Name-00073","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 86 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00074","Name-00074","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 87 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00075","Name-00075","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 88 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00076","Name-00076","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 89 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00077","Name-00077","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 90 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00078","Name-00078","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 91 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00079","Name-00079","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 92 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00080","Name-00080","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 93 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00081","Name-00081","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 94 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00082","Name-00082","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 95 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00083","Name-00083","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 96 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00084","Name-00084","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 97 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00085","Name-00085","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 98 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00086","Name-00086","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 99 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00087","Name-00087","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 100 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00088","Name-00088","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 101 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00089","Name-00089","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 102 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00090","Name-00090","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 103 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00091","Name-00091","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 104 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00092","Name-00092","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 105 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00093","Name-00093","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 106 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00094","Name-00094","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 107 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00095","Name-00095","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 108 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00096","Name-00096","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 109 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00097","Name-00097","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 110 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00098","Name-00098","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 111 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00099","Name-00099","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 112 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00000","Name-00000","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 113 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00001","Name-00001","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 114 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00002","Name-00002","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 115 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00003","Name-00003","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 116 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00004","Name-00004","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 117 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00005","Name-00005","2","108","0.1055","115.964","0.116","us-west-2","m4.large",,,"","False",,,,,,,,"TagValue-00033",,,,,,,,,,,,,,,, 118 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00006","Name-00006","1","20","0.0195","21.475","0.0215","us-west-2","t3a.medium",,,"","False",,,,"TagValue-00038",,"TagValue-00040",,,,,"TagValue-00039",,"TagValue-00041",,,"TagValue-00036","TagValue-00034","TagValue-00037",,,,"TagValue-00012",,"TagValue-00035" 119 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00007","Name-00026","1","80","0.0781","85.899","0.0859","us-west-2","m5.large",,,"","False","TagValue-00029","TagValue-00027","TagValue-00030","TagValue-00026",,"TagValue-00012","TagValue-00031",,,"TagValue-00028","TagValue-00042","TagValue-00030",,"TagValue-00027",,,,"TagValue-00032","TagValue-00029",,,,, 120 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00008","Name-00007","1","20","0.0195","21.475","0.0215","us-east-2","t4g.medium",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 121 | "AwsAccountId-00000","AwsAccountAlias-00000","InstanceId-00009","Name-00008","1","30","0.0293","32.212","0.0322","us-east-2","t3.medium","Windows",,"","False",,,,,,,,,,,,,,,,,,,,,,,, 122 | "AwsAccountId-00001","AwsAccountAlias-00001","InstanceId-00010","Name-00009","1","100","0.0977","107.374","0.1074","us-west-1","c5.large",,"marketplace","","False",,,,,,,,,,,,,,,,,,,,,,,, 123 | "AwsAccountId-00001","AwsAccountAlias-00001","InstanceId-00011","Name-00010","1","8","0.0078","8.59","0.0086","us-east-2","t2.micro",,,"","False",,,,,,,,,,,,,,,,,,,,,,,, 124 | "AwsAccountId-00002","AwsAccountAlias-00002","InstanceId-00012","Name-00011","1","60","0.0586","64.425","0.0644","us-east-2","m5.4xlarge",,,"","False",,,,,"TagValue-00045","TagValue-00012","TagValue-00049",,,,,,,"TagValue-00044","TagValue-00046",,,"TagValue-00047",,"TagValue-00030","AwsAccountAlias-00002",,"TagValue-00048", 125 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_ec2_unattached_volume_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","VolumeId","Name","SizeGiB","SizeTiB","SizeGB","SizeTB","Region","VolumeType","BackupPlans","InBackupPlan","Tag:TagName-00024","Tag:TagName-00028","Tag:TagName-00025","Tag:TagName-00001","Tag:TagName-00021","Tag:TagName-00026","Tag:TagName-00029","Tag:TagName-00027" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00000","","200","0.1953","214.748","0.2147","us-west-2","gp3","","False",,,,,,,, 3 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00001","","8","0.0078","8.59","0.0086","us-west-2","gp2","","False","TagValue-00051","TagValue-00055","TagValue-00052","TagValue-00043","TagValue-00050","TagValue-00053",,"TagValue-00054" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00002","","8","0.0078","8.59","0.0086","us-west-2","gp2","","False","TagValue-00056","TagValue-00058","TagValue-00057","TagValue-00043","TagValue-00050","TagValue-00053",,"TagValue-00054" 5 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00003","","8","0.0078","8.59","0.0086","us-west-2","gp2","","False","TagValue-00060","TagValue-00061","TagValue-00059","TagValue-00043","TagValue-00050","TagValue-00053",,"TagValue-00054" 6 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00004","","8","0.0078","8.59","0.0086","us-west-2","gp2","","False","TagValue-00064","TagValue-00062","TagValue-00063","TagValue-00043","TagValue-00050","TagValue-00053",,"TagValue-00054" 7 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00005","","8","0.0078","8.59","0.0086","us-west-2","gp2","","False","TagValue-00066","TagValue-00065","TagValue-00067","TagValue-00043","TagValue-00050","TagValue-00053",,"TagValue-00054" 8 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00006","","100","0.0977","107.374","0.1074","us-west-2","gp3","","False",,,,,,,"TagValue-00068", 9 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00007","","100","0.0977","107.374","0.1074","us-west-2","gp3","","False",,,,,,,"TagValue-00069", 10 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00008","","500","0.4883","536.871","0.5369","us-west-2","gp3","","False",,,,,,,"TagValue-00070", 11 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00009","Name-00012","125","0.1221","134.218","0.1342","us-west-2","gp2","","False",,,,,,,, 12 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00000","Name-00013","1024","1","1099.512","1.0995","us-west-2","gp3","","False",,,,,,,, 13 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00001","","1024","1","1099.512","1.0995","us-west-2","gp3","","False",,,,,,,, 14 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00002","Name-00014","4096","4","4398.047","4.398","us-west-2","gp3","","False",,,,,,,, 15 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00003","Name-00015","5500","5.3711","5905.58","5.9056","us-west-2","gp3","","False",,,,,,,, 16 | "AwsAccountId-00000","AwsAccountAlias-00000","VolumeId-00004","","512","0.5","549.756","0.5498","us-west-2","gp3","","False",,,,,,,, 17 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_efs_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","FileSystemId","FileSystemProtection","Name","SizeInBytes","SizeGiB","SizeTiB","SizeGB","SizeTB","NumberOfMountTargets","OwnerId","PerformanceMode","ProvisionedThroughputInMibps","DBInstanceIdentifier","Region","ThroughputMode","BackupPlans","InBackupPlan","Tag:TagName-00030" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","FileSystemId-00000","ENABLED","Name-00016","3945266585600","3674.3158","3.5882","3945.2666","3.9453","3","AwsAccountId-00000","generalPurpose","0",,"us-west-2","elastic","","False", 3 | "AwsAccountId-00000","AwsAccountAlias-00000","FileSystemId-00001","DISABLED","Name-00017","4310760134656","4014.7082","3.9206","4310.7601","4.3108","3","AwsAccountId-00000","generalPurpose","0",,"us-west-2","elastic","","False", 4 | "AwsAccountId-00000","AwsAccountAlias-00000","FileSystemId-00002","ENABLED","Name-00018","112618481664","104.8841","0.1024","112.6185","0.1126","1","AwsAccountId-00000","generalPurpose","0",,"us-west-2","elastic","","False", 5 | "AwsAccountId-00001","AwsAccountAlias-00001","FileSystemId-00003","ENABLED","Name-00019","6144","0","0","0","0","3","AwsAccountId-00001","generalPurpose","0",,"us-west-2","bursting","","False","TagValue-00071" 6 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_eks_clusters_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Name","Version","PlatformVersion","Status","Arn","RoleArn","Region","Tag:TagName-00004","Tag:TagName-00031","Tag:TagName-00005","Tag:TagName-00032","Tag:TagName-00033","Tag:TagName-00002","Tag:TagName-00034","Tag:TagName-00035" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","TagValue-00027","1.30","eks.7","ACTIVE","Arn-00000","RoleArn-00000","us-west-2","TagValue-00072","TagValue-00027","TagValue-00073","TagValue-00027","TagValue-00074","TagValue-00075","TagValue-00076","TagValue-00077" 3 | "AwsAccountId-00000","AwsAccountAlias-00000","Name-00020","1.27","eks.22","ACTIVE","Arn-00001","RoleArn-00001","us-east-2",,,,,,,, 4 | "AwsAccountId-00001","AwsAccountAlias-00001","Name-00021","1.29","eks.12","ACTIVE","Arn-00002","RoleArn-00002","us-east-2",,,,,,,, 5 | "AwsAccountId-00001","AwsAccountAlias-00001","Name-00022","1.27","eks.22","ACTIVE","Arn-00003","RoleArn-00003","us-east-2",,,,,,,, 6 | "AwsAccountId-00002","AwsAccountAlias-00002","TagValue-00044","1.29","eks.12","ACTIVE","Arn-00004","RoleArn-00004","us-east-2",,,,,,,, 7 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_eks_nodegroups_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","NodegroupName","ClusterName","DiskSize","CapacityType","AmiType","NodegroupArn","NodeRole","Status","ReleaseVersion","Version","Region","Tag:TagName-00004","Tag:TagName-00031","Tag:TagName-00008","Tag:TagName-00032","Tag:TagName-00002","Tag:TagName-00005","Tag:TagName-00034" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","TagValue-00029","TagValue-00027","0","ON_DEMAND","AL2_x86_64","NodegroupArn-00000","NodeRole-00000","ACTIVE","1.30.2-20240817","1.30","us-west-2","TagValue-00087","TagValue-00027","TagValue-00029","TagValue-00027","TagValue-00089","TagValue-00026","TagValue-00076" 3 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_fsx_filesystem_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Region","FileSystemId","FileSystemDNSName","FileSystemType","FileSystemTypeVersion","FileSystemOwnerId","FileSystemStorageType","Name","OnTapType","WindowsType","LustreType","OpenZFSType","StorageCapacityBytes","StorageCapacityGiB","StorageCapacityTiB","StorageCapacityGB","StorageCapacityTB","StorageUsedBytes","StorageUsedGiB","StorageUsedTiB","StorageUsedGB","StorageUsedTB","StorageCapacityUtilizationPercentage" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","FileSystemId-00004",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00023","True","False","False","False","23622320128000","22000","21.4844","23622.3201","23.6223","10731064958976","9994.083","9.7598","10731.065","10.7311", 3 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","FileSystemId-00005","FileSystemDNSName-00000","WINDOWS",,"AwsAccountId-00000","SSD","Name-00024","False","True","False","False","107374182400","100","0.0977","107.3742","0.1074",,,,,,"0.1064453125" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","FileSystemId-00006",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00025","True","False","False","False","1099511627776","1024","1","1099.5116","1.0995","114094080","0.1063","0.0001","0.1141","0.0001", 5 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_fsx_volume_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Region","FileSystemId","FileSystemDNSName","FileSystemType","FileSystemTypeVersion","FileSystemOwnerId","FileSystemStorageType","Name","VolumeId","VolumeType","LifeCycle","StorageUsedBytes","StorageUsedGiB","StorageUsedTiB","StorageUsedGB","StorageUsedTB","StorageCapacityBytes","StorageCapacityGiB","StorageCapacityTiB","StorageCapacityGB","StorageCapacityTB","BackupPlans","InBackupPlan" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","FileSystemId-00004",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00026","VolumeId-00005","ONTAP","CREATED","12020182388736","11194.6672","10.9323","12020.1824","12.0202","21990232555520","20480","20","21990.2326","21.9902","","False" 3 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","FileSystemId-00004",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00027","VolumeId-00006","ONTAP","CREATED","67203072","0.0626","0.0001","0.0672","0.0001","1073741824","1","0.001","1.0737","0.0011","","False" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","FileSystemId-00004",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00028","VolumeId-00007","ONTAP","CREATED","67178496","0.0626","0.0001","0.0672","0.0001","1073741824","1","0.001","1.0737","0.0011","","False" 5 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","FileSystemId-00004",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00029","VolumeId-00008","ONTAP","CREATED","557760512","0.5195","0.0005","0.5578","0.0006","10737418240","10","0.0098","10.7374","0.0107","","False" 6 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","FileSystemId-00006",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00026","VolumeId-00009","ONTAP","CREATED","54980018176","51.2041","0.05","54.98","0.055","1099511627776","1024","1","1099.5116","1.0995","","False" 7 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","FileSystemId-00006",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00030","VolumeId-00010","ONTAP","CREATED","5373775872","5.0047","0.0049","5.3738","0.0054","107374182400","100","0.0977","107.3742","0.1074","","False" 8 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","FileSystemId-00006",,"ONTAP",,"AwsAccountId-00000","SSD","Name-00027","VolumeId-00011","ONTAP","CREATED","56098816","0.0522","0.0001","0.0561","0.0001","1073741824","1","0.001","1.0737","0.0011","","False" 9 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_kms_numbers-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Region","Keys" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","24" 3 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","10" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","us-east-1","17" 5 | "AwsAccountId-00000","AwsAccountAlias-00000","us-east-2","13" 6 | "AwsAccountId-00001","AwsAccountAlias-00001","us-west-2","24" 7 | "AwsAccountId-00001","AwsAccountAlias-00001","us-west-1","10" 8 | "AwsAccountId-00001","AwsAccountAlias-00001","us-east-1","17" 9 | "AwsAccountId-00001","AwsAccountAlias-00001","us-east-2","13" 10 | "AwsAccountId-00002","AwsAccountAlias-00002","us-west-2","24" 11 | "AwsAccountId-00002","AwsAccountAlias-00002","us-west-1","10" 12 | "AwsAccountId-00002","AwsAccountAlias-00002","us-east-1","17" 13 | "AwsAccountId-00002","AwsAccountAlias-00002","us-east-2","13" 14 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_rds_info-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","DBName","DBInstanceIdentifier","SizeGiB","SizeTiB","SizeGB","SizeTB","Region","InstanceType","Engine","EngineVersion","DBInstanceStatus","BackupPlans","InBackupPlan","BackupRetentionPeriod","PreferredBackupWindow","StorageType" 2 | "AwsAccountId-00000","AwsAccountAlias-00000",,"DBInstanceIdentifier-00000","20","0.0195","21.475","0.0215","us-west-2","db.m6i.xlarge","sqlserver-web","15.00.4236.7.v1","available","","False","7","07:08-07:38","gp2" 3 | "AwsAccountId-00000","AwsAccountAlias-00000",,"DBInstanceIdentifier-00001","20","0.0195","21.475","0.0215","us-east-2","db.t3.micro","sqlserver-ex","15.00.4385.2.v1","available","","False","7","08:12-08:42","gp3" 4 | "AwsAccountId-00001","AwsAccountAlias-00001",,"DBInstanceIdentifier-00002","1","0.001","1.074","0.0011","us-east-1","db.serverless","aurora-postgresql","15.4","available","","False","7","03:13-03:43","aurora" 5 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_secrets_numbers-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Region","Secrets" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","2" 3 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","0" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","us-east-1","0" 5 | "AwsAccountId-00000","AwsAccountAlias-00000","us-east-2","1" 6 | "AwsAccountId-00001","AwsAccountAlias-00001","us-west-2","2" 7 | "AwsAccountId-00001","AwsAccountAlias-00001","us-west-1","0" 8 | "AwsAccountId-00001","AwsAccountAlias-00001","us-east-1","0" 9 | "AwsAccountId-00001","AwsAccountAlias-00001","us-east-2","1" 10 | "AwsAccountId-00002","AwsAccountAlias-00002","us-west-2","2" 11 | "AwsAccountId-00002","AwsAccountAlias-00002","us-west-1","0" 12 | "AwsAccountId-00002","AwsAccountAlias-00002","us-east-1","0" 13 | "AwsAccountId-00002","AwsAccountAlias-00002","us-east-2","1" 14 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/aws_sqs_numbers-example.csv: -------------------------------------------------------------------------------- 1 | "AwsAccountId","AwsAccountAlias","Region","Queues" 2 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-2","2" 3 | "AwsAccountId-00000","AwsAccountAlias-00000","us-west-1","0" 4 | "AwsAccountId-00000","AwsAccountAlias-00000","us-east-1","15" 5 | "AwsAccountId-00000","AwsAccountAlias-00000","us-east-2","0" 6 | "AwsAccountId-00001","AwsAccountAlias-00001","us-west-2","2" 7 | "AwsAccountId-00001","AwsAccountAlias-00001","us-west-1","0" 8 | "AwsAccountId-00001","AwsAccountAlias-00001","us-east-1","15" 9 | "AwsAccountId-00001","AwsAccountAlias-00001","us-east-2","0" 10 | "AwsAccountId-00002","AwsAccountAlias-00002","us-west-2","2" 11 | "AwsAccountId-00002","AwsAccountAlias-00002","us-west-1","0" 12 | "AwsAccountId-00002","AwsAccountAlias-00002","us-east-1","15" 13 | "AwsAccountId-00002","AwsAccountAlias-00002","us-east-2","0" 14 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_backup_vault_VM_SQL_items-example.csv: -------------------------------------------------------------------------------- 1 | "Tenant","Subscription","Region","ResourceGroup","FriendlyName","ServerName","ParentName","ParentType","LastBackupErrorDetail","ProtectedItemDataSourceId","ProtectedItemHealthStatus","ProtectionStatus","PolicyId","ProtectionState","LastBackupStatus","LastBackupTime","ProtectionPolicyName","ExtendedInfo","DateOfPurge","DeleteState","Name","Id","LatestRecoveryPoint","SourceResourceId","WorkloadType","ContainerName","ContainerType","BackupManagementType" 2 | "Tenant-1","subscription-1","westus2","ResoruceGroup-1","azbp0_db7","windows-azbp0","MSSQLSERVER","AzureVmWorkloadSQLInstance",,"7661449799016875264","Healthy","Healthy","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResoruceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupPolicies/SQLPolicy","Protected","Healthy","12/20/2023 7:15:59AM","SQLPolicy",,,"NotDeleted","SQLDataBase;mssqlserver;azbp0_db7","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResoruceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;RG-azbp-sqlvm;windows-azbp0/protectedItems/SQLDataBase;mssqlserver;azbp0_db7",,"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/RG-azbp-sqlvm/providers/Microsoft.Compute/virtualMachines/windows-azbp0","MSSQL","VMAppContainer;compute;RG-azbp-sqlvm;windows-azbp0","AzureVMAppContainer","AzureWorkload" 3 | "Tenant-1","subscription-1","westus2","ResoruceGroup-1","model","windows-azbp0","MSSQLSERVER","AzureVmWorkloadSQLInstance",,"7661449799211396532","Healthy","Healthy","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResoruceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupPolicies/SQLPolicy","Protected","Healthy","12/20/2023 7:13:59AM","SQLPolicy",,,"NotDeleted","SQLDataBase;mssqlserver;model","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResoruceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;RG-azbp-sqlvm;windows-azbp0/protectedItems/SQLDataBase;mssqlserver;model",,"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/RG-azbp-sqlvm/providers/Microsoft.Compute/virtualMachines/windows-azbp0","MSSQL","VMAppContainer;compute;RG-azbp-sqlvm;windows-azbp0","AzureVMAppContainer","AzureWorkload" 4 | "Tenant-1","subscription-2","westus2","ResoruceGroup-1","azbp0_db6","windows-azbp0","MSSQLSERVER","AzureVmWorkloadSQLInstance",,"7661449799483830392","Healthy","Healthy","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResoruceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupPolicies/SQLPolicy","Protected","Healthy","12/20/2023 7:15:59AM","SQLPolicy",,,"NotDeleted","SQLDataBase;mssqlserver;azbp0_db6","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResoruceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;RG-azbp-sqlvm;windows-azbp0/protectedItems/SQLDataBase;mssqlserver;azbp0_db6",,"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/RG-azbp-sqlvm/providers/Microsoft.Compute/virtualMachines/windows-azbp0","MSSQL","VMAppContainer;compute;RG-azbp-sqlvm;windows-azbp0","AzureVMAppContainer","AzureWorkload" -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_backup_vault_VM_SQL_policies-example.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Tenant": "Tenant-1", 4 | "Subscription": "subscription-1", 5 | "Region": "eastus", 6 | "ResourceGroup": "ResourceGroup-1", 7 | "ProtectedItemsCount": 0, 8 | "IsCompression": false, 9 | "IsDifferentialBackupEnabled": false, 10 | "IsLogBackupEnabled": true, 11 | "FullBackupSchedulePolicy": { 12 | "ScheduleRunFrequency": 1, 13 | "ScheduleRunDays": null, 14 | "ScheduleRunTimes": [ 15 | "2023-06-30T07:00:00Z" 16 | ], 17 | "ScheduleInterval": null, 18 | "ScheduleWindowStartTime": null, 19 | "ScheduleWindowDuration": null, 20 | "ScheduleRunTimeZone": "UTC" 21 | }, 22 | "DifferentialBackupSchedulePolicy": null, 23 | "LogBackupSchedulePolicy": { 24 | "ScheduleFrequencyInMins": 60 25 | }, 26 | "FullBackupRetentionPolicy": { 27 | "IsDailyScheduleEnabled": true, 28 | "IsWeeklyScheduleEnabled": false, 29 | "IsMonthlyScheduleEnabled": false, 30 | "IsYearlyScheduleEnabled": false, 31 | "DailySchedule": { 32 | "DurationCountInDays": 30, 33 | "RetentionTimes": [ 34 | "2023-06-30T07:00:00Z" 35 | ], 36 | "BackupManagementType": "" 37 | }, 38 | "WeeklySchedule": null, 39 | "MonthlySchedule": null, 40 | "YearlySchedule": null, 41 | "BackupManagementType": "" 42 | }, 43 | "DifferentialBackupRetentionPolicy": null, 44 | "LogBackupRetentionPolicy": { 45 | "RetentionDurationType": 1, 46 | "RetentionCount": 30 47 | }, 48 | "FullBackupTieringPolicy": null, 49 | "Name": "HourlyLogBackup", 50 | "WorkloadType": 4, 51 | "Id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupPolicies/HourlyLogBackup", 52 | "BackupManagementType": 6 53 | }, 54 | { 55 | "Tenant": "Tenant-1", 56 | "Subscription": "subscription-1", 57 | "Region": "centralus", 58 | "ResourceGroup": "EngResourceGroupWestUS2", 59 | "ProtectedItemsCount": 0, 60 | "IsCompression": false, 61 | "IsDifferentialBackupEnabled": false, 62 | "IsLogBackupEnabled": true, 63 | "FullBackupSchedulePolicy": { 64 | "ScheduleRunFrequency": 1, 65 | "ScheduleRunDays": null, 66 | "ScheduleRunTimes": [ 67 | "2021-03-10T06:00:00Z" 68 | ], 69 | "ScheduleInterval": null, 70 | "ScheduleWindowStartTime": null, 71 | "ScheduleWindowDuration": null, 72 | "ScheduleRunTimeZone": "UTC" 73 | }, 74 | "DifferentialBackupSchedulePolicy": null, 75 | "LogBackupSchedulePolicy": { 76 | "ScheduleFrequencyInMins": 60 77 | }, 78 | "FullBackupRetentionPolicy": { 79 | "IsDailyScheduleEnabled": true, 80 | "IsWeeklyScheduleEnabled": false, 81 | "IsMonthlyScheduleEnabled": false, 82 | "IsYearlyScheduleEnabled": false, 83 | "DailySchedule": { 84 | "DurationCountInDays": 30, 85 | "RetentionTimes": [ 86 | "2021-03-10T06:00:00Z" 87 | ], 88 | "BackupManagementType": "" 89 | }, 90 | "WeeklySchedule": null, 91 | "MonthlySchedule": null, 92 | "YearlySchedule": null, 93 | "BackupManagementType": "" 94 | }, 95 | "DifferentialBackupRetentionPolicy": null, 96 | "LogBackupRetentionPolicy": { 97 | "RetentionDurationType": 1, 98 | "RetentionCount": 30 99 | }, 100 | "FullBackupTieringPolicy": null, 101 | "Name": "HourlyLogBackup", 102 | "WorkloadType": 4, 103 | "Id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/EngResourceGroupWestUS2/providers/Microsoft.RecoveryServices/vaults/vault-2/backupPolicies/HourlyLogBackup", 104 | "BackupManagementType": 6 105 | } 106 | ] -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_backup_vault_VM_items-example.csv: -------------------------------------------------------------------------------- 1 | "Tenant","Subscription","Region","ResourceGroup","VirtualMachineId","HealthStatus","IsInclusionList","DiskLunList","ProtectionStatus","PolicyId","ProtectionState","LastBackupStatus","LastBackupTime","ProtectionPolicyName","ExtendedInfo","DateOfPurge","DeleteState","Name","Id","LatestRecoveryPoint","SourceResourceId","WorkloadType","ContainerName","ContainerType","BackupManagementType" 2 | "Tenant-1","subscription-1","westus","ResourceGroup-1","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.Compute/virtualMachines/vm-1","Passed",,,"Healthy","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupPolicies/DailyPolicy","Protected","Completed","7/22/2018 6:08:31AM","DailyPolicy",,,"NotDeleted","VM;iaasvmcontainerv2;vault-1;vm-1","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;vault-1;vm-1/protectedItems/VM;iaasvmcontainerv2;vault-1;vm-1","7/22/2018 6:08:36AM","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.Compute/virtualMachines/vm-1","AzureVM","iaasvmcontainerv2;vault-1;vm-1","AzureVM","AzureVM" 3 | "Tenant-1","subscription-1","westus","ResoruceGroup-1","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.Compute/virtualMachines/vm-2","Passed",,,"Healthy","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupPolicies/DefaultPolicy","Protected","Completed","5/16/2017 11:10:29AM","DefaultPolicy",,,"NotDeleted","VM;iaasvmcontainerv2;vault-1;vm-2","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/vault-1/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;vault-1;vm-2/protectedItems/VM;iaasvmcontainerv2;vault-1;vm-2","5/16/2017 11:10:34AM","/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.Compute/virtualMachines/vm-2","AzureVM","iaasvmcontainerv2;vault-1;vm-2","AzureVM","AzureVM" 4 | "Tenant-2","subscription-2","westus2","ResoruceGroup-2","/subscriptions/12345678-1234-1234-1234-12345678abcd/resourceGroups/ResourceGroup-2/providers/Microsoft.Compute/virtualMachines/vm-3","Passed",,,"Healthy","/subscriptions/12345678-1234-1234-1234-12345678abcd/resourceGroups/ResourceGroup-2/providers/Microsoft.RecoveryServices/vaults/vault-3/backupPolicies/tco-scenario-1","Protected","Completed","12/19/2023 6:41:49AM","tco-scenario-1",,,"NotDeleted","VM;iaasvmcontainerv2;vault-2;vm-3","/subscriptions/12345678-1234-1234-1234-12345678abcd/resourceGroups/ResourceGroup-2/providers/Microsoft.RecoveryServices/vaults/vault-3/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;vault-2;vm-3/protectedItems/VM;iaasvmcontainerv2;vault-2;vm-3","12/20/2023 6:35:00AM","/subscriptions/12345678-1234-1234-1234-12345678abcd/resourceGroups/ResourceGroup-2/providers/Microsoft.Compute/virtualMachines/vm-3","AzureVM","iaasvmcontainerv2;vault-2;vm-3","AzureVM","AzureVM" 5 | "Tenant-2","subscription-3","westus2","ResourceGroup-3","/subscriptions/12345678-1234-1234-1234-12345678ef12/resourceGroups/ResourceGroup-3/providers/Microsoft.Compute/virtualMachines/vm-4","Passed",,,"Healthy","/subscriptions/12345678-1234-1234-1234-12345678ef12/resourceGroups/ResourceGroup-3/providers/Microsoft.RecoveryServices/vaults/vault-4/backupPolicies/tco-scenario-2","Protected","Completed","12/20/2023 3:33:32AM","tco-scenario-2",,,"NotDeleted","VM;iaasvmcontainerv2;vault-3;vm-4","/subscriptions/12345678-1234-1234-1234-12345678ef12/resourceGroups/ResourceGroup-3/providers/Microsoft.RecoveryServices/vaults/vault-4/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;vault-3;vm-4/protectedItems/VM;iaasvmcontainerv2;vault-3;vm-4","12/20/2023 3:33:37AM","/subscriptions/12345678-1234-1234-1234-12345678ef12/resourceGroups/ResourceGroup-3/providers/Microsoft.Compute/virtualMachines/vm-4","AzureVM","iaasvmcontainerv2;vault-3;vm-4","AzureVM","AzureVM" -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_backup_vault_VM_policies-example.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Tenant": "Tenant-1", 4 | "Subscription": "subscription-1", 5 | "Region": "eastus", 6 | "ResourceGroup": "ResourceGroup-1", 7 | "SnapshotRetentionInDays": 2, 8 | "ProtectedItemsCount": 0, 9 | "AzureBackupRGName": null, 10 | "AzureBackupRGNameSuffix": null, 11 | "PolicySubType": 1, 12 | "TieringPolicy": null, 13 | "SchedulePolicy": { 14 | "ScheduleRunFrequency": 1, 15 | "ScheduleRunDays": null, 16 | "ScheduleRunTimes": [ 17 | "2023-06-30T07:00:00Z" 18 | ], 19 | "ScheduleInterval": null, 20 | "ScheduleWindowStartTime": null, 21 | "ScheduleWindowDuration": null, 22 | "ScheduleRunTimeZone": "UTC" 23 | }, 24 | "RetentionPolicy": { 25 | "IsDailyScheduleEnabled": true, 26 | "IsWeeklyScheduleEnabled": false, 27 | "IsMonthlyScheduleEnabled": false, 28 | "IsYearlyScheduleEnabled": false, 29 | "DailySchedule": { 30 | "DurationCountInDays": 30, 31 | "RetentionTimes": [ 32 | "2023-06-30T07:00:00Z" 33 | ], 34 | "BackupManagementType": "AzureIaasVM" 35 | }, 36 | "WeeklySchedule": null, 37 | "MonthlySchedule": null, 38 | "YearlySchedule": null, 39 | "BackupManagementType": "AzureIaasVM" 40 | }, 41 | "Name": "DefaultPolicy", 42 | "WorkloadType": 1, 43 | "Id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/Site-recovery-vault-eastus/backupPolicies/DefaultPolicy", 44 | "BackupManagementType": 1 45 | }, 46 | { 47 | "Tenant": "Tenant-1", 48 | "Subscription": "subscription-1", 49 | "Region": "eastus", 50 | "ResourceGroup": "ResourceGroup-1", 51 | "SnapshotRetentionInDays": 2, 52 | "ProtectedItemsCount": 0, 53 | "AzureBackupRGName": null, 54 | "AzureBackupRGNameSuffix": null, 55 | "PolicySubType": 2, 56 | "TieringPolicy": null, 57 | "SchedulePolicy": { 58 | "ScheduleRunFrequency": 3, 59 | "HourlySchedule": { 60 | "Interval": 4, 61 | "WindowStartTime": "2023-06-30T08:00:00Z", 62 | "WindowDuration": 12 63 | }, 64 | "DailySchedule": null, 65 | "WeeklySchedule": null, 66 | "ScheduleRunTimeZone": "UTC" 67 | }, 68 | "RetentionPolicy": { 69 | "IsDailyScheduleEnabled": true, 70 | "IsWeeklyScheduleEnabled": false, 71 | "IsMonthlyScheduleEnabled": false, 72 | "IsYearlyScheduleEnabled": false, 73 | "DailySchedule": { 74 | "DurationCountInDays": 30, 75 | "RetentionTimes": [ 76 | "2023-06-30T08:00:00Z" 77 | ], 78 | "BackupManagementType": "AzureIaasVM" 79 | }, 80 | "WeeklySchedule": null, 81 | "MonthlySchedule": null, 82 | "YearlySchedule": null, 83 | "BackupManagementType": "AzureIaasVM" 84 | }, 85 | "Name": "EnhancedPolicy", 86 | "WorkloadType": 1, 87 | "Id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/ResourceGroup-1/providers/Microsoft.RecoveryServices/vaults/Site-recovery-vault-eastus/backupPolicies/EnhancedPolicy", 88 | "BackupManagementType": 1 89 | } 90 | ] 91 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_backup_vault_info-example.csv: -------------------------------------------------------------------------------- 1 | "Name","Type","Tenant","Subscription","Region","ResourceGroup","ProvisioningState","CrossSubscriptionRestoreState","ImmutabilitySettings" 2 | "Vault-1","Microsoft.RecoveryServices/vaults","Tenant-1","subscription-1","eastus","Site-recovery-vault-RG","Succeeded","Enabled", 3 | "Vault-2","Microsoft.RecoveryServices/vaults","Tenant-1","subscription-1","centralus","Site-recovery-vault-RG","Succeeded","Enabled", 4 | "Vault-3","Microsoft.RecoveryServices/vaults","Tenant-2","subscription-2","westus","Site-recovery-vault-RG-2","Succeeded","Enabled", -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_file_share_info-example.csv: -------------------------------------------------------------------------------- 1 | "Name","StorageAccount","Tenant","Subscription","Region","ResourceGroup","QuotaGiB","UsedCapacityBytes","UsedCapacityGiB","UsedCapacityGB" 2 | "azure-file-share-1","storage-account-1","tenant-1","subscription-1","eastus2","resoruce-group-1","5120","0","0","0" 3 | "azure-file-share-2","storage-account-2","tenant-1","subscription-1","westus","cloud-shell-storage-westus","6","5368709120","5","5.369" 4 | "azure-file-share-3","storage-account-3","tenant-1","subscription-2","westus","cloud-shell-storage-westus","6","5368709120","5","5.369" -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_sql_info-example.csv: -------------------------------------------------------------------------------- 1 | "Database","Server","ElasticPool","ManagedInstance","MaxSizeGiB","MaxSizeGB","Subscription","Region","ResourceGroup","DatabaseID","InstanceType","Status" 2 | "","","az-tong-pool","","32","34.36","se_roadrunner_perf_lab","eastus2","rg-lumnah-test","","GP_Gen5", 3 | "az-tong-sql1","az-lumnah-test","","","48","51.54","se_roadrunner_perf_lab","eastus2","rg-lumnah-test","8c49b71e-bef1-4d0d-8862-ab7734bac126","GP_Gen5","Online" 4 | "lumnah-test-db","az-lumnah-test","","","32","34.36","se_roadrunner_perf_lab","eastus2","rg-lumnah-test","c6147218-cd06-4d8b-b9b3-b4df4e312878","GP_S_Gen5","Paused" 5 | "","","","az-tong-managedinstance","64","68.719","se_roadrunner_perf_lab","westus3","rp-stong-cc-westus","","GP_Gen5", 6 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/azure_vmdisk_info-example.csv: -------------------------------------------------------------------------------- 1 | "Name","Disks","SizeGiB","SizeGB","Subscription","Tenant","Region","ResourceGroup","vmID","InstanceType","Status","HasMSSQL" 2 | "azure-vm-1","1","30","32.212","subscription-1","tenant-1","centralus","resource-group-1","fc0c344d-88c9-4cdc-9a80-e00c4c4d5933","Standard_DS1_v2","OK","No" 3 | "azure-vm-2","2","286","307.09","subscription-1","tenant-1","centralus","resource-group-1","1764c58f-3b92-4407-9f4e-249fa80e29ff","Standard_D16lds_v5","OK","No" 4 | "azure-vm-3","2","912","979.253","subscription-1","tenant-1","centralus","resource-group-1","3453ff2c-7d13-4fc3-bbe2-883aa3f3d700","Standard_D16s_v5","OK","No" 5 | "azure-sql-vm-1","3","2175","2335.388","subscription-1","tenant-1","centralus","resource-group-1","4cf4a4e4-d86d-48c5-911e-56f5b0c4ff33","Standard_E8bds_v5","OK","Yes" 6 | "azure-sql-vm-2","2","383","411.243","subscription-1","tenant-1","centralus","resource-group-1","d4f93fd6-c4e4-4205-9df1-7c65581aece1","Standard_D4s_v3","OK","No" 7 | -------------------------------------------------------------------------------- /CLOUD/EXAMPLES/gce_vmdisk_info-example.csv: -------------------------------------------------------------------------------- 1 | VM,NumDisks,SizeGiB,SizeTiB,SizeGB,SizeTB,Project,Status 2 | gcp-native-instance-1,1,10,0.0097656,10.737,0.0107370,se-lab-185822,RUNNING 3 | gcp-native-instance-1-fqts6,1,10,0.0097656,10.737,0.0107370,se-lab-185822,TERMINATED -------------------------------------------------------------------------------- /CLOUD/Get-AWSSizingInfo-Permissions.cft: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Description: Create a cross-account role to run Rubrik's Sizing Script using StackSets 3 | 4 | Parameters: 5 | ScriptAWSAccountId: 6 | Type: String 7 | Description: The AWS account ID where the Rubrik Sizing Script is run from. 8 | AllowedPattern: '^\d{12}$' 9 | ConstraintDescription: 'The Script AWS Account ID must be a 12-digit number.' 10 | 11 | RoleName: 12 | Type: String 13 | Default: 'RubrikSizingScripts' 14 | Description: Name of the AWS IAM role to create 15 | AllowedPattern: '^[a-zA-Z0-9+=,.@_-]+$' 16 | ConstraintDescription: 'The role name can only contain alphanumeric characters and the following: +=,.@_-' 17 | 18 | Resources: 19 | CrossAccountRole: 20 | Type: 'AWS::IAM::Role' 21 | Properties: 22 | RoleName: !Ref RoleName 23 | AssumeRolePolicyDocument: 24 | Version: '2012-10-17' 25 | Statement: 26 | - Effect: 'Allow' 27 | Principal: 28 | AWS: 29 | - !Sub 'arn:aws:iam::${ScriptAWSAccountId}:root' 30 | Action: 'sts:AssumeRole' 31 | Policies: 32 | - PolicyName: 'RubrikSizingScriptPolicy' 33 | PolicyDocument: 34 | Version: '2012-10-17' 35 | Statement: 36 | - Sid: 'VisualEditor0' 37 | Effect: 'Allow' 38 | Action: 39 | - 'backup:ListBackupPlans' 40 | - 'backup:ListBackupSelections' 41 | - 'backup:GetBackupPlan' 42 | - 'backup:GetBackupSelection' 43 | - 'ce:GetCostAndUsage' 44 | - 'cloudwatch:GetMetricStatistics' 45 | - 'cloudwatch:ListMetrics' 46 | - 'dynamodb:ListTables' 47 | - 'dynamodb:DescribeTable' 48 | - 'ec2:DescribeInstances' 49 | - 'ec2:DescribeRegions' 50 | - 'ec2:DescribeVolumes' 51 | - 'eks:DescribeCluster' 52 | - 'eks:ListClusters' 53 | - 'eks:ListNodegroups' 54 | - 'elasticfilesystem:DescribeFileSystems' 55 | - 'fsx:DescribeFileSystems' 56 | - 'fsx:DescribeVolumes' 57 | - 'iam:ListAccountAliases' 58 | - 'kms:ListKeys' 59 | - 'organizations:ListAccounts' 60 | - 'rds:DescribeDBInstances' 61 | - 's3:GetBucketLocation' 62 | - 's3:ListAllMyBuckets' 63 | - 's3:GetBucketTagging' 64 | - 'secretsmanager:ListSecrets' 65 | - 'sts:AssumeRole' 66 | - 'sqs:ListQueues' 67 | Resource: '*' 68 | 69 | Outputs: 70 | RoleARN: 71 | Description: The ARN of the created cross-account role 72 | Value: !GetAtt CrossAccountRole.Arn 73 | -------------------------------------------------------------------------------- /CLOUD/Get-GCPSizingInfo.ps1: -------------------------------------------------------------------------------- 1 | #requires -Version 7.0 2 | #requires -Modules GoogleCloud 3 | 4 | # https://build.rubrik.com 5 | 6 | <# 7 | .SYNOPSIS 8 | Gets all GCE VMs with the # of attached disks and total sizes of all disks. 9 | 10 | .DESCRIPTION 11 | The 'Get-GCPSizingInfo.ps1' script gets all GCE VMs and GCE Disk in the specified projects. 12 | For each GCE VM it grabs the total number of disks and total size (GiB) for all disks. 13 | A summary of the total # of VMs, # of disks, and capacity will be output to console. 14 | 15 | A CSV file will be exported with the details along with a log file. Send the resulting 16 | zip file to Rubrik for analysis. 17 | 18 | Pass a comma separated list of projects or a CSV file containing the project names 19 | If no project IDs are specified then it will run in the current config context. 20 | 21 | To run this script the following permissions are required by the user in GCP on all 22 | projects: 23 | 24 | - compute.instances.list 25 | - compute.disks.get 26 | - resourcemanager.projects.get 27 | 28 | This script can be run in one of two ways: 29 | 30 | 1) The first method of running the script is from the Google Cloud Shell. This is the 31 | easiest method, however, may not work for large numbers of projects. If there are 32 | more than 100 or so projects the Google Cloud shell may time out when running this 33 | script. In that case the second method will need to be used. 34 | 35 | To run this script in the Google Cloud shell do the following: 36 | 37 | a) Open a new Google Cloud Shell in the Google Console 38 | b) Test access by running the commands: 39 | 40 | - gcloud auth list 41 | - gcloud config list 42 | - gcloud projects list 43 | - Get-GcpProject | select name,projectid 44 | 45 | c) Upload this script to the Google Cloud Shell by selecting the ellipses and Upload. 46 | d) Run the script as described in the examples or help. 47 | The script will run with the users credentials 48 | that logged into the Cloud Shell. This user must have the permissions that are 49 | discussed above. 50 | 51 | 2) The second method of running this script is from a local laptop or a server. This method 52 | may be necessary if the Google Cloud Shell times out while running this script. To 53 | Run this script from a local laptop or console, do the following: 54 | 55 | a) Install Powershell 7 56 | b) Install the gcloud tool (see https://cloud.google.com/sdk/docs/install for more 57 | details). 58 | c) Install the GoogleCloud Powershell module by running the following command 59 | from inside Powershell 7: 60 | 61 | - Install-Module GoogleCloud 62 | 63 | See: https://cloud.google.com/tools/powershell/docs/quickstart for more details 64 | d) Run: gcloud init 65 | e) Run: gcloud auth login 66 | Login with a user that has the permissions that are discussed above. 67 | f) Test access by running the commands: 68 | 69 | - gcloud auth list 70 | - gcloud config list 71 | - gcloud projects list 72 | - Get-GcpProject | select name,projectid 73 | 74 | g) Run this script as described in the examples or help. 75 | for more information on installing the Powershell GoogleCloud Module and the 76 | gcloud application. 77 | 78 | .NOTES 79 | Written by Steven Tong for community usage 80 | GitHub: stevenctong 81 | Date: 11/9/21 82 | Updated: 2/24/22 83 | 84 | .EXAMPLE 85 | Get all GCE VMs and associated disk info and output to a CSV file. 86 | 87 | PS> ./Get-GCPSizingInfo.ps1 88 | 89 | .EXAMPLE 90 | For a provided list of projects, get all GCE VMs and associated disk info and output to a CSV file. 91 | PS> ./Get-GCPSizingInfo.ps1 -Projects 'projectA,projectB' 92 | 93 | .EXAMPLE 94 | For a provided list of projects, get all GCE VMs and associated disk info and output to a CSV file. 95 | PS> ./Get-GCPSizingInfo.ps1 -ProjectFile 'projectFile.txt' 96 | #> 97 | 98 | [CmdletBinding(DefaultParameterSetName = 'GetAllProjects')] 99 | param ( 100 | 101 | # Get all all projects 102 | [Parameter(ParameterSetName='GetAllProjects', 103 | Mandatory=$false)] 104 | [ValidateNotNullOrEmpty()] 105 | [switch]$GetAllProjects, 106 | 107 | # Pass in comma separated list of projects 108 | [Parameter(ParameterSetName='Projects', 109 | Mandatory=$true)] 110 | [ValidateNotNullOrEmpty()] 111 | [string]$Projects, 112 | 113 | # Pass pass in a file with a list of projects separated by line breaks, no header required 114 | [Parameter(ParameterSetName='ProjectFile', 115 | Mandatory=$true)] 116 | [ValidateNotNullOrEmpty()] 117 | [string]$ProjectFile, 118 | 119 | # Option to anonymize the output files. 120 | [Parameter(Mandatory=$false)] 121 | [switch]$Anonymize, 122 | 123 | # Choose to anonymize additional fields 124 | [Parameter(Mandatory=$false)] 125 | [ValidateNotNullOrEmpty()] 126 | [string]$AnonymizeFields, 127 | 128 | # Choose to not anonymize certain fields 129 | [Parameter(Mandatory=$false)] 130 | [ValidateNotNullOrEmpty()] 131 | [string]$NotAnonymizeFields 132 | ) 133 | 134 | # Save the current culture so it can be restored later 135 | $CurrentCulture = [System.Globalization.CultureInfo]::CurrentCulture 136 | 137 | # Set the culture to en-US; this is to ensure that output to CSV is written properly 138 | [System.Threading.Thread]::CurrentThread.CurrentCulture = 'en-US' 139 | [System.Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US' 140 | 141 | try{ 142 | $date = Get-Date 143 | $date_string = $($date.ToString("yyyy-MM-dd_HHmmss")) 144 | 145 | $output_log = "output_gcp_$date_string.log" 146 | 147 | if (Test-Path "./$output_log") { 148 | Remove-Item -Path "./$output_log" 149 | } 150 | 151 | if($Anonymize){ 152 | "Anonymized file; customer has original. Request customer to sanitize and provide output log if needed" > $output_log 153 | $log_for_anon_customers = "output_gcp_not_anonymized_$date_string.log" 154 | Start-Transcript -Path "./$log_for_anon_customers" 155 | } else{ 156 | Start-Transcript -Path "./$output_log" 157 | } 158 | 159 | Write-Host "Arguments passed to $($MyInvocation.MyCommand.Name):" -ForeGroundColor Green 160 | $PSBoundParameters | Format-Table 161 | 162 | # Filename of the CSV output 163 | $outputVM = "gce_vm_info-$date_string.csv" 164 | $outputAttachedDisks = "gce_attached_disk_info-$date_string.csv" 165 | $outputUnattachedDisks = "gce_unattached_disk_info-$date_string.csv" 166 | 167 | $archiveFile = "gcp_sizing_results_$date_string.zip" 168 | 169 | # List of output files 170 | $outputFiles = @( 171 | $outputVM, 172 | $outputAttachedDisks, 173 | $outputUnattachedDisks, 174 | $output_log 175 | ) 176 | 177 | # Clear out variable in case it exists 178 | $projectList = '' 179 | 180 | # If a file is provided containing the list of files, then import the file 181 | if ($projectFile -ne '') 182 | { 183 | $projectFileContents = Get-Content -Path $ProjectFile 184 | $projectList = @() 185 | foreach ($project in $projectFileContents) 186 | { 187 | try { 188 | $projectList += Get-GcpProject -ProjectId $project 189 | } catch { 190 | Write-Host "Failed to get project $project" -foregroundcolor red 191 | Write-Host "Error: $_" -foregroundcolor red 192 | } 193 | } 194 | } elseif ($projects -ne '') 195 | { 196 | # Else if a comma separated list of projects was provided on the command line, use that 197 | $projectList = @() 198 | foreach ($project in $projects.split(',')) { 199 | try { 200 | $projectList += Get-GcpProject -ProjectId $project 201 | } catch { 202 | Write-Host "Failed to get project $project" -foregroundcolor red 203 | Write-Host "Error: $_" -foregroundcolor red 204 | } 205 | } 206 | } else { 207 | Write-Host "No project list provided, discovering all GCP projects accessible to the authenticated account..." -ForegroundColor green 208 | $projectList = @() 209 | try{ 210 | $projectList = Get-GcpProject 211 | } catch { 212 | Write-Host "Failed to get projects" -foregroundcolor Red 213 | Write-Host "Error: $_" -foregroundcolor Red 214 | } 215 | } 216 | 217 | $instanceList = New-Object collections.arraylist 218 | $attachedDiskList = New-Object collections.arraylist 219 | $unattachedDiskList = New-Object collections.arraylist 220 | # Loop through each project and grab the VM and disk info 221 | $projectCounter = 1 222 | foreach ($project in $projectList) 223 | { 224 | Write-Progress -ID 1 -Activity "Processing project: $($project.ProjectId)" -Status "Project: $($projectCounter) of $($projectList.Count)" -PercentComplete (($projectCounter / $projectList.Count) * 100) 225 | $projectCounter++ 226 | $instanceInfo = $null 227 | try{ 228 | $instanceInfo = Get-GceInstance -Project $($project.ProjectId) 229 | 230 | } catch { 231 | Write-Host "Failed to get instances in project $($project.ProjectId)" -ForeGroundColor Red 232 | Write-Host $_ -foregroundcolor red 233 | } 234 | 235 | $instanceCounter = 1 236 | foreach ($instance in $instanceInfo) { 237 | Write-Progress -ID 2 -Activity "Processing GCE VM Instance: $($instance.Name)" -Status "Project: $($instanceCounter) of $($instanceInfo.Count)" -PercentComplete (($instanceCounter / $instanceInfo.Count) * 100) 238 | $instanceCounter++ 239 | 240 | $diskCount = 0 241 | $diskSizeGb = 0 242 | $numDiskEncryption = 0 243 | $sizeEncryptedDisksGb = 0 244 | 245 | foreach($disk in $instance.Disks){ 246 | $diskInfo = Get-GceDisk -Project $($project.ProjectId) -DiskName $($disk.Source.split('/')[-1]) 247 | $diskObj = [PSCustomObject] @{ 248 | "Project" = $($project.ProjectId) 249 | "Zone" = $diskInfo.Zone.split('/')[-1] 250 | "VMName" = $instance.Name 251 | "DiskName" = $diskInfo.Name 252 | "Id" = $diskInfo.Id 253 | "SizeGb" = $diskInfo.SizeGb 254 | "SizeTb" = $diskInfo.SizeGb / 1000 255 | "DiskEncryptionKey" = $diskInfo.DiskEncryptionKey 256 | "SourceImageSource" = $null 257 | "SourceImageName" = $null 258 | } 259 | if($diskInfo.SourceImage -ne $null){ 260 | $diskObj.SourceImageSource = $diskInfo.SourceImage.split('/')[-4] 261 | $diskObj.SourceImageName = $diskInfo.SourceImage.split('/')[-1] 262 | } 263 | 264 | $tagCounter = 0 265 | foreach($key in $diskInfo.Labels.Keys){ 266 | $value = $diskInfo.Labels.Values.Split('\n')[$tagCounter] 267 | $key = $key -replace '[^a-zA-Z0-9]', '_' 268 | $diskObj | Add-Member -MemberType NoteProperty -Name "Label/Tag: $key" -Value $value -Force 269 | $tagCounter++ 270 | } 271 | 272 | $diskCount++ 273 | $diskSizeGb += $diskInfo.SizeGb 274 | if($diskInfo.DiskEncryptionKey){ 275 | $numDiskEncryption++ 276 | $sizeEncryptedDisksGb += $diskInfo.SizeGb 277 | } 278 | 279 | $attachedDiskList.Add($diskObj) | Out-Null 280 | 281 | } 282 | 283 | $instanceObj = [PSCustomObject] @{ 284 | "Project" = $($project.ProjectId) 285 | "Zone" = $instance.Zone.split('/')[-1] 286 | "Name" = $instance.Name 287 | "TotalDiskCount" = $diskCount 288 | "TotalDiskSizeGb" = $diskSizeGb 289 | "TotalDiskSizeTb" = $diskSizeGb / 1000 290 | "EncryptedDisksCount" = $numDiskEncryption 291 | "EncryptedDisksSizeGb" = $sizeEncryptedDisksGb 292 | "EncryptedDisksSizeTb" = $sizeEncryptedDisksGb / 1000 293 | "Status" = $vm.Status 294 | } 295 | $tagCounter = 0 296 | foreach($key in $instance.Labels.Keys){ 297 | $value = $instance.Labels.Values.Split('\n')[$tagCounter] 298 | $key = $key -replace '[^a-zA-Z0-9]', '_' 299 | $instanceObj | Add-Member -MemberType NoteProperty -Name "Label/Tag: $key" -Value $value -Force 300 | $tagCounter++ 301 | } 302 | 303 | $instanceList.Add($instanceObj) | Out-Null 304 | 305 | } 306 | Write-Progress -ID 2 -Activity "Processing GCE VM Instance: $($instance.Name)" -Completed 307 | 308 | $allDisks = $null 309 | try{ 310 | $allDisks = Get-GceDisk -Project $($project.ProjectId) 311 | } catch{ 312 | Write-Host "Failed to get disks in project $($project.ProjectId)" -foregroundcolor red 313 | Write-Host $_ -foregroundcolor red 314 | } 315 | 316 | $diskCounter = 1 317 | foreach($disk in $allDisks){ 318 | Write-Progress -ID 3 -Activity "Processing disk: $($disk.Name)" -Status "Disk: $($diskCounter) of $($allDisks.Count)" -PercentComplete (($diskCounter / $allDisks.Count) * 100) 319 | $diskCounter++ 320 | if ($disk.Users -eq $null){ 321 | $diskObj = [PSCustomObject] @{ 322 | "Project" = $($project.ProjectId) 323 | "Zone" = $disk.Zone.split('/')[-1] 324 | "DiskName" = $disk.Name 325 | "Id" = $disk.Id 326 | "SizeGb" = $disk.SizeGb 327 | "SizeTb" = $disk.SizeGb / 1000 328 | "DiskEncryptionKey" = $disk.DiskEncryptionKey 329 | "SourceImageSource" = $null 330 | "SourceImageName" = $null 331 | } 332 | if($disk.SourceImage -ne $null){ 333 | $diskObj.SourceImageSource = $disk.SourceImage.split('/')[-4] 334 | $diskObj.SourceImageName = $disk.SourceImage.split('/')[-1] 335 | } 336 | $tagCounter = 0 337 | foreach($key in $disk.Labels.Keys){ 338 | $value = $disk.Labels.Values.Split('\n')[$tagCounter] 339 | $key = $key -replace '[^a-zA-Z0-9]', '_' 340 | $diskObj | Add-Member -MemberType NoteProperty -Name "Label/Tag: $key" -Value $value -Force 341 | $tagCounter++ 342 | } 343 | $unattachedDiskList.Add($diskObj) | Out-Null 344 | } 345 | } 346 | Write-Progress -ID 3 -Activity "Processing disk: $($disk.Name)" -Completed 347 | } 348 | Write-Progress -ID 1 -Activity "Processing project: $($project)" -Completed 349 | 350 | function addTagsToAllObjectsInList($list) { 351 | # Determine all unique tag keys 352 | $allTagKeys = @{} 353 | foreach ($obj in $list) { 354 | $properties = $obj.PSObject.Properties 355 | foreach ($property in $properties) { 356 | if (-not $allTagKeys.ContainsKey($property.Name)) { 357 | $allTagKeys[$property.Name] = $true 358 | } 359 | } 360 | } 361 | 362 | $allTagKeys = $allTagKeys.Keys 363 | 364 | # Ensure each object has all possible tag keys 365 | foreach ($obj in $list) { 366 | foreach ($key in $allTagKeys) { 367 | if (-not $obj.PSObject.Properties.Name.Contains($key)) { 368 | $obj | Add-Member -MemberType NoteProperty -Name $key -Value $null -Force 369 | } 370 | } 371 | } 372 | } 373 | 374 | 375 | if ($Anonymize) { 376 | $global:anonymizeProperties = @("Name", "Project", "VMName", "DiskName", "Id", "DiskEncryptionKey") 377 | 378 | if($AnonymizeFields){ 379 | [string[]]$anonFieldsList = $AnonymizeFields.split(',') 380 | foreach($field in $anonFieldsList){ 381 | if (-not $global:anonymizeProperties.Contains($field)) { 382 | $global:anonymizeProperties += $field 383 | } 384 | } 385 | } 386 | if($NotAnonymizeFields){ 387 | [string[]]$notAnonFieldsList = $NotAnonymizeFields.split(',') 388 | $global:anonymizeProperties = $global:anonymizeProperties | Where-Object { $_ -notin $notAnonFieldsList } 389 | } 390 | 391 | $global:anonymizeDict = @{} 392 | $global:anonymizeCounter = @{} 393 | 394 | function Get-NextAnonymizedValue ($anonField) { 395 | $charSet = "0123456789" 396 | $base = $charSet.Length 397 | $newValue = "" 398 | if (-not $global:anonymizeCounter.ContainsKey($anonField)) { 399 | $global:anonymizeCounter[$anonField] = 0 400 | } 401 | $global:anonymizeCounter[$anonField]++ 402 | 403 | $counter = $global:anonymizeCounter[$anonField] 404 | while ($counter -gt 0) { 405 | $counter-- 406 | $newValue = $charSet[$counter % $base] + $newValue 407 | $counter = [math]::Floor($counter / $base) 408 | } 409 | 410 | $paddedValue = $newValue.PadLeft(5, '0') 411 | 412 | return "$($anonField)-$($paddedValue)" 413 | } 414 | 415 | function Anonymize-Data { 416 | param ( 417 | [PSObject]$DataObject 418 | ) 419 | 420 | foreach ($property in $DataObject.PSObject.Properties) { 421 | $propertyName = $property.Name 422 | $shouldAnonymize = $global:anonymizeProperties -contains $propertyName -or $propertyName -like "Tag:*" 423 | 424 | if ($shouldAnonymize) { 425 | $originalValue = $DataObject.$propertyName 426 | 427 | if ($null -ne $originalValue) { 428 | if(($originalValue -is [System.Collections.IEnumerable] -and -not ($originalValue -is [string])) ){ 429 | # This is to handle the anonymization of list objects 430 | $anonymizedCollection = @() 431 | foreach ($item in $originalValue) { 432 | if (-not $global:anonymizeDict.ContainsKey("$item")) { 433 | $global:anonymizeDict["$item"] = Get-NextAnonymizedValue($propertyName) 434 | } 435 | $anonymizedCollection += $global:anonymizeDict["$item"] 436 | } 437 | $DataObject.$propertyName = $anonymizedCollection 438 | } else{ 439 | if (-not $global:anonymizeDict.ContainsKey("$($originalValue)")) { 440 | $global:anonymizeDict[$originalValue] = Get-NextAnonymizedValue($propertyName) 441 | } 442 | $DataObject.$propertyName = $global:anonymizeDict[$originalValue] 443 | } 444 | } 445 | } 446 | elseif ($propertyName -like "Label/Tag:*") { 447 | # Must anonymize both the tag name and value 448 | 449 | $tagValue = $DataObject.$propertyName 450 | $anonymizedTagKey = "" 451 | 452 | $tagName = $propertyName.Substring(10) 453 | 454 | if (-not $global:anonymizeDict.ContainsKey("$tagName")) { 455 | $global:anonymizeDict["$tagName"] = Get-NextAnonymizedValue("Label/TagName") 456 | } 457 | $anonymizedTagKey = 'Label/Tag:' + $global:anonymizeDict["$tagName"] 458 | 459 | $anonymizedTagValue = $null 460 | if ($null -ne $tagValue) { 461 | if (-not $global:anonymizeDict.ContainsKey("$($tagValue)")) { 462 | $global:anonymizeDict[$tagValue] = Get-NextAnonymizedValue("Label/TagValue")#$anonymizedTagKey 463 | } 464 | $anonymizedTagValue = $global:anonymizeDict[$tagValue] 465 | } 466 | $DataObject.PSObject.Properties.Remove($propertyName) 467 | $DataObject | Add-Member -MemberType NoteProperty -Name $anonymizedTagKey -Value $anonymizedTagValue -Force 468 | } 469 | elseif ($property.Value -is [PSObject]) { 470 | $DataObject.$propertyName = Anonymize-Data -DataObject $property.Value 471 | } 472 | elseif ($property.Value -is [System.Collections.IEnumerable] -and -not ($property.Value -is [string])) { 473 | $anonymizedCollection = @() 474 | foreach ($item in $property.Value) { 475 | if ($item -is [PSObject]) { 476 | $anonymizedItem = Anonymize-Data -DataObject $item 477 | $anonymizedCollection += $anonymizedItem 478 | } else { 479 | $anonymizedCollection += $item 480 | } 481 | } 482 | $DataObject.$propertyName = $anonymizedCollection 483 | } 484 | } 485 | 486 | return $DataObject 487 | } 488 | 489 | function Anonymize-Collection { 490 | param ( 491 | [System.Collections.IEnumerable]$Collection 492 | ) 493 | 494 | $anonymizedCollection = @() 495 | foreach ($item in $Collection) { 496 | if ($item -is [PSObject]) { 497 | $anonymizedItem = Anonymize-Data -DataObject $item 498 | $anonymizedCollection += $anonymizedItem 499 | } else { 500 | $anonymizedCollection += $item 501 | } 502 | } 503 | 504 | return $anonymizedCollection 505 | } 506 | 507 | $instanceList = Anonymize-Collection -Collection $instanceList 508 | $attachedDiskList = Anonymize-Collection -Collection $attachedDiskList 509 | $unattachedDiskList = Anonymize-Collection -Collection $unattachedDiskList 510 | } 511 | 512 | $totalGB = ($attachedDiskList.sizeGb | Measure -Sum).sum + ($unattachedDiskList.sizeGb | Measure -Sum).sum 513 | $totalTB = ($attachedDiskList.sizeTb | Measure -Sum).sum + ($unattachedDiskList.sizeTb | Measure -Sum).sum 514 | 515 | Write-Host 516 | Write-Host "Total # of GCE VMs: $($instanceList.count)" -foregroundcolor green 517 | Write-Host "Total # of attached disks: $($attachedDiskList.count)" -foregroundcolor green 518 | Write-Host "Total # of unattached disks: $($unattachedDiskList.count)" -foregroundcolor green 519 | Write-Host "Total capacity of all disks: $totalGB GB or $totalTB TB" -foregroundcolor green 520 | 521 | # Export to CSV 522 | Write-Host 523 | addTagsToAllObjectsInList($instanceList) 524 | Write-Host "CSV file output to: $outputVM" -foregroundcolor green 525 | $instanceList | Export-CSV -path $outputVM 526 | Write-Host 527 | addTagsToAllObjectsInList($attachedDiskList) 528 | Write-Host "CSV file output to: $outputAttachedDisks" -foregroundcolor green 529 | $attachedDiskList | Export-CSV -path $outputAttachedDisks 530 | Write-Host 531 | addTagsToAllObjectsInList($unattachedDiskList) 532 | Write-Host "CSV file output to: $outputUnattachedDisks" -foregroundcolor green 533 | $unattachedDiskList | Export-CSV -path $outputUnattachedDisks 534 | 535 | Write-Host 536 | Write-Host 537 | Write-Host "Results will be compressed into $archiveFile and original files will be removed." -ForegroundColor Green 538 | 539 | if($Anonymize){ 540 | # Exporting as rows as new value - old value 541 | $transformedDict = $global:anonymizeDict.GetEnumerator() | ForEach-Object { 542 | [PSCustomObject]@{ 543 | AnonymizedValue = $_.Value 544 | ActualValue = $_.Key 545 | } 546 | } | Sort-Object -Property AnonymizedValue 547 | 548 | $anonKeyValuesFileName = "gcp_anonymized_keys_to_actual_values-$date_string.csv" 549 | 550 | $transformedDict | Export-CSV -Path $anonKeyValuesFileName 551 | Write-Host 552 | Write-Host "Provided anonymized keys to actual values in the CSV: $anonKeyValuesFileName" -ForeGroundColor Cyan 553 | Write-Host "Provided log file here: $log_for_anon_customers" -ForegroundColor Cyan 554 | Write-Host "These files are not part of the zip file generated" -ForegroundColor Cyan 555 | Write-Host 556 | } 557 | 558 | } catch { 559 | Write-Error "An error occurred and the script has exited prematurely:" 560 | Write-Error $_ 561 | Write-Error $_.ScriptStackTrace 562 | } finally { 563 | Stop-Transcript 564 | } 565 | 566 | # In the case of an early exit/error, this filters only the files which exist 567 | $existingFiles = $outputFiles | Where-Object { Test-Path $_ } 568 | 569 | # Compress the files into a zip archive 570 | Compress-Archive -Path $existingFiles -DestinationPath $archiveFile 571 | 572 | # Remove the original files 573 | foreach ($file in $outputFiles) { 574 | Remove-Item -Path $file -ErrorAction SilentlyContinue 575 | } 576 | 577 | Write-Host 578 | Write-Host 579 | Write-Host "Results have been compressed into $archiveFile and original files have been removed." -ForegroundColor Green 580 | 581 | [System.Threading.Thread]::CurrentThread.CurrentCulture = $CurrentCulture 582 | [System.Threading.Thread]::CurrentThread.CurrentUICulture = $CurrentCulture 583 | 584 | Write-Host 585 | Write-Host 586 | Write-Host "Please send $archiveFile to your Rubrik representative" -ForegroundColor Cyan 587 | Write-Host -------------------------------------------------------------------------------- /CLOUD/README.md: -------------------------------------------------------------------------------- 1 | # Cloud Sizing Scripts README 2 | 3 | This contains information about Rubrik scripts for collecting sizing information for resources across AWS, Azure, and GCP. Below you will find detailed instructions on setting up prerequisites, running the scripts, and understanding their functionalities, including the anonymization feature. 4 | 5 | ## Table of Contents 6 | 7 | 1. [Introduction](#introduction) 8 | 2. [AWS](#aws) 9 | - [Prerequisites](#aws-prerequisites) 10 | - [Running the Script](#running-the-aws-script) 11 | 3. [Azure](#azure) 12 | - [Prerequisites](#azure-prerequisites) 13 | - [Running the Script](#running-the-azure-script) 14 | 4. [GCP](#gcp) 15 | - [Prerequisites](#gcp-prerequisites) 16 | - [Running the Script](#running-the-gcp-script) 17 | 5. [Anonymization Feature](#anonymization-feature) 18 | 6. [FAQ](#faq) 19 | 20 | --- 21 | 22 | ## Introduction 23 | 24 | This repository contains scripts designed to collect and report on cloud resources across AWS, Azure, and GCP. These scripts help gather essential sizing data which will be used for scaling and pricing Rubrik solutions. 25 | 26 | --- 27 | 28 | ## AWS 29 | 30 | ### Authenticaition 31 | 32 | 1. Use the local AWS profile (IAM user) to login to just one account. 33 | 1. Use a list of local AWS profiles to login to and query multiple accounts. 34 | 1. Use a cross account role with a list of AWS accounts that you provide to assume role into each account. 35 | 1. Use a cross account role with an AWS Org and have the script automatically discover all of your accounts and query each one. 36 | 1. Have the script query AWS SSO for a list of accounts. Each account will be accessed via the AWS SSO parameter set that is specified. 37 | 38 | 39 | 40 | ### AWS Prerequisites 41 | 42 | To run the AWS sizing script, ensure you have the following: 43 | 44 | - PowerShell 7.4.5 or higher 45 | - AWS PowerShell modules installed: 46 | - An AWS account with the necessary permissions. 47 | - The following AWS permissions are required to run the script: 48 | ```json 49 | { 50 | "Version": "2012-10-17", 51 | "Statement": [ 52 | { 53 | "Sid": "VisualEditor0", 54 | "Effect": "Allow", 55 | "Action": [ 56 | "backup:ListBackupPlans", 57 | "backup:ListBackupSelections", 58 | "backup:GetBackupPlan", 59 | "backup:GetBackupSelection", 60 | "ce:GetCostAndUsage", 61 | "cloudwatch:GetMetricStatistics", 62 | "cloudwatch:ListMetrics", 63 | "dynamodb:ListTables", 64 | "dynamodb:DescribeTable", 65 | "ec2:DescribeInstances", 66 | "ec2:DescribeRegions", 67 | "ec2:DescribeVolumes", 68 | "eks:DescribeCluster", 69 | "eks:ListClusters", 70 | "eks:ListNodegroups", 71 | "elasticfilesystem:DescribeFileSystems", 72 | "fsx:DescribeFileSystems", 73 | "fsx:DescribeVolumes", 74 | "iam:ListAccountAliases", 75 | "kms:ListKeys", 76 | "organizations:ListAccounts", 77 | "rds:DescribeDBInstances", 78 | "s3:GetBucketLocation", 79 | "s3:ListAllMyBuckets", 80 | "s3:GetBucketTagging", 81 | "secretsmanager:ListSecrets", 82 | "sts:AssumeRole", 83 | "sqs:ListQueues" 84 | ], 85 | "Resource": "*" 86 | } 87 | ] 88 | } 89 | ``` 90 | - These permissions can be installed in a cross account role by using the [Get-AWSSizingInfo-Permissions.cft](Get-AWSSizingInfo-Permissions.cft) CloudFormation template. This cross account role can be installed in multiple AWS accounts by using a [CloudFormation Stack Set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html). 91 | 92 | ### Running the AWS Script 93 | 94 | There are two options for running the AWS sizing script. It can run from the AWS Cloud Shell (easiest) or from a local laptop or server (more difficult). For very large environments where the script may run longer than 20-30 minutes, running the script on a laptop or server may be necessary. This is due to the Cloud Shell's default inactivity timeout. 95 | 96 | To run the script from the AWS Cloud Shell do the following: 97 | 98 | 1. Open [AWS Cloud Shell](https://docs.aws.amazon.com/cloudshell/latest/userguide/welcome.html) in an AWS account with a profile to run the script. 99 | 1. Start PowerShell by running: 100 | ```shell 101 | pwsh 102 | ``` 103 | 104 | To run the script from a local laptop or server do the following: 105 | 106 | 1. Verify that PowerShell v7.4.5 or higher is installed. 107 | 1. Install the AWS modules for PowerShell with the following command: 108 | ```powershell 109 | Install-Module AWS.Tools.Common,AWS.Tools.EC2,AWS.Tools.S3,AWS.Tools.RDS,AWS.Tools.SecurityToken,AWS.Tools.Organizations,AWS.Tools.IdentityManagement,AWS.Tools.CloudWatch,AWS.Tools.ElasticFileSystem,AWS.Tools.SSO,AWS.Tools.SSOOIDC,AWS.Tools.FSX,AWS.Tools.Backup,AWS.Tools.CostExplorer,AWS.Tools.DynamoDBv2,AWS.Tools.SQS,AWS.Tools.SecretsManager,AWS.Tools.KeyManagementService,AWS.Tools.EKS 110 | 111 | ``` 112 | 1. Ensure AWS credentials are set up by using the `Set-AWSCredential` command. For example: 113 | ```powershell 114 | Set-AWSCredential -AccessKey 'YourAccessKey' -SecretKey 'YourSecretKey' -Region 'YourRegion' 115 | ``` 116 | 117 | In both cases run the sizing script with the appropriate options and send the data back to Rubrik. 118 | 1. Execute the script: 119 | ```powershell 120 | .\Get-AWSSizingInfo.ps1 121 | ``` 122 | 1. The script will output a summary to the console and create a zip file with CSV and JSON files, along with a LOG of the console output. 123 | 1. Please download the ZIP file and send it to your Rubrik representative. 124 | 125 | 126 | ### Troubleshooting 127 | 128 | #### Explicit deny in a service control policy 129 | 130 | - Problem: 131 | 132 | When running the script against AWS SSO or an AWS Org the following type of error may occur: 133 | 134 | ``` 135 | Failed to get Backup Plans Info for region us-east-2 in account 123456789012 136 | Error: User: arn:aws:sts::123456789012:assumed-role/AWSReservedSSO_AdministratorAccess_1234567890abcdef/firstname.lastname@company.com is not authorized to perform: backup:ListBackupPlans with an explicit deny in a service control policy 137 | ``` 138 | 139 | - Solution: 140 | 141 | An AWS service control policy is in place that prevents running commands in the region that is listed. Use the -Regions parameter to restrict the script to only run in regions that are supported by the organization. 142 | 143 | 144 | #### Invalid grant provided 145 | 146 | - Problem: 147 | 148 | When using AWS SSO the following error may occur while authorizing the script in SSO: 149 | 150 | ``` 151 | Allow access to your data? invalid_grant 152 | Invalid grant provided 153 | ``` 154 | 155 | - Solution: 156 | 157 | AWS SSO is not being accessed in the correct region. By default, the script uses `us-east-1` to communicate with AWS SSO. To look up the proper region for AWS SSO select `Access Keys` next to the Parameter Set that is being used. The next screen will specify a region where the access keys can be used. This is the region for the AWS SSO. Next specify the `-SSORegion` flag and use the region that was discovered. 158 | 159 | --- 160 | 161 | ## Azure 162 | 163 | ### Azure Prerequisites 164 | 165 | To run the Azure sizing script, ensure you have the following: 166 | 167 | - Azure AD account with "Reader" and "Reader and Data Access" roles on each subscription. 168 | - PowerShell 7 installed if running locally. 169 | - Required Azure PowerShell modules installed: 170 | ```powershell 171 | Install-Module Az.Accounts,Az.Compute,Az.Storage,Az.Sql,Az.SqlVirtualMachine,Az.ResourceGraph,Az.Monitor,Az.Resources,Az.RecoveryServices,Az.CostManagement,Az.CosmosDB 172 | ``` 173 | 174 | ### Running the Azure Script 175 | 176 | 1. **From Azure Cloud Shell (preferred):** 177 | - Login to the Azure portal and open [Azure Cloud Shell](https://learn.microsoft.com/en-us/azure/cloud-shell/get-started/classic?source=recommendations&tabs=azurecli). 178 | - Install the necessary module: 179 | ```powershell 180 | Install-Module Az.CostManagement 181 | ``` 182 | - Upload and run the script: 183 | ```powershell 184 | .\Get-AzureSizingInfo.ps1 185 | ``` 186 | 187 | 2. **From a local system:** 188 | - Install PowerShell 7 and necessary Azure modules as mentioned above. 189 | - Login to Azure: 190 | ```powershell 191 | Connect-AzAccount 192 | ``` 193 | - Run the script: 194 | ```powershell 195 | .\Get-AzureSizingInfo.ps1 196 | ``` 197 | 198 | 4. The script will output a summary to the console and create a zip file with CSV and JSON files, along with a LOG of the console output. Please download the ZIP file and send it to your Rubrik representative. 199 | 200 | --- 201 | 202 | ## GCP 203 | 204 | ### GCP Prerequisites 205 | 206 | To run the GCP sizing script, ensure you have the following: 207 | 208 | - GCP account with necessary IAM permissions: "compute.instances.list", "compute.disks.get", "resourcemanager.projects.get". 209 | - GCP Cloud SDK installed or use GCP Cloud Shell. 210 | 211 | ### Running the GCP Script 212 | 213 | 1. **From GCP Cloud Shell:** 214 | - Login and initialize [GCP Cloud Shell](https://cloud.google.com/shell): 215 | ```shell 216 | gcloud init 217 | ``` 218 | 219 | 2. **Using Cloud Tools for PowerShell:** 220 | - Login to GCP: 221 | ```powershell 222 | gcloud auth list 223 | gcloud config list 224 | ``` 225 | - Run the script: 226 | ```powershell 227 | .\Get-GCPSizingInfo.ps1 228 | ``` 229 | 230 | 34. The script will output a summary to the console and create a zip file with a CSV file, along with a LOG of the console output. Please download the ZIP file and send it to your Rubrik representative. 231 | 232 | --- 233 | 234 | ## Anonymization Feature 235 | 236 | The anonymization feature allows you to anonymize specific fields in the output to protect sensitive information. You can use the flags on any/all the 3 AWS/Azure/GCP scripts. 237 | 238 | - Use the tag `-Anonymize`. Fields anonymized by default are as follows: 239 | 240 | - **AWS:** "AwsAccountId", "AwsAccountAlias", "BucketName", "Name", "InstanceId", "VolumeId", "RDSInstance", "DBInstanceIdentifier", "FileSystemId", "FileSystemDNSName", "FileSystemOwnerId", "OwnerId", "RuleId", "RuleName", "BackupPlanArn", "BackupPlanId", "VersionId", "RequestId" 241 | - **GCP:** "Name", "Project", "VMName", "DiskName", "Id", "DiskEncryptionKey" 242 | - **Azure:** "SubscriptionId", "Subscription", "Tenant", "Name", "ResourceGroup", "VirtualMachineId", "PolicyId", "ProtectionPolicyName", "Id", "SourceResourceId", "ContainerName", "FriendlyName", "ServerName", "ParentName", "ProtectedItemDataSourceId", "StorageAccount", "Database", "Server", "ElasticPool", "ManagedInstance", "DatabaseID", "vmID" 243 | 244 | - To customize anonymization: 245 | - Anonymize additional fields: `-AnonymizeFields "NewField1,NewField2"` 246 | - To not anonymize certain fields: `-NotAnonymizeFields "Name,Id"` 247 | 248 | - A CSV file corresponding each anonymized key to value is outputted when you run any of the 3 scripts. Note this will not be contained in the ZIP file, and is only outside the ZIP file. This will help you correspond the numbers outputted to the resources, even if you choose to send anonymized data to Rubrik. 249 | 250 | - The output log will also not be in the ZIP; the output log will be created outside the ZIP, and one can manually 'clean/sanitize' sensitive information from that log before sending it to one's Rubrik representative. 251 | 252 | --- 253 | 254 | ## FAQ 255 | 256 | ### How do I get started with AWS Organizations and AWS SSO? 257 | 258 | For detailed instructions on setting up AWS Organizations and AWS SSO, refer to official AWS documentation. 259 | 260 | ### What IAM permissions are required for running the scripts? 261 | 262 | Ensure the respective IAM permissions as outlined in the script prerequisites section for each cloud provider. 263 | 264 | ### How do I run the script with custom settings, such as using AWS SSO or querying certain regions? 265 | 266 | One can read the detailed parameter list and how to interact with them in the documentation at the top of each script. There are also examples provided of how to use these parameters to customize your data query. 267 | 268 | ### How can I verify my current cloud context? 269 | 270 | - **GCP:** 271 | ```shell 272 | gcloud auth list 273 | gcloud config list 274 | ``` 275 | - **Azure:** 276 | ```powershell 277 | Connect-AzAccount 278 | ``` 279 | - **AWS:** 280 | ```powershell 281 | Set-AWSCredential -AccessKey 'YourAccessKey' -SecretKey 'YourSecretKey' -Region 'YourRegion' 282 | ``` 283 | 284 | For any further queries or issues, refer to the detailed documentation at the top of each script or contact your Rubrik representative. 285 | -------------------------------------------------------------------------------- /CLOUD/consolidate.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | A script to combine CSV files with the same prefix into one file, keeping only one set of headers. 4 | .DESCRIPTION 5 | This PowerShell script takes in a directory path as a parameter, finds all CSV files within, and groups them by their prefix (the text before the first dash in the filename). 6 | Each group of files with the same prefix is combined into one CSV file. 7 | If a CSV file is empty, it will be ignored during the aggregation. 8 | The resulting combined files are saved in the directory from which the script is run. 9 | Headers from the original CSV files are included in the combined files intelligently: 10 | each combined file will only include one set of headers taken from the CSV files with the same prefix. 11 | The script also filters out any blank lines in the original CSV files. 12 | 13 | This script requires Powershell 7 or later. To install Powershell 7 use one of these links: 14 | 15 | MacOs: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4 16 | Windows: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4 17 | 18 | .PARAMETER directoryPath 19 | The path to the directory that contains the CSV files to be combined. Defaults to the current directory if not provided. 20 | .EXAMPLE 21 | .\CombineCsvFiles.ps1 -directoryPath "C:\path\to\your\csv\files" 22 | #> 23 | 24 | param ( 25 | # Path to the directory containing the CSV files 26 | [string]$directoryPath = "./" 27 | ) 28 | 29 | function addNullValuesForFields($list) { 30 | # Determine all unique fields 31 | $allFields = @{} 32 | foreach ($obj in $list) { 33 | $properties = $obj.PSObject.Properties 34 | foreach ($property in $properties) { 35 | if (-not $allFields.ContainsKey($property.Name)) { 36 | $allFields[$property.Name] = $true 37 | } 38 | } 39 | } 40 | 41 | $allFields = $allFields.Keys 42 | 43 | # Ensure each object has all possible fields 44 | foreach ($obj in $list) { 45 | foreach ($field in $allFields) { 46 | if (-not $obj.PSObject.Properties.Name.Contains($field)) { 47 | $obj | Add-Member -MemberType NoteProperty -Name $field -Value $null -Force 48 | } 49 | } 50 | } 51 | } 52 | 53 | 54 | # Get all the CSV files in the directory 55 | $csvFiles = Get-ChildItem -Path $directoryPath -Filter "*.csv" -File -Recurse 56 | 57 | # Extract unique prefixes from filenames 58 | $prefixes = $csvFiles | ForEach-Object { $_.BaseName -replace "-.*"} | Sort-Object -Unique 59 | 60 | foreach ($prefix in $prefixes) { 61 | $combinedData = @() 62 | 63 | # Get the CSV files with the current prefix 64 | $prefixCsvFiles = $csvFiles | Where-Object { $_.BaseName -like "$prefix-*" } 65 | 66 | foreach ($csvFile in $prefixCsvFiles) { 67 | # Skip the current file if it's empty 68 | if ((Get-Content $csvFile.FullName) -eq $null) { continue } 69 | 70 | # Import the data 71 | $importedData = Import-Csv -Path $csvFile.FullName 72 | 73 | $combinedData += $importedData 74 | } 75 | 76 | # If no data to write, skip to the next prefix 77 | if ($combinedData.Count -eq 0) { continue } 78 | 79 | # Make sure every field is reported 80 | addNullValuesForFields($combinedData) 81 | 82 | # Write the combined data to a new CSV file in the directory the script is run from 83 | $combinedData | Export-Csv -Path "${prefix}_combined.csv" -NoTypeInformation 84 | } 85 | -------------------------------------------------------------------------------- /MSSQL/CollectSQLProfile.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | MSSQL Database Sizing Scripts for Rubrik 4 | 5 | .EXAMPLE 6 | To run the script use the below command with the SQLInstance parameter. Then provide that parameter with a comma separated list of SQL Servers. The script will use Windows Authentication to collect data. 7 | PS C:\> .\CollectSQLProfile.ps1 -SQLInstance SQL1, SQL2, SQL3, SQL4\Instance1 8 | 9 | .EXAMPLE 10 | If you need to use SQL Authentication instead of Windows Authentication, then include the Credential parameter and provide it with a user name. You will be prompted for a password. 11 | PS C:\> .\CollectSQLProfile.ps1 -SQLInstance SQL1, SQL2, SQL3, SQL4\Instance1 -Credential sa 12 | 13 | .EXAMPLE 14 | Instead of giving a comma separated list of sql servers, you can use the InstancesFile parameter. Provide a file that contains a list of sql server instances. Each instance should be on a separate line. 15 | PS C:\> .\CollectSQLProfile.ps1 -InstancesFile SQLInstances.txt 16 | .NOTES 17 | Name: MSSQL Database Sizing Scripts for Rubrik 18 | Author: Mike Fal, Chris Lumnah 19 | #> 20 | #requires -Modules SqlServer 21 | [cmdletbinding()] 22 | param( 23 | [Parameter(ParameterSetName='List Of Instances')] 24 | [string[]] $SQLInstance, 25 | [Parameter(ParameterSetName='File Of Instances')] 26 | [String] $InstancesFile, 27 | [string] $OutPath = '.\', 28 | [string] $QueryPath = '.\', 29 | [Switch] $Anonymize, 30 | [ValidateNotNull()] 31 | [System.Management.Automation.PSCredential] 32 | [System.Management.Automation.Credential()] 33 | $Credential = [System.Management.Automation.PSCredential]::Empty 34 | ) 35 | BEGIN{ 36 | Import-Module SqlServer 37 | if(Get-Module -ListAvailable SqlServer){Import-Module SqlServer} 38 | $queries = Get-ChildItem $QueryPath -Filter "*.sql" 39 | $queries | ForEach-Object {$_ | Add-Member -MemberType NoteProperty -Name FileName -Value "$($_.Name.Replace('.sql',''))-$(Get-Date -Format 'yyyyMMddHHmm').csv"} 40 | $header = $true 41 | if (![string]::IsNullOrEmpty($InstancesFile)){ 42 | if (Test-Path $InstancesFile){ 43 | $SQLInstance = Get-Content -Path $InstancesFile 44 | } 45 | } 46 | } 47 | PROCESS{ 48 | foreach($i in $SQLInstance){ 49 | # $svr = new-object "Microsoft.SqlServer.Management.Smo.Server" $i; 50 | if (![string]::IsNullOrEmpty($Credential.UserName)){ 51 | $TestSQLConnection = Get-SQLInstance -ServerInstance $i -Credential $Credential -TrustServerCertificate -ErrorAction SilentlyContinue 52 | }else{ 53 | $TestSQLConnection = Get-SQLInstance -ServerInstance $i -TrustServerCertificate -ErrorAction SilentlyContinue 54 | } 55 | 56 | if ([string]::IsNullOrEmpty($TestSQLConnection.DisplayName)){ 57 | Write-Warning "!!!!!!! Can not connect to the SQL Service on: $i !!!!!!!" 58 | $i | Out-File -FilePath (Join-Path -Path $OutPath -ChildPath "SizingQuery-ServerWeCouldNotConnectTo.txt") -Append 59 | continue 60 | } 61 | 62 | if($Anonymize){ 63 | $serverid = [guid]::NewGuid() 64 | } 65 | 66 | foreach($q in $queries){ 67 | $sql = (Get-Content $q) -join "`n" 68 | if($Anonymize){$sql = $sql.Replace("@@SERVERNAME","'$serverid'")} 69 | $OutFile = Join-Path -Path $OutPath -ChildPath $q.filename 70 | 71 | Write-Verbose "Collecting data from $i" 72 | $output = Invoke-SqlCmd -ServerInstance "$i" -Database master -Query "$sql" -Credential $Credential -TrustServerCertificate 73 | 74 | if($header -eq $true){ 75 | $output | ConvertTo-Csv -Delimiter '|' -NoTypeInformation | Out-File $OutFile -Append 76 | } 77 | else{ 78 | $output | ConvertTo-Csv -Delimiter '|' -NoTypeInformation | Select-Object -skip 1 |Out-File $OutFile -Append 79 | } 80 | $output = "" 81 | } 82 | $header = $false 83 | } 84 | } 85 | END{} -------------------------------------------------------------------------------- /MSSQL/Parse-RubrikSizing.ps1: -------------------------------------------------------------------------------- 1 | param($csvfile 2 | ,$delimiter = '|' 3 | ,[int[]]$HistogramBins=@(1,10,100,500,1000)) 4 | 5 | $data = Get-Content $csvfile 6 | 7 | if ($data[0].Substring(1,10) -ne "ServerName") 8 | { 9 | $Header ="ServerName","SQLVersion","name","recovery_model_desc","SevenDayLogBackupMB","AverageFullMB","AverageFullTimeSec","AverageLogTimeSec","DBTotalSizeMB","AverageLogBackupInterval","ChangeCapture","ColumnStoreIndex","Compression","FILESTREAM","InMemoryOLTP","Partitioning","TransparentDatabaseEncryption", "NumberOfFiles" 10 | $rawdata = Get-Content $csvfile | ConvertFrom-Csv -Delimiter $delimiter -Header $Header 11 | } 12 | else 13 | { 14 | $rawdata = Get-Content $csvfile | ConvertFrom-Csv -Delimiter $delimiter 15 | } 16 | 17 | $DailyLogChurn = ($rawdata | Measure-Object -Property SevenDayLogBackupMB -Sum).Sum/7 18 | $EstimatedChangePerc = $DailyLogChurn/($rawdata | Where-Object {$_.recovery_model_desc -ne 'SIMPLE'} | Measure-Object -Property DBTotalSizeMB -Sum).Sum 19 | 20 | $return = [ordered]@{ 21 | 'DB Count' = ($rawdata | Measure-Object).Count 22 | 'DBs in Full' = ($rawdata | Where-Object {$_.recovery_model_desc -ne 'SIMPLE'} | Measure-Object).Count 23 | 'Server Count' = ($rawdata | Group-Object -Property ServerName | Measure-Object).Count 24 | 'Total DB Size (GB)' = (($rawdata | Measure-Object -Property DBTotalSizeMB -Sum).Sum/1024).ToString('0.00') 25 | 'Avg Full Backup Time(Sec)' = ($rawdata | Measure-Object -Property 'AverageFullTimeSec' -Average).Average.ToString('0.00') 26 | 'Avg Log Backup Time(Sec)' = ($rawdata | Where-Object {$_.recovery_model_desc -ne 'SIMPLE'} | Measure-Object -Property 'AverageLogTimeSec' -Average).Average.ToString('0.00') 27 | 'Estimated Daily Change Rate (Perc)' = ($EstimatedChangePerc * 100).ToString('0.00') 28 | 'Estimated Daily Change Rate (GB)' = ((($rawdata | Measure-Object -Property DBTotalSizeMB -Sum).Sum)/1024 * $EstimatedChangePerc).ToString('0.00') 29 | 'Avg Log Backup Interval (min)' = ($rawdata | Where-Object {$_.recovery_model_desc -ne "SIMPLE"} | Measure-Object -Property 'AverageLogBackupInterval' -Average).Average.ToString('0.00') 30 | 'DBs with ChangeCapture' = ($rawdata | Measure-Object -Property 'ChangeCapture' -Sum).Sum 31 | 'DBs with ColumnStoreIndex' = ($rawdata | Measure-Object -Property 'ColumnStoreIndex' -Sum).Sum 32 | 'DBs with Compression' = ($rawdata | Measure-Object -Property 'Compression' -Sum).Sum 33 | 'DBs with FILESTREAM' = ($rawdata | Measure-Object -Property 'FILESTREAM' -Sum).Sum 34 | 'DBs with InMemoryOLTP' = ($rawdata | Measure-Object -Property 'InMemoryOLTP' -Sum).Sum 35 | 'DBs with Partitioning' = ($rawdata | Measure-Object -Property 'Partitioning' -Sum).Sum 36 | 'DBs with TransparentDatabaseEncryption' = ($rawdata | Measure-Object -Property 'TransparentDatabaseEncryption' -Sum).Sum 37 | 'DBs with Greater than 300 Files' = ($rawdata | Where-Object {[int]$_.NumberOfFiles -ge 300} | Measure-Object).Count 38 | 'DBs in an Availability Group' = ($rawdata | Where-Object {[string]::IsNullOrEmpty($_.AG_Name) -eq $false } | Measure-Object ).Count 39 | } 40 | 41 | $MaxDbCountSingleHost = ($rawdata | Group-Object ServerName | Sort-Object Count -Descending| Select-Object Name, Count -first 1) 42 | if($MaxDbCountSingleHost.Count -gt 500){ 43 | $return.Add("Max DB count for a single host [$($MaxDbCountSingleHost.Name)]",$($MaxDbCountSingleHost.Count)) 44 | } 45 | 46 | $BinStart = 0 47 | foreach($bin in $HistogramBins){ 48 | $BinCount = ($rawdata | Where-Object {[int]$_.DBTotalSizeMB/1024 -gt $BinStart -and [int]$_.DBTotalSizeMB/1024 -le $bin} | Measure-Object).Count 49 | $return.Add("Histogram (GBs) :$bin",$BinCount) 50 | $BinStart = $bin 51 | } 52 | 53 | $BinCount = ($rawdata | Where-Object {[int]$_.DBTotalSizeMB/1024 -gt $BinStart} | Measure-Object).Count 54 | $return.Add("Histogram:More",$BinCount) 55 | 56 | return $return | Format-Table -AutoSize -------------------------------------------------------------------------------- /MSSQL/RubrikSQLProfile-DBInfo.sql: -------------------------------------------------------------------------------- 1 | /********************************************************** 2 | Rubrik SQL Server profile queries. 3 | DBInfo 4 | *********************************************************/ 5 | 6 | /********************************************************** 7 | Get what Enterprise Features are enabled 8 | *********************************************************/ 9 | IF OBJECT_ID('tempdb.dbo.##enterprise_features') IS NOT NULL 10 | DROP TABLE ##enterprise_features 11 | 12 | CREATE TABLE ##enterprise_features( 13 | ServerName SYSNAME, 14 | dbid SYSNAME, 15 | dbname SYSNAME, 16 | feature_name VARCHAR(100), 17 | feature_id INT 18 | ) 19 | EXEC sp_MSforeachdb 20 | N' USE [?] 21 | -- IF (SELECT COUNT(*) FROM sys.dm_db_persisted_sku_features) > 0 22 | -- BEGIN 23 | INSERT INTO ##enterprise_features 24 | SELECT @@SERVERNAME, dbid=DB_ID(), dbname=DB_NAME(),feature_name,feature_id 25 | FROM sys.dm_db_persisted_sku_features 26 | -- END '; 27 | 28 | /********************************************************** 29 | Get how many database files each database has 30 | *********************************************************/ 31 | IF OBJECT_ID('tempdb.dbo.##database_files') IS NOT NULL 32 | DROP TABLE ##database_files 33 | 34 | CREATE TABLE ##database_files( 35 | ServerName SYSNAME, 36 | database_id SYSNAME, 37 | DatabaseName NVARCHAR(50), 38 | NumberOfFiles INT 39 | ) 40 | INSERT INTO ##database_files 41 | SELECT @@servername AS ServerName, 42 | database_id, 43 | DB_NAME(database_id) as DatabaseName, 44 | COUNT(database_id) as NumberOfFiles 45 | FROM sys.master_files 46 | GROUP BY database_id; 47 | /********************************************************** 48 | Get Availability Info 49 | *********************************************************/ 50 | IF OBJECT_ID('tempdb.dbo.##AG_Info') IS NOT NULL 51 | DROP TABLE ##AG_Info 52 | 53 | CREATE TABLE ##AG_Info( 54 | ServerName SYSNAME, 55 | DatabaseName NVARCHAR(50), 56 | AG_Name NVARCHAR(50), 57 | ) 58 | IF (SELECT cast(left(cast(serverproperty('productversion') AS VARCHAR), 4) AS DECIMAL(5, 1))) >= 11 59 | BEGIN 60 | INSERT INTO ##AG_Info 61 | SELECT @@servername AS ServerName 62 | , db_name(drs.database_id) AS dbname 63 | , ag_name 64 | FROM sys.dm_hadr_database_replica_states drs 65 | JOIN sys.dm_hadr_name_id_map map 66 | ON drs.group_id = map.ag_id 67 | END 68 | ELSE 69 | BEGIN 70 | INSERT INTO ##AG_Info 71 | SELECT @@servername AS ServerName 72 | , null as dbname 73 | , null as ag_name 74 | END; 75 | /********************************************************** 76 | Create the output for the server 77 | *********************************************************/ 78 | 79 | WITH LogBackupInfo 80 | AS 81 | ( 82 | SELECT database_name 83 | ,AVG(DATEDIFF(ss,backup_start_date,backup_finish_date)/1.0) AS AverageLogBackupTime 84 | ,SUM(backup_size/1024.0/1024.0) AS LogBackupTotalMB 85 | FROM msdb.dbo.backupset 86 | WHERE type = 'L' 87 | AND backup_finish_date > DATEADD(dd,-7,GETDATE()) 88 | GROUP BY database_name 89 | ), 90 | FullBackupInfo 91 | AS 92 | ( 93 | SELECT database_name 94 | ,AVG(backup_size/1024.0/1024.0) AS AverageBackupSizeMB 95 | ,AVG(DATEDIFF(ss,backup_start_date,backup_finish_date)/1.0) AS AverageBackupTime 96 | FROM msdb.dbo.backupset 97 | WHERE type = 'D' 98 | GROUP BY database_name 99 | ), 100 | LogBackupInterval 101 | AS 102 | ( 103 | SELECT a.database_name, a.backup_start_date, ISNULL( b.PrevBkpDate, a.backup_start_date ) PreviousBackupStartDate, DATEDIFF(mi,ISNULL( b.PrevBkpDate, a.backup_start_date ), a.backup_start_date) BackupInterval 104 | FROM msdb.dbo.backupset a 105 | OUTER APPLY ( SELECT TOP 1 backup_start_date AS PrevBkpDate 106 | FROM msdb.dbo.backupset bb WHERE bb.database_guid = a.database_guid 107 | AND bb.type = a.type AND bb.backup_start_date < a.backup_start_date and bb.backup_start_date > DATEADD(dd,-7,GETDATE()) ORDER BY bb.backup_start_date DESC) b 108 | WHERE type = 'L' 109 | AND backup_start_date > DATEADD(dd,-7,GETDATE()) 110 | ), 111 | EnterpriseFeatures 112 | AS 113 | ( 114 | SELECT dbname AS 'DatabaseName' 115 | ,[ChangeCapture] 116 | ,[ColumnStoreIndex] 117 | ,[Compression] 118 | ,[MultipleFSContainers] 119 | ,[InMemoryOLTP] 120 | ,[Partitioning] 121 | ,[TransparentDatabaseEncryption] 122 | FROM 123 | (SELECT dbname, feature_name FROM ##enterprise_features) e 124 | PIVOT 125 | ( COUNT(feature_name) FOR feature_name IN ([ChangeCapture], [ColumnStoreIndex], [Compression], [MultipleFSContainers],[InMemoryOLTP],[Partitioning],[TransparentDatabaseEncryption]) ) 126 | AS PVT 127 | ), 128 | DBInfo 129 | AS 130 | ( 131 | select 132 | db.name 133 | ,convert(bigint,sum(mf.size/128.0)) DBTotalSizeMB 134 | 135 | FROM sys.databases db 136 | JOIN sys.master_files mf ON db.database_id = mf.database_id 137 | group by db.name 138 | ), 139 | DBFiles 140 | AS 141 | ( 142 | SELECT * FROM ##database_files 143 | ), 144 | AGInfo 145 | AS( 146 | SELECT * FROM ##AG_Info 147 | ) 148 | 149 | SELECT 150 | @@SERVERNAME AS ServerName 151 | ,SERVERPROPERTY('ProductVersion') AS SQLVersion 152 | ,db.name 153 | ,db.recovery_model_desc 154 | ,ISNULL(lbi.LogBackupTotalMB,0) AS SevenDayLogBackupMB 155 | ,ISNULL(fbi.AverageBackupSizeMB,0) AS AverageFullMB 156 | ,ISNULL(fbi.AverageBackupTime,0) AS AverageFullTimeSec 157 | ,ISNULL(lbi.AverageLogBackupTime,0) AS AverageLogTimeSec 158 | ,DBInfo.DBTotalSizeMB 159 | ,AVG(lbii.BackupInterval) AS AverageLogBackupInterval 160 | ,ISNULL(ef.ChangeCapture,0) AS ChangeCapture 161 | ,ISNULL(ef.ColumnStoreIndex,0) AS ColumnStoreIndex 162 | ,ISNULL(ef.[Compression],0) AS Compression 163 | ,ISNULL(ef.[MultipleFSContainers],0) AS FILESTREAM 164 | ,ISNULL(ef.[InMemoryOLTP], 0) AS InMemoryOLTP 165 | ,ISNULL(ef.[Partitioning],0) AS Partitioning 166 | ,ISNULL(ef.[TransparentDatabaseEncryption],0) as TransparentDatabaseEncryption 167 | ,DBFiles.NumberOfFiles 168 | ,AG_Name 169 | FROM sys.databases db 170 | JOIN DBInfo ON db.name = DBInfo.name 171 | LEFT OUTER JOIN LogBackupInfo lbi ON db.name = lbi.database_name 172 | LEFT OUTER JOIN FullBackupInfo fbi ON db.name = fbi.database_name 173 | LEFT OUTER JOIN LogBackupInterval lbii ON db.name = lbii.database_name 174 | LEFT OUTER JOIN EnterpriseFeatures ef ON db.name = ef.DatabaseName 175 | LEFT OUTER JOIN AGInfo agi on db.name = agi.DatabaseName 176 | JOIN DBFiles ON db.name = DBFiles.DatabaseName 177 | WHERE db.database_id != 2 178 | GROUP BY db.name 179 | ,db.recovery_model_desc 180 | ,DBInfo.DBTotalSizeMB 181 | ,ISNULL(lbi.LogBackupTotalMB,0) 182 | ,ISNULL(fbi.AverageBackupSizeMB,0) 183 | ,ISNULL(fbi.AverageBackupTime,0) 184 | ,ISNULL(lbi.AverageLogBackupTime,0) 185 | ,ISNULL(ef.ChangeCapture,0) 186 | ,ISNULL(ef.[ColumnStoreIndex],0) 187 | ,ISNULL(ef.[Compression],0) 188 | ,ISNULL(ef.[MultipleFSContainers],0) 189 | ,ISNULL(ef.[InMemoryOLTP],0) 190 | ,ISNULL(ef.[Partitioning],0) 191 | ,ISNULL(ef.[TransparentDatabaseEncryption],0) 192 | ,DBFiles.NumberOfFiles 193 | ,AG_Name 194 | ORDER BY name 195 | -------------------------------------------------------------------------------- /MSSQL/SQLInstances.txt: -------------------------------------------------------------------------------- 1 | rp-sql19ags-1a.perf.rubrik.com 2 | rp-sql12s-001.perf.rubrik.com -------------------------------------------------------------------------------- /ORACLE/README.txt: -------------------------------------------------------------------------------- 1 | ########## 2 | # 3 | # Rubrik Data Collection for Oracle Tooling 4 | # 5 | # Version: 1.2 6 | # 7 | # Developer: Shawn McElhinney 8 | # 9 | # Purpose: 10 | # This utility is designed to collect data from Oracle databases to assist with Rubrik solution sizing. 11 | # The utility will connect to the databases you define in collectionInput.lst and execute the appropriate rbkDataCollection.sql (based on your db version) to gather the data required 12 | # to begin properly sizing your Rubrik solution for Oracle. 13 | # 14 | # Component files: 15 | # collectionInput.lst -- a space-separated list of the databases in your landscape. Simply provide single line entries for each database in the following format: 16 | # hostname databasePort OracleSID databaseRelease 17 | # where databaseRelease is in a 3 digit format representing MAJOR and DOT release. For example: 10gR2 -> 102; 11gR2 -> 112; 12cR1 -> 121 etc. 18 | # save this file after update as it will be an input for the shell script. 19 | # 20 | # rbkDataCollection.sql -- sql script that collects pertinent database information to assist with sizing Rubrik for Oracle and dump output to a comma-separated file named rbkDiscovery.csv. 21 | # 22 | # dataCollector.sh -- This script will verify the existence of SQL*Plus, read through collectioInput.lst, execute rbkDataCollection.sql. At runtime, user will be prompted to enter the SYSTEM password for the associated databases. Output from the sql queries are dumped to rbkDiscovery.csv, which is what your Rubrik Sales Engineer will require to help with sizing. 23 | # 24 | # Execution Steps: 25 | # 1 - Update collectionInput.lst file with all Oracle databases that will be integrated with Rubrik. Enter the hostname, databasePort, ORACLE_SID and version for each instance or CDB (please check the expected format in collectionInput.lst-EXAMPLE file). If you utilizes PDB's in 12c+, the script will gather information for all PDBs that are installed in the CDB. If you utilizes RAC cluster, please add the instances of one node only. 26 | # 27 | # 2 - Ensure you have the SYSTEM password for all databases referenced in collectionInput.lst file. 28 | # 29 | # 3 - Execute dataCollector.sh provide the appropriate SYSTEM password when prompted 30 | # 31 | # 4 - Compress the resulting rbkDiscovery.csv & work with your Rubrik Sales Engineer to transfer the file to them via the most secure mechanism available. 32 | # 33 | ########## 34 | -------------------------------------------------------------------------------- /ORACLE/collectionInput.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubrikinc/rubrik-sizing-scripts/4c9e142b20d67462618301881b3326ded0b6d66f/ORACLE/collectionInput.lst -------------------------------------------------------------------------------- /ORACLE/collectionInput.lst-EXAMPLE: -------------------------------------------------------------------------------- 1 | am1-shawmcel-l3 1521 CDBSRC1 121 2 | am1-shawmcel-l3 1521 CDBSRC2 112 3 | am1-shawmcel-l3 1521 CDBSRC3 193 4 | am1-shawmcel-l3 1521 CDBSRC4 210 5 | -------------------------------------------------------------------------------- /ORACLE/dataCollector.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ##### 4 | # 5 | # name: dataCollector.sh 6 | # 7 | # version: 1.0 8 | # 9 | # assumptions: This utility assumes that the dba has access to the following information: 10 | # - SYSTEM account is used to access required dba* and v$* views 11 | # - Hostname of all database hosts 12 | # - Database Listener port for all databases 13 | # - Database Service Name for all databases 14 | # - Database version is provided for databases as a 3 digit number representing the MAJOR (ie: 12c) and DOT (ie: 12.1) release (for example:10gR2 -> 102; 11gR2 -> 112; 12cR1 -> 121 etc. ) 15 | # - access to sqlplus on the host executing the utility 16 | # 17 | # description: shell script to collect data on all Oracle databases defined as input 18 | # 19 | # input: collectionInput.lst -- a comma separated input file containing the following input: 20 | # databaseHostname,dbPort,dbServiceName,dbRelease 21 | # a unique entry should exist for EACH database requiring data collection 22 | # 23 | # output: rbkDiscovery.csv -- a comma separated list of critical database information required 24 | # for properly sizing Oracle databases on Rubrik. 25 | # 26 | # additional files: rbkDataCollection.sql -- the sql file executed to collect database information 27 | # 28 | ##### 29 | 30 | ##### 31 | # 32 | # Validate existance of sqlplus 33 | # 34 | ##### 35 | FILE=`which sqlplus` 36 | while ! [ -f "$FILE" ] 37 | do 38 | echo "sqlplus not found. Please provide an ORACLE_HOME location containing sqlplus." 39 | #accept user input 40 | unset FILE 41 | read OH 42 | #update $FILE to new value & recheck 43 | echo $OH 44 | export ORACLE_HOME=$OH 45 | export PATH=$PATH:$ORACLE_HOME/bin 46 | FILE=`which sqlplus` 47 | echo $FILE 48 | done 49 | 50 | # sleep 2 51 | 52 | ##### 53 | # 54 | # Verify collectionInput.lst exists & has content 55 | # loop through collectionInput.lst to collect required variables 56 | # 57 | ##### 58 | 59 | # confirm collectionInput.lst exists 60 | 61 | echo "Checking existance of collectionInput.lst" 62 | INPUT=collectionInput.lst 63 | 64 | [ ! -f "$INPUT" ] && { echo "Error: $0 file not found."; exit 2; } 65 | 66 | if [ -s "$INPUT" ] 67 | then 68 | 69 | IFS=' ' 70 | 71 | # collect values to create connect string to databases listed 72 | cat $INPUT | while read host port sid dbversion junk 73 | do 74 | echo "Connecting to database: "$sid 75 | echo $dbversion 76 | unset passwd 77 | unset login 78 | unset sql 79 | unset runSql 80 | #echo "-n Enter SYSTEM password for database "$sid" and press [ENTER]:" 81 | #printf '%s' "Enter the SYSTEM Password for database "$sid" and press [ENTER]: " 82 | echo "Enter SYSTEM password" 83 | read -s passwd < /dev/tty 84 | login=system/$passwd 85 | 86 | # determine database version from collectionInput.lst & set appropriate sql script for execution 87 | if test "$dbversion" -lt 120 88 | then 89 | sql="rbkDataCollection_11g.sql" 90 | elif test "$dbversion" -lt 122 91 | then 92 | sql="rbkDataCollection_121.sql" 93 | elif test "$dbversion" -lt 180 94 | then 95 | sql="rbkDataCollection_12c.sql" 96 | else 97 | sql="rbkDataCollection.sql" 98 | fi 99 | echo $sql 100 | # build sqlplus connection command based on collectionInput 101 | runSql="sqlplus "$login"@\"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST="$host")(PORT="$port"))(CONNECT_DATA=(SID="$sid")))\" @"$sql"" 102 | # execute the resulting sqlplus command 103 | eval "$runSql" 104 | done 105 | else 106 | echo "$INPUT is empty." 107 | exit 3; 108 | fi 109 | 110 | exit; 111 | -------------------------------------------------------------------------------- /ORACLE/rbkDataCollection.sql: -------------------------------------------------------------------------------- 1 | REM Oracle Data Collection Script 2 | 3 | -- connect to the system schema 4 | --conn SYSTEM@$1 5 | 6 | -- create private temporary table to hold all collected 7 | 8 | create global temporary table rubrikDataCollection 9 | ( 10 | con_id number, 11 | conName varchar2(128), 12 | dbSizeMB number, 13 | allocated_dbSizeMB number, 14 | biggestBigfileMB number, 15 | dailyChangeRate number, 16 | dailyRedoSize number, 17 | datafileCount number, 18 | hostName varchar2(64), 19 | instName varchar2(16), 20 | dbVersion varchar2(17), 21 | -- dbEdition varchar2(7), 22 | -- updating dbEdition to support larger settings in v$instance.version 23 | dbEdition varchar2(100), 24 | platformName varchar2(101), 25 | dbName varchar2(9), 26 | dbUniqueName varchar2(30), 27 | dbID varchar2(200), 28 | flashbackEnabled varchar2(18), 29 | archiveLogEnabled varchar2(12), 30 | spfile varchar2(200), 31 | patchLevel varchar2(100), 32 | cpuCount number, 33 | blockSize number, 34 | racEnabled varchar2(20), 35 | sgaMaxSize number, 36 | sgaTarget number, 37 | pgaAggregateTarget number, 38 | physMemory number, 39 | dNFSenabled varchar2(20), 40 | GoldenGate varchar2(20), 41 | exadataEnabled varchar2(20), 42 | bctEnabled varchar2(20), 43 | LogArchiveConfig varchar2(200), 44 | ArchiveLagTarget number, 45 | tablespaceCount number, 46 | encryptedTablespaceCount number, 47 | encryptedDataSizeMB number, 48 | bigfileTablespaceCount number, 49 | bigfileDataSizeMB number, 50 | logfileCount number, 51 | tempfileCount number 52 | ) 53 | on commit preserve rows; 54 | 55 | insert into rubrikDataCollection 56 | ( 57 | con_id, 58 | conName, 59 | hostName, 60 | instName, 61 | dbVersion, 62 | dbEdition, 63 | platformName, 64 | dbName, 65 | dbUniqueName, 66 | dbID, 67 | flashbackEnabled, 68 | archiveLogEnabled 69 | ) 70 | select cont.con_id, 71 | cont.name, 72 | inst.host_name, 73 | inst.instance_name, 74 | inst.version_full, 75 | inst.edition, 76 | db.platform_name, 77 | db.name, 78 | db.db_unique_name, 79 | cont.dbid, 80 | db.flashback_on, 81 | db.log_mode 82 | from v$instance inst, 83 | v$database db, 84 | v$containers cont 85 | / 86 | 87 | UPDATE rubrikDataCollection rbk 88 | SET spfile = (select decode(count(*), 0, 'NO', 'YES') from v$parameter where name='spfile') 89 | WHERE instName = (select instance_name from v$instance) 90 | and hostName= (select host_name from v$instance); 91 | 92 | -- result is the latest patch 93 | UPDATE rubrikDataCollection rbk 94 | SET patchLevel = (select * from (select description from dba_registry_sqlpatch order by TARGET_BUILD_TIMESTAMP desc) where ROWNUM = 1) 95 | WHERE instName = (select instance_name from v$instance) 96 | and hostName= (select host_name from v$instance); 97 | 98 | UPDATE rubrikDataCollection rbk 99 | SET cpuCount = (SELECT value from v$parameter where name='cpu_count') 100 | WHERE instName = (select instance_name from v$instance) 101 | and hostName= (select host_name from v$instance); 102 | 103 | UPDATE rubrikDataCollection rbk 104 | SET blockSize = (SELECT value from v$parameter where name='db_block_size') 105 | WHERE instName = (select instance_name from v$instance) 106 | and hostName= (select host_name from v$instance); 107 | 108 | UPDATE rubrikDataCollection rbk 109 | SET racEnabled = (SELECT value from v$parameter where name='cluster_database') 110 | WHERE instName = (select instance_name from v$instance) 111 | and hostName= (select host_name from v$instance); 112 | 113 | UPDATE rubrikDataCollection rbk 114 | SET sgaMaxSize = (SELECT value from v$parameter where name='sga_max_size') 115 | WHERE instName = (select instance_name from v$instance) 116 | and hostName= (select host_name from v$instance); 117 | 118 | UPDATE rubrikDataCollection rbk 119 | SET sgaTarget = (SELECT value from v$parameter where name='sga_target') 120 | WHERE instName = (select instance_name from v$instance) 121 | and hostName= (select host_name from v$instance); 122 | 123 | UPDATE rubrikDataCollection rbk 124 | SET pgaAggregateTarget = (SELECT value from v$parameter where name='pga_aggregate_target') 125 | WHERE instName = (select instance_name from v$instance) 126 | and hostName= (select host_name from v$instance); 127 | 128 | UPDATE rubrikDataCollection rbk 129 | SET physMemory = (SELECT max(value) from dba_hist_osstat where stat_name = 'PHYSICAL_MEMORY_BYTES') 130 | WHERE instName = (select instance_name from v$instance) 131 | and hostName= (select host_name from v$instance); 132 | 133 | UPDATE rubrikDataCollection rbk 134 | SET dNFSenabled = (select decode(count(*), 0, 'NO', 'YES') from v$dnfs_servers) 135 | WHERE instName = (select instance_name from v$instance) 136 | and hostName= (select host_name from v$instance); 137 | 138 | -- cdb_segments can use the containers clause. 139 | -- this query returns USED space per container 140 | UPDATE rubrikDataCollection rbk 141 | SET dbSizeMB = (select sum(bytes)/1024/1024 MB from containers(cdb_segments) where con_id=rbk.con_id) 142 | WHERE instName = (select instance_name from v$instance) 143 | and hostName= (select host_name from v$instance) 144 | and con_id=rbk.con_id; 145 | 146 | -- v$datafile can use the containers clause 147 | -- this query returns the total space ALLOCATED to each container 148 | UPDATE rubrikDataCollection rbk 149 | SET allocated_dbSizeMB = (select sum(bytes/1024/1024) bytes from containers(v$datafile) where con_id=rbk.con_id) 150 | WHERE instName = (select instance_name from v$instance) 151 | and hostName= (select host_name from v$instance) 152 | and con_id=rbk.con_id; 153 | 154 | 155 | -- v$archive_dest is container-aware 156 | -- if cont_id is 0, it means the entire CDB 157 | UPDATE rubrikDataCollection rbk 158 | SET GoldenGate = (select decode(count(*), 0, 'NO', 'YES') from v$archive_dest where status = 'VALID' and target = 'STANDBY' and con_id=0) 159 | WHERE instName = (select instance_name from v$instance) 160 | and hostName= (select host_name from v$instance); 161 | 162 | -- this query addresses GoldenGate for each container 163 | UPDATE rubrikDataCollection rbk 164 | SET GoldenGate = (select decode(count(*), 0, 'NO', 'YES') from v$archive_dest where status = 'VALID' and target = 'STANDBY' and con_id=rbk.con_id) 165 | WHERE instName = (select instance_name from v$instance) 166 | and hostName= (select host_name from v$instance) 167 | and con_id=rbk.con_id; 168 | 169 | -- gv$cell is container-aware 170 | -- if cont_id is 0, it means the entire CDB 171 | UPDATE rubrikDataCollection rbk 172 | SET exadataEnabled = (select decode(count(*), 0, 'NO', 'YES') from v$cell where con_id=0) 173 | WHERE instName = (select instance_name from v$instance) 174 | and hostName= (select host_name from v$instance); 175 | 176 | -- this query addresses Exadata for each container (overkill) 177 | UPDATE rubrikDataCollection rbk 178 | SET exadataEnabled = (select decode(count(*), 0, 'NO', 'YES') from v$cell where con_id=rbk.con_id) 179 | WHERE instName = (select instance_name from v$instance) 180 | and hostName= (select host_name from v$instance) 181 | and con_id=rbk.con_id; 182 | 183 | -- v$block_change_tracking is container-aware 184 | -- for now, BCT is allowed only in CDB 185 | UPDATE rubrikDataCollection rbk 186 | SET bctEnabled = (select status from v$block_change_tracking) 187 | WHERE instName = (select instance_name from v$instance) 188 | and hostName= (select host_name from v$instance); 189 | 190 | UPDATE rubrikDataCollection rbk 191 | SET LogArchiveConfig = (SELECT value from v$parameter where name='log_archive_config') 192 | WHERE instName = (select instance_name from v$instance) 193 | and hostName= (select host_name from v$instance); 194 | 195 | -- Need to explicitly set a value for LogArchiveConfig is the previous query returns a null value 196 | UPDATE rubrikDataCollection rbk 197 | SET LogArchiveConfig = 'NO' 198 | WHERE instName = (select instance_name from v$instance) 199 | and hostName= (select host_name from v$instance) 200 | and LogArchiveConfig is null; 201 | 202 | UPDATE rubrikDataCollection rbk 203 | SET ArchiveLagTarget = (SELECT value from v$parameter where name='archive_lag_target') 204 | WHERE instName = (select instance_name from v$instance) 205 | and hostName= (select host_name from v$instance); 206 | 207 | -- v$tablespace is container-aware 208 | UPDATE rubrikDataCollection rbk 209 | SET tablespaceCount = (select count(*) from v$tablespace where con_id=rbk.con_id group by con_id) 210 | WHERE instName = (select instance_name from v$instance) 211 | and hostName= (select host_name from v$instance) 212 | and con_id=rbk.con_id; 213 | 214 | -- containers clause works on dba_tablespaces 215 | UPDATE rubrikDataCollection rbk 216 | SET encryptedTablespaceCount = (select count(*) from containers(dba_tablespaces) where encrypted='YES' and con_id=rbk.con_id) 217 | WHERE instName = (select instance_name from v$instance) 218 | and hostName= (select host_name from v$instance) 219 | and con_id=rbk.con_id; 220 | 221 | -- containers clause works on dba_data_files and dba_tablespaces 222 | UPDATE rubrikDataCollection rbk 223 | SET encryptedDataSizeMB = (select sum(bytes/1024/1024) from (select dbf.con_id,sum(bytes) bytes from containers(dba_data_files) dbf, containers(dba_tablespaces) tbsp where dbf.tablespace_name=tbsp.tablespace_name and dbf.con_id=tbsp.con_id and tbsp.encrypted='YES' group by dbf.con_id) where con_id=rbk.con_id) 224 | WHERE instName = (select instance_name from v$instance) 225 | and hostName= (select host_name from v$instance) 226 | and con_id=rbk.con_id; 227 | 228 | -- need to explicitly set encryptedDataSizeMB if previous query returns a null value 229 | UPDATE rubrikDataCollection rbk 230 | SET encryptedDataSizeMB = 0 231 | WHERE instName = (select instance_name from v$instance) 232 | and hostName= (select host_name from v$instance) 233 | and encryptedDataSizeMB is null; 234 | 235 | UPDATE rubrikDataCollection rbk 236 | SET bigfileTablespaceCount = (select count(*) from containers(dba_tablespaces) where bigfile='YES' and con_id=rbk.con_id) 237 | WHERE instName = (select instance_name from v$instance) 238 | and hostName= (select host_name from v$instance) 239 | and con_id=rbk.con_id; 240 | 241 | -- containers clause works on dba_data_files and dba_tablespaces 242 | UPDATE rubrikDataCollection rbk 243 | SET biggestBigfileMB = (select sum(bytes/1024/1024) from (select dbf.con_id, max(bytes) bytes from containers(dba_data_files) dbf, containers(dba_tablespaces) tbsp where dbf.tablespace_name=tbsp.tablespace_name and dbf.con_id=tbsp.con_id and tbsp.bigfile='YES' group by dbf.con_id) where con_id=rbk.con_id) 244 | WHERE instName = (select instance_name from v$instance) 245 | and hostName= (select host_name from v$instance) 246 | and con_id=rbk.con_id; 247 | 248 | -- need to explicitly set biggestBigfileMB if the previous query returns a null value 249 | UPDATE rubrikDataCollection rbk 250 | SET biggestBigfileMB = 0 251 | WHERE instName = (select instance_name from v$instance) 252 | and hostName= (select host_name from v$instance) 253 | and biggestBigfileMB is null; 254 | 255 | UPDATE rubrikDataCollection rbk 256 | SET bigfileDataSizeMB = (select sum(bytes/1024/1024) from (select dbf.con_id, sum(bytes) bytes from containers(dba_data_files) dbf, containers(dba_tablespaces) tbsp where dbf.tablespace_name=tbsp.tablespace_name and dbf.con_id=tbsp.con_id and tbsp.bigfile='YES' group by dbf.con_id) where con_id=rbk.con_id) 257 | WHERE instName = (select instance_name from v$instance) 258 | and hostName= (select host_name from v$instance) 259 | and con_id=rbk.con_id; 260 | 261 | -- need to explicitly set the bigfileDataSizeMB if the previous query returns a null value 262 | UPDATE rubrikDataCollection rbk 263 | SET bigfileDataSizeMB = 0 264 | WHERE instName = (select instance_name from v$instance) 265 | and hostName= (select host_name from v$instance) 266 | and bigfileDataSizeMB is null; 267 | 268 | -- v$datafile and v$archived_log are container-aware (no need for container clause) 269 | -- 20220310 removed division by 100 from change rate calc as it is skewing change rate down smcelhinney 270 | -- 20230321 updated change rate calculations to leverage cdb_segments to determine actual space USED instead of ALLOCATED - smcelhinney 271 | UPDATE rubrikDataCollection rbk 272 | SET dailyChangeRate = (select dailyChangeRate from (select sgmt.con_id, round((avg(redo_size)/sum(sgmt.bytes)),8) dailyChangeRate from containers(cdb_segments) sgmt, (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from containers(v$archived_log) where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by sgmt.con_id) where con_id=rbk.con_id) 273 | WHERE instName = (select instance_name from v$instance) 274 | and hostName= (select host_name from v$instance) 275 | and con_id=rbk.con_id; 276 | 277 | -- v$datafile is container-aware (no need for container clause) 278 | UPDATE rubrikDataCollection rbk 279 | SET datafileCount = (select count(*) from v$datafile where con_id=rbk.con_id group by con_id) 280 | WHERE instName = (select instance_name from v$instance) 281 | and hostName= (select host_name from v$instance) 282 | and con_id=rbk.con_id; 283 | 284 | -- v$logfile is container-aware (no need for container clause) 285 | UPDATE rubrikDataCollection rbk 286 | SET logfileCount = (select count(*) from v$logfile where con_id=rbk.con_id group by con_id) 287 | WHERE instName = (select instance_name from v$instance) 288 | and hostName= (select host_name from v$instance) 289 | and con_id=rbk.con_id; 290 | 291 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 292 | UPDATE rubrikDataCollection rbk 293 | SET logfileCount = (SELECT SUM(total) 294 | FROM ( 295 | select count(*) total from v$logfile where con_id=0 296 | UNION ALL 297 | select count(*) total from v$logfile where con_id=1 298 | )) 299 | WHERE instName = (select instance_name from v$instance) 300 | and hostName= (select host_name from v$instance) 301 | and rbk.con_id=1; 302 | 303 | UPDATE rubrikDataCollection rbk 304 | SET logfileCount = 0 305 | WHERE instName = (select instance_name from v$instance) 306 | and hostName= (select host_name from v$instance) 307 | and logfileCount is null; 308 | 309 | -- v$tempfile is container-aware (no need for container clause) 310 | UPDATE rubrikDataCollection rbk 311 | SET tempfileCount = (select count(*) from v$tempfile where con_id=rbk.con_id group by con_id) 312 | WHERE instName = (select instance_name from v$instance) 313 | and hostName= (select host_name from v$instance) 314 | and con_id=rbk.con_id; 315 | 316 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 317 | UPDATE rubrikDataCollection rbk 318 | SET tempfileCount = (SELECT SUM(total) 319 | FROM ( 320 | select count(*) total from v$tempfile where con_id=0 321 | UNION ALL 322 | select count(*) total from v$tempfile where con_id=1 323 | )) 324 | WHERE instName = (select instance_name from v$instance) 325 | and hostName= (select host_name from v$instance) 326 | and rbk.con_id=1; 327 | 328 | -- need to explicitly set tempfileCount if the previous query returns a null value 329 | UPDATE rubrikDataCollection rbk 330 | SET tempfileCount = 0 331 | WHERE instName = (select instance_name from v$instance) 332 | and hostName= (select host_name from v$instance) 333 | and tempfileCount is null; 334 | 335 | -- v$archived_log is container-aware (no need for container clause) 336 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 337 | UPDATE rubrikDataCollection rbk 338 | SET dailyRedoSize = (select dailyRedoSize from (select con_id, avg(redo_size/1024/1024) dailyRedoSize from (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by con_id) where con_id=rbk.con_id) 339 | WHERE instName = (select instance_name from v$instance) 340 | and hostName= (select host_name from v$instance) 341 | and con_id=rbk.con_id; 342 | 343 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 344 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 345 | UPDATE rubrikDataCollection rbk 346 | SET dailyRedoSize = (select dailyRedoSize from (select con_id, avg(redo_size/1024/1024) dailyRedoSize from (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by con_id) where con_id=0) 347 | WHERE instName = (select instance_name from v$instance) 348 | and hostName= (select host_name from v$instance) 349 | and rbk.con_id=1; 350 | 351 | -- need to explicitly set dailyRedoSize if the previous query return a null value 352 | UPDATE rubrikDataCollection rbk 353 | SET dailyRedoSize = 0 354 | WHERE instName = (select instance_name from v$instance) 355 | and hostName= (select host_name from v$instance) 356 | and dailyRedoSize is null; 357 | 358 | -- update temp table with con_name for recorded con_id 359 | update rubrikDataCollection rbk set con_id=0 where con_id is null; 360 | -- update root container and pdb seed names to include cdb database name 361 | update rubrikDataCollection rbk set conName=(select name ||'.CDB$ROOT'from v$database) where conName='CDB$ROOT'; 362 | update rubrikDataCollection rbk set conName=(select name ||'.PDB$SEED'from v$database) where conName='PDB$SEED'; 363 | -- update remaining pdbs to append CDB name so pdb/cdb relationships are not lost in the csv 364 | update rubrikDataCollection rbk set conName=(select name ||'.' from v$database)||conName where con_id>2; 365 | 366 | commit; 367 | 368 | -- format data collected for csv output 369 | -- set markup csv on 370 | set linesize 32000 371 | set colsep ,, 372 | set headsep off 373 | set head off 374 | set trimspool on 375 | set trimout on 376 | set feedback off 377 | set pagesize 0 378 | set wrap off 379 | 380 | spool rbkDiscovery.csv append 381 | 382 | -- select * from rubrikDataCollection; 383 | -- 20230322 - reordering query output to logically group data - smcelhinney 384 | -- 20240827 - changing column seperator to prevent data shift due to DG setting in LogArchiveConfig - smcelhinney 385 | select con_id ||',,'|| 386 | conName ||',,'|| 387 | dbSizeMB ||',,'|| 388 | allocated_dbSizeMB ||',,'|| 389 | dailyChangeRate ||',,'|| 390 | dailyRedoSize ||',,'|| 391 | datafileCount ||',,'|| 392 | tablespaceCount ||',,'|| 393 | encryptedTablespaceCount ||',,'|| 394 | encryptedDataSizeMB ||',,'|| 395 | biggestBigfileMB ||',,'|| 396 | bigfileTablespaceCount ||',,'|| 397 | bigfileDataSizeMB ||',,'|| 398 | blockSize ||',,'|| 399 | hostName ||',,'|| 400 | instName ||',,'|| 401 | dbVersion ||',,'|| 402 | dbEdition ||',,'|| 403 | platformName ||',,'|| 404 | dbName ||',,'|| 405 | dbUniqueName ||',,'|| 406 | dbID ||',,'|| 407 | flashbackEnabled ||',,'|| 408 | archiveLogEnabled ||',,'|| 409 | spfile ||',,'|| 410 | patchLevel ||',,'|| 411 | cpuCount ||',,'|| 412 | racEnabled ||',,'|| 413 | sgaMaxSize ||',,'|| 414 | sgaTarget ||',,'|| 415 | pgaAggregateTarget ||',,'|| 416 | physMemory ||',,'|| 417 | dNFSenabled ||',,'|| 418 | GoldenGate ||',,'|| 419 | exadataEnabled ||',,'|| 420 | bctEnabled ||',,'|| 421 | LogArchiveConfig ||',,'|| 422 | ArchiveLagTarget ||',,'|| 423 | logfileCount ||',,'|| 424 | tempfileCount 425 | from rubrikDataCollection; 426 | 427 | spool off 428 | 429 | truncate table rubrikDataCollection; 430 | 431 | drop table rubrikDataCollection; 432 | 433 | exit; 434 | -------------------------------------------------------------------------------- /ORACLE/rbkDataCollection_11g.sql: -------------------------------------------------------------------------------- 1 | REM Oracle Data Collection Script 2 | 3 | -- connect to the system schema 4 | --conn SYSTEM@$1 5 | 6 | -- create temporary table to hold all collected 7 | 8 | create global temporary table rubrikDataCollection 9 | ( 10 | con_id number, 11 | conName varchar2(128), 12 | dbSizeMB number, 13 | allocated_dbSizeMB number, 14 | biggestBigfileMB number, 15 | dailyChangeRate number, 16 | dailyRedoSize number, 17 | datafileCount number, 18 | hostName varchar2(64), 19 | instName varchar2(16), 20 | dbVersion varchar2(17), 21 | -- dbEdition varchar2(7), 22 | -- changing dbEdition size to support v$instance.version size 23 | dbEdition varchar2(100), 24 | platformName varchar2(101), 25 | dbName varchar2(9), 26 | dbUniqueName varchar2(30), 27 | dbID varchar2(200), 28 | flashbackEnabled varchar2(18), 29 | archiveLogEnabled varchar2(12), 30 | spfile varchar2(200), 31 | patchLevel varchar2(100), 32 | cpuCount number, 33 | blockSize number, 34 | racEnabled varchar2(20), 35 | sgaMaxSize number, 36 | sgaTarget number, 37 | pgaAggregateTarget number, 38 | physMemory number, 39 | dNFSenabled varchar2(20), 40 | GoldenGate varchar2(20), 41 | exadataEnabled varchar2(20), 42 | bctEnabled varchar2(20), 43 | LogArchiveConfig varchar2(200), 44 | ArchiveLagTarget number, 45 | tablespaceCount number, 46 | encryptedTablespaceCount number, 47 | encryptedDataSizeMB number, 48 | bigfileTablespaceCount number, 49 | bigfileDataSizeMB number, 50 | logfileCount number, 51 | tempfileCount number 52 | ) 53 | on commit preserve rows; 54 | 55 | 56 | insert into rubrikDataCollection 57 | ( 58 | conName, 59 | hostName, 60 | instName, 61 | dbVersion, 62 | platformName, 63 | dbName, 64 | dbUniqueName, 65 | dbID, 66 | flashbackEnabled, 67 | archiveLogEnabled 68 | ) 69 | select db.name, 70 | inst.host_name, 71 | inst.instance_name, 72 | inst.version, 73 | db.platform_name, 74 | db.name, 75 | db.db_unique_name, 76 | db.dbid, 77 | db.flashback_on, 78 | db.log_mode 79 | from v$instance inst, 80 | v$database db 81 | / 82 | 83 | 84 | -- to be improved 85 | -- dbEdition (EE, SE) info 86 | UPDATE rubrikDataCollection rbk 87 | SET dbEdition = (select * from v$version where ROWNUM = 1) 88 | WHERE instName = (select instance_name from v$instance) 89 | and hostName= (select host_name from v$instance); 90 | 91 | UPDATE rubrikDataCollection rbk 92 | SET spfile = (select decode(count(*), 0, 'NO', 'YES') from v$parameter where name='spfile') 93 | WHERE instName = (select instance_name from v$instance) 94 | and hostName= (select host_name from v$instance); 95 | 96 | UPDATE rubrikDataCollection rbk 97 | SET patchLevel = (select * from (select comments from DBA_REGISTRY_HISTORY where ACTION_TIME is not null order by action_time desc) where ROWNUM = 1) 98 | WHERE instName = (select instance_name from v$instance) 99 | and hostName= (select host_name from v$instance); 100 | 101 | UPDATE rubrikDataCollection rbk 102 | SET cpuCount = (SELECT value from v$parameter where name='cpu_count') 103 | WHERE instName = (select instance_name from v$instance) 104 | and hostName= (select host_name from v$instance); 105 | 106 | UPDATE rubrikDataCollection rbk 107 | SET blockSize = (SELECT value from v$parameter where name='db_block_size') 108 | WHERE instName = (select instance_name from v$instance) 109 | and hostName= (select host_name from v$instance); 110 | 111 | UPDATE rubrikDataCollection rbk 112 | SET racEnabled = (SELECT value from v$parameter where name='cluster_database') 113 | WHERE instName = (select instance_name from v$instance) 114 | and hostName= (select host_name from v$instance); 115 | 116 | UPDATE rubrikDataCollection rbk 117 | SET sgaMaxSize = (SELECT value from v$parameter where name='sga_max_size') 118 | WHERE instName = (select instance_name from v$instance) 119 | and hostName= (select host_name from v$instance); 120 | 121 | UPDATE rubrikDataCollection rbk 122 | SET sgaTarget = (SELECT value from v$parameter where name='sga_target') 123 | WHERE instName = (select instance_name from v$instance) 124 | and hostName= (select host_name from v$instance); 125 | 126 | UPDATE rubrikDataCollection rbk 127 | SET pgaAggregateTarget = (SELECT value from v$parameter where name='pga_aggregate_target') 128 | WHERE instName = (select instance_name from v$instance) 129 | and hostName= (select host_name from v$instance); 130 | 131 | UPDATE rubrikDataCollection rbk 132 | SET physMemory = (SELECT max(value) from dba_hist_osstat where stat_name = 'PHYSICAL_MEMORY_BYTES') 133 | WHERE instName = (select instance_name from v$instance) 134 | and hostName= (select host_name from v$instance); 135 | 136 | UPDATE rubrikDataCollection rbk 137 | SET dNFSenabled = (select decode(count(*), 0, 'No', 'Yes') from v$dnfs_servers) 138 | WHERE instName = (select instance_name from v$instance) 139 | and hostName= (select host_name from v$instance); 140 | 141 | UPDATE rubrikDataCollection rbk 142 | SET dbSizeMB = (select sum(bytes)/1024/1024 bytes from dba_segments) 143 | WHERE instName = (select instance_name from v$instance) 144 | and hostName= (select host_name from v$instance); 145 | 146 | UPDATE rubrikDataCollection rbk 147 | SET allocated_dbSizeMB = (select sum(bytes)/1024/1024 BYTES from v$datafile) 148 | WHERE instName = (select instance_name from v$instance) 149 | and hostName= (select host_name from v$instance); 150 | 151 | UPDATE rubrikDataCollection rbk 152 | SET GoldenGate = (select decode(count(*), 0, 'No', 'Yes') from v$archive_dest where status = 'VALID' and target = 'STANDBY') 153 | WHERE instName = (select instance_name from v$instance) 154 | and hostName= (select host_name from v$instance); 155 | 156 | UPDATE rubrikDataCollection rbk 157 | SET exadataEnabled = (select decode(count(*), 0, 'No', 'Yes') from v$cell) 158 | WHERE instName = (select instance_name from v$instance) 159 | and hostName= (select host_name from v$instance); 160 | 161 | UPDATE rubrikDataCollection rbk 162 | SET bctEnabled = (select status from v$block_change_tracking) 163 | WHERE instName = (select instance_name from v$instance) 164 | and hostName= (select host_name from v$instance); 165 | 166 | UPDATE rubrikDataCollection rbk 167 | SET LogArchiveConfig = (SELECT value from v$parameter where name='log_archive_config') 168 | WHERE instName = (select instance_name from v$instance) 169 | and hostName= (select host_name from v$instance); 170 | 171 | UPDATE rubrikDataCollection rbk 172 | SET LogArchiveConfig = 'NO' 173 | WHERE instName = (select instance_name from v$instance) 174 | and hostName= (select host_name from v$instance) 175 | and LogArchiveConfig is null; 176 | 177 | UPDATE rubrikDataCollection rbk 178 | SET ArchiveLagTarget = (SELECT value from v$parameter where name='archive_lag_target') 179 | WHERE instName = (select instance_name from v$instance) 180 | and hostName= (select host_name from v$instance); 181 | 182 | UPDATE rubrikDataCollection rbk 183 | SET tablespaceCount = (select count(*) from v$tablespace) 184 | WHERE instName = (select instance_name from v$instance) 185 | and hostName= (select host_name from v$instance); 186 | 187 | UPDATE rubrikDataCollection rbk 188 | SET encryptedTablespaceCount = (select count(*) from dba_tablespaces where encrypted='YES') 189 | WHERE instName = (select instance_name from v$instance) 190 | and hostName= (select host_name from v$instance); 191 | 192 | UPDATE rubrikDataCollection rbk 193 | SET encryptedDataSizeMB = (select sum(bytes/1024/1024) from (select sum(bytes) bytes from dba_data_files dbf, dba_tablespaces tbsp where dbf.tablespace_name=tbsp.tablespace_name and tbsp.encrypted='YES')) 194 | WHERE instName = (select instance_name from v$instance) 195 | and hostName= (select host_name from v$instance); 196 | 197 | UPDATE rubrikDataCollection rbk 198 | SET encryptedDataSizeMB = 0 199 | WHERE instName = (select instance_name from v$instance) 200 | and hostName= (select host_name from v$instance) 201 | and encryptedDataSizeMB is null; 202 | 203 | UPDATE rubrikDataCollection rbk 204 | SET bigfileTablespaceCount = (select count(*) from dba_tablespaces where bigfile='YES') 205 | WHERE instName = (select instance_name from v$instance) 206 | and hostName= (select host_name from v$instance); 207 | 208 | UPDATE rubrikDataCollection rbk 209 | SET biggestBigfileMB = (select sum(bytes/1024/1024) from (select max(bytes) bytes from dba_data_files dbf, dba_tablespaces tbsp where dbf.tablespace_name=tbsp.tablespace_name and tbsp.bigfile='YES')) 210 | WHERE instName = (select instance_name from v$instance) 211 | and hostName= (select host_name from v$instance); 212 | 213 | UPDATE rubrikDataCollection rbk 214 | SET biggestBigfileMB = 0 215 | WHERE instName = (select instance_name from v$instance) 216 | and hostName= (select host_name from v$instance) 217 | and biggestBigfileMB is null; 218 | 219 | UPDATE rubrikDataCollection rbk 220 | SET bigfileDataSizeMB = (select sum(bytes/1024/1024) from (select sum(bytes) bytes from dba_data_files dbf, dba_tablespaces tbsp where dbf.tablespace_name=tbsp.tablespace_name and tbsp.bigfile='YES')) 221 | WHERE instName = (select instance_name from v$instance) 222 | and hostName= (select host_name from v$instance); 223 | 224 | UPDATE rubrikDataCollection rbk 225 | SET bigfileDataSizeMB = 0 226 | WHERE instName = (select instance_name from v$instance) 227 | and hostName= (select host_name from v$instance) 228 | and bigfileDataSizeMB is null; 229 | 230 | -- 20220310 smcelhinney removing division by 100 from dailyChangeRate as it negatively skews change rate 231 | -- 20230321 updated change rate calculations to leverage cdb_segments to determine actual space USED instead of ALLOCATED - smcelhinney 232 | UPDATE rubrikDataCollection rbk 233 | SET dailyChangeRate = (select dailyChangeRate from (select round((avg(redo_size)/sum(sgmt.bytes)),8) dailyChangeRate from dba_segments sgmt, (select trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time)))) 234 | WHERE instName = (select instance_name from v$instance) 235 | and hostName= (select host_name from v$instance); 236 | 237 | UPDATE rubrikDataCollection rbk 238 | SET datafileCount = (select count(*) from v$datafile) 239 | WHERE instName = (select instance_name from v$instance) 240 | and hostName= (select host_name from v$instance); 241 | 242 | UPDATE rubrikDataCollection rbk 243 | SET logfileCount = (select count(*) from v$logfile) 244 | WHERE instName = (select instance_name from v$instance) 245 | and hostName= (select host_name from v$instance); 246 | 247 | UPDATE rubrikDataCollection rbk 248 | SET logfileCount = (select count(*) from v$logfile) 249 | WHERE instName = (select instance_name from v$instance) 250 | and hostName= (select host_name from v$instance); 251 | 252 | UPDATE rubrikDataCollection rbk 253 | SET tempfileCount = (select count(*) from v$tempfile) 254 | WHERE instName = (select instance_name from v$instance) 255 | and hostName= (select host_name from v$instance); 256 | 257 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 258 | UPDATE rubrikDataCollection rbk 259 | SET dailyRedoSize = (select dailyRedoSize from (select avg(redo_size/1024/1024) dailyRedoSize from (select trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time)))) 260 | WHERE instName = (select instance_name from v$instance) 261 | and hostName= (select host_name from v$instance); 262 | 263 | UPDATE rubrikDataCollection rbk 264 | SET dailyRedoSize = 0 265 | WHERE instName = (select instance_name from v$instance) 266 | and hostName= (select host_name from v$instance) 267 | and dailyRedoSize is null; 268 | 269 | 270 | -- update temp table with con_name for recorded con_id 271 | update rubrikDataCollection rbk set con_id=0 where con_id is null; 272 | 273 | commit; 274 | 275 | -- format data collected for json output 276 | set linesize 32000 277 | set colsep ,, 278 | set headsep off 279 | set head off 280 | set trimspool on 281 | set trimout on 282 | set feedback off 283 | set pagesize 0 284 | set wrap off 285 | 286 | spool rbkDiscovery.csv append 287 | 288 | -- 20230322 - reordering query output to logically group data - smcelhinney 289 | -- 20240827 - changing column separator to prevent data shift due to DG setting in LogArchiveConfig - smcelhinney 290 | select con_id ||',,'|| 291 | conName ||',,'|| 292 | dbSizeMB ||',,'|| 293 | allocated_dbSizeMB ||',,'|| 294 | dailyChangeRate ||',,'|| 295 | dailyRedoSize ||',,'|| 296 | datafileCount ||',,'|| 297 | tablespaceCount ||',,'|| 298 | encryptedTablespaceCount ||',,'|| 299 | encryptedDataSizeMB ||',,'|| 300 | biggestBigfileMB ||',,'|| 301 | bigfileTablespaceCount ||',,'|| 302 | bigfileDataSizeMB ||',,'|| 303 | blockSize ||',,'|| 304 | hostName ||',,'|| 305 | instName ||',,'|| 306 | dbVersion ||',,'|| 307 | dbEdition ||',,'|| 308 | platformName ||',,'|| 309 | dbName ||',,'|| 310 | dbUniqueName ||',,'|| 311 | dbID ||',,'|| 312 | flashbackEnabled ||',,'|| 313 | archiveLogEnabled ||',,'|| 314 | spfile ||',,'|| 315 | patchLevel ||',,'|| 316 | cpuCount ||',,'|| 317 | racEnabled ||',,'|| 318 | sgaMaxSize ||',,'|| 319 | sgaTarget ||',,'|| 320 | pgaAggregateTarget ||',,'|| 321 | physMemory ||',,'|| 322 | dNFSenabled ||',,'|| 323 | GoldenGate ||',,'|| 324 | exadataEnabled ||',,'|| 325 | bctEnabled ||',,'|| 326 | LogArchiveConfig ||',,'|| 327 | ArchiveLagTarget ||',,'|| 328 | logfileCount ||',,'|| 329 | tempfileCount 330 | from rubrikDataCollection; 331 | 332 | spool off 333 | 334 | truncate table rubrikDataCollection; 335 | 336 | drop table rubrikDataCollection; 337 | 338 | exit; 339 | -------------------------------------------------------------------------------- /ORACLE/rbkDataCollection_121.sql: -------------------------------------------------------------------------------- 1 | REM Oracle Data Collection Script 2 | 3 | -- connect to the system schema 4 | --conn SYSTEM@$1 5 | 6 | -- create private temporary table to hold all collected 7 | 8 | create global temporary table rubrikDataCollection 9 | ( 10 | con_id number, 11 | conName varchar2(128), 12 | dbSizeMB number, 13 | allocated_dbSizeMB number, 14 | biggestBigfileMB number, 15 | dailyChangeRate number, 16 | dailyRedoSize number, 17 | datafileCount number, 18 | hostName varchar2(64), 19 | instName varchar2(16), 20 | dbVersion varchar2(17), 21 | -- dbEdition varchar2(7), 22 | -- updating dbEdition to support larger entries in v$instance.version 23 | dbEdition varchar2(100), 24 | platformName varchar2(101), 25 | dbName varchar2(9), 26 | dbUniqueName varchar2(30), 27 | dbID varchar2(200), 28 | flashbackEnabled varchar2(18), 29 | archiveLogEnabled varchar2(12), 30 | spfile varchar2(200), 31 | patchLevel varchar2(100), 32 | cpuCount number, 33 | blockSize number, 34 | racEnabled varchar2(20), 35 | sgaMaxSize number, 36 | sgaTarget number, 37 | pgaAggregateTarget number, 38 | physMemory number, 39 | dNFSenabled varchar2(20), 40 | GoldenGate varchar2(20), 41 | exadataEnabled varchar2(20), 42 | bctEnabled varchar2(20), 43 | LogArchiveConfig varchar2(200), 44 | ArchiveLagTarget number, 45 | tablespaceCount number, 46 | encryptedTablespaceCount number, 47 | encryptedDataSizeMB number, 48 | bigfileTablespaceCount number, 49 | bigfileDataSizeMB number, 50 | logfileCount number, 51 | tempfileCount number 52 | ) 53 | on commit preserve rows; 54 | 55 | insert into rubrikDataCollection 56 | ( 57 | con_id, 58 | conName, 59 | hostName, 60 | instName, 61 | dbVersion, 62 | dbEdition, 63 | platformName, 64 | dbName, 65 | dbUniqueName, 66 | dbID, 67 | flashbackEnabled, 68 | archiveLogEnabled 69 | ) 70 | select cont.con_id, 71 | cont.name, 72 | inst.host_name, 73 | inst.instance_name, 74 | inst.version, 75 | inst.edition, 76 | db.platform_name, 77 | db.name, 78 | db.db_unique_name, 79 | cont.dbid, 80 | db.flashback_on, 81 | db.log_mode 82 | from v$instance inst, 83 | v$database db, 84 | v$containers cont 85 | / 86 | 87 | UPDATE rubrikDataCollection rbk 88 | SET spfile = (select decode(count(*), 0, 'NO', 'YES') from v$parameter where name='spfile') 89 | WHERE instName = (select instance_name from v$instance) 90 | and hostName= (select host_name from v$instance); 91 | 92 | -- result is the latest patch 93 | UPDATE rubrikDataCollection rbk 94 | SET patchLevel = (select * from (select description from dba_registry_sqlpatch order by ACTION_TIME desc) where ROWNUM = 1) 95 | WHERE instName = (select instance_name from v$instance) 96 | and hostName= (select host_name from v$instance); 97 | 98 | UPDATE rubrikDataCollection rbk 99 | SET cpuCount = (SELECT value from v$parameter where name='cpu_count') 100 | WHERE instName = (select instance_name from v$instance) 101 | and hostName= (select host_name from v$instance); 102 | 103 | UPDATE rubrikDataCollection rbk 104 | SET blockSize = (SELECT value from v$parameter where name='db_block_size') 105 | WHERE instName = (select instance_name from v$instance) 106 | and hostName= (select host_name from v$instance); 107 | 108 | UPDATE rubrikDataCollection rbk 109 | SET racEnabled = (SELECT value from v$parameter where name='cluster_database') 110 | WHERE instName = (select instance_name from v$instance) 111 | and hostName= (select host_name from v$instance); 112 | 113 | UPDATE rubrikDataCollection rbk 114 | SET sgaMaxSize = (SELECT value from v$parameter where name='sga_max_size') 115 | WHERE instName = (select instance_name from v$instance) 116 | and hostName= (select host_name from v$instance); 117 | 118 | UPDATE rubrikDataCollection rbk 119 | SET sgaTarget = (SELECT value from v$parameter where name='sga_target') 120 | WHERE instName = (select instance_name from v$instance) 121 | and hostName= (select host_name from v$instance); 122 | 123 | UPDATE rubrikDataCollection rbk 124 | SET pgaAggregateTarget = (SELECT value from v$parameter where name='pga_aggregate_target') 125 | WHERE instName = (select instance_name from v$instance) 126 | and hostName= (select host_name from v$instance); 127 | 128 | UPDATE rubrikDataCollection rbk 129 | SET physMemory = (SELECT max(value) from dba_hist_osstat where stat_name = 'PHYSICAL_MEMORY_BYTES') 130 | WHERE instName = (select instance_name from v$instance) 131 | and hostName= (select host_name from v$instance); 132 | 133 | UPDATE rubrikDataCollection rbk 134 | SET dNFSenabled = (select decode(count(*), 0, 'NO', 'YES') from v$dnfs_servers) 135 | WHERE instName = (select instance_name from v$instance) 136 | and hostName= (select host_name from v$instance); 137 | 138 | -- cdb_segments can use the containers clause. 139 | -- this query returns USED space per container 140 | UPDATE rubrikDataCollection rbk 141 | SET dbSizeMB = (select sum(bytes)/1024/1024 bytes from containers(cdb_segments) where con_id=rbk.con_id) 142 | WHERE instName = (select instance_name from v$instance) 143 | and hostName= (select host_name from v$instance) 144 | and con_id=rbk.con_id; 145 | 146 | UPDATE rubrikDataCollection rbk 147 | SET allocated_dbSizeMB = (select sum(bytes/1024/1024) bytes from v$datafile where con_id=rbk.con_id group by con_id) 148 | WHERE instName = (select instance_name from v$instance) 149 | and hostName= (select host_name from v$instance) 150 | and con_id=rbk.con_id; 151 | 152 | 153 | -- v$archive_dest is container-aware 154 | -- if cont_id is 0, it means the entire CDB 155 | UPDATE rubrikDataCollection rbk 156 | SET GoldenGate = (select decode(count(*), 0, 'NO', 'YES') from v$archive_dest where status = 'VALID' and target = 'STANDBY' and con_id=0) 157 | WHERE instName = (select instance_name from v$instance) 158 | and hostName= (select host_name from v$instance); 159 | 160 | UPDATE rubrikDataCollection rbk 161 | SET GoldenGate = (select decode(count(*), 0, 'NO', 'YES') from v$archive_dest where status = 'VALID' and target = 'STANDBY' and con_id=rbk.con_id) 162 | WHERE instName = (select instance_name from v$instance) 163 | and hostName= (select host_name from v$instance) 164 | and con_id=rbk.con_id; 165 | 166 | -- gv$cell is container-aware 167 | -- if cont_id is 0, it means the entire CDB 168 | UPDATE rubrikDataCollection rbk 169 | SET exadataEnabled = (select decode(count(*), 0, 'NO', 'YES') from v$cell where con_id=0) 170 | WHERE instName = (select instance_name from v$instance) 171 | and hostName= (select host_name from v$instance); 172 | 173 | UPDATE rubrikDataCollection rbk 174 | SET exadataEnabled = (select decode(count(*), 0, 'NO', 'YES') from v$cell where con_id=rbk.con_id) 175 | WHERE instName = (select instance_name from v$instance) 176 | and hostName= (select host_name from v$instance) 177 | and con_id=rbk.con_id; 178 | 179 | -- v$block_change_tracking is container-aware 180 | -- for now, BCT is allowed only in CDB 181 | UPDATE rubrikDataCollection rbk 182 | SET bctEnabled = (select status from v$block_change_tracking) 183 | WHERE instName = (select instance_name from v$instance) 184 | and hostName= (select host_name from v$instance); 185 | 186 | UPDATE rubrikDataCollection rbk 187 | SET LogArchiveConfig = (SELECT value from v$parameter where name='log_archive_config') 188 | WHERE instName = (select instance_name from v$instance) 189 | and hostName= (select host_name from v$instance); 190 | 191 | UPDATE rubrikDataCollection rbk 192 | SET LogArchiveConfig = 'NO' 193 | WHERE instName = (select instance_name from v$instance) 194 | and hostName= (select host_name from v$instance) 195 | and LogArchiveConfig is null; 196 | 197 | UPDATE rubrikDataCollection rbk 198 | SET ArchiveLagTarget = (SELECT value from v$parameter where name='archive_lag_target') 199 | WHERE instName = (select instance_name from v$instance) 200 | and hostName= (select host_name from v$instance); 201 | 202 | -- v$tablespace is container-aware 203 | UPDATE rubrikDataCollection rbk 204 | SET tablespaceCount = (select count(*) from v$tablespace where con_id=rbk.con_id group by con_id) 205 | WHERE instName = (select instance_name from v$instance) 206 | and hostName= (select host_name from v$instance) 207 | and con_id=rbk.con_id; 208 | 209 | -- containers clause works on dba_tablespaces -- NOT IN 12.1 210 | UPDATE rubrikDataCollection rbk 211 | SET encryptedTablespaceCount = (select count(*) from dba_tablespaces dba, v$tablespace v where dba.encrypted='YES' and dba.tablespace_name=v.name and v.con_id=rbk.con_id) 212 | WHERE instName = (select instance_name from v$instance) 213 | and hostName= (select host_name from v$instance) 214 | and con_id=rbk.con_id; 215 | 216 | -- containers clause works on dba_data_files and dba_tablespaces 217 | UPDATE rubrikDataCollection rbk 218 | SET encryptedDataSizeMB = (select sum(bytes/1024/1024) from (select dbf.con_id,sum(bytes) bytes from v$datafile dbf, v$tablespace v, dba_tablespaces tbsp where dbf.TS#=v.TS# and v.name=tbsp.tablespace_name and dbf.con_id=v.con_id and tbsp.encrypted='YES' group by dbf.con_id) where con_id=rbk.con_id) 219 | WHERE instName = (select instance_name from v$instance) 220 | and hostName= (select host_name from v$instance) 221 | and con_id=rbk.con_id; 222 | 223 | UPDATE rubrikDataCollection rbk 224 | SET encryptedDataSizeMB = 0 225 | WHERE instName = (select instance_name from v$instance) 226 | and hostName= (select host_name from v$instance) 227 | and encryptedDataSizeMB is null; 228 | 229 | UPDATE rubrikDataCollection rbk 230 | SET bigfileTablespaceCount = (select count(*) from dba_tablespaces where bigfile='YES' and con_id=rbk.con_id) 231 | WHERE instName = (select instance_name from v$instance) 232 | and hostName= (select host_name from v$instance) 233 | and con_id=rbk.con_id; 234 | 235 | -- containers clause works on dba_data_files and dba_tablespaces 236 | UPDATE rubrikDataCollection rbk 237 | SET biggestBigfileMB = (select sum(bytes/1024/1024) from (select dbf.con_id, max(bytes) bytes from v$datafile dbf, v$tablespace tbsp where dbf.TS#=tbsp.TS# and dbf.con_id=tbsp.con_id and tbsp.bigfile='YES' group by dbf.con_id) where con_id=rbk.con_id) 238 | WHERE instName = (select instance_name from v$instance) 239 | and hostName= (select host_name from v$instance) 240 | and con_id=rbk.con_id; 241 | 242 | UPDATE rubrikDataCollection rbk 243 | SET biggestBigfileMB = 0 244 | WHERE instName = (select instance_name from v$instance) 245 | and hostName= (select host_name from v$instance) 246 | and biggestBigfileMB is null; 247 | 248 | UPDATE rubrikDataCollection rbk 249 | SET bigfileDataSizeMB = (select sum(bytes/1024/1024) from (select dbf.con_id, sum(bytes) bytes from v$datafile dbf, v$tablespace tbsp where dbf.TS#=tbsp.TS# and dbf.con_id=tbsp.con_id and tbsp.bigfile='YES' group by dbf.con_id) where con_id=rbk.con_id) 250 | WHERE instName = (select instance_name from v$instance) 251 | and hostName= (select host_name from v$instance) 252 | and con_id=rbk.con_id; 253 | 254 | UPDATE rubrikDataCollection rbk 255 | SET bigfileDataSizeMB = 0 256 | WHERE instName = (select instance_name from v$instance) 257 | and hostName= (select host_name from v$instance) 258 | and bigfileDataSizeMB is null; 259 | 260 | -- v$datafile and v$archived_log are container-aware (no need for container clause) 261 | -- 20220310 smcelhinney removing division by 100 from dailyChangeRate as it negatively skews change rate 262 | -- 20230321 updated change rate calculations to leverage cdb_segments to determine actual space USED instead of ALLOCATED - smcelhinney 263 | UPDATE rubrikDataCollection rbk 264 | SET dailyChangeRate = (select dailyChangeRate from (select sgmt.con_id, round((avg(redo_size)/sum(sgmt.bytes)),8) dailyChangeRate from cdb_segments sgmt, (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by sgmt.con_id) where con_id=rbk.con_id) 265 | WHERE instName = (select instance_name from v$instance) 266 | and hostName= (select host_name from v$instance) 267 | and con_id=rbk.con_id; 268 | 269 | -- v$datafile is container-aware (no need for container clause) 270 | UPDATE rubrikDataCollection rbk 271 | SET datafileCount = (select count(*) from v$datafile where con_id=rbk.con_id group by con_id) 272 | WHERE instName = (select instance_name from v$instance) 273 | and hostName= (select host_name from v$instance) 274 | and con_id=rbk.con_id; 275 | 276 | -- v$logfile is container-aware (no need for container clause) 277 | UPDATE rubrikDataCollection rbk 278 | SET logfileCount = (select count(*) from v$logfile where con_id=rbk.con_id group by con_id) 279 | WHERE instName = (select instance_name from v$instance) 280 | and hostName= (select host_name from v$instance) 281 | and con_id=rbk.con_id; 282 | 283 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 284 | UPDATE rubrikDataCollection rbk 285 | SET logfileCount = (SELECT SUM(total) 286 | FROM ( 287 | select count(*) total from v$logfile where con_id=0 288 | UNION ALL 289 | select count(*) total from v$logfile where con_id=1 290 | )) 291 | WHERE instName = (select instance_name from v$instance) 292 | and hostName= (select host_name from v$instance) 293 | and rbk.con_id=1; 294 | 295 | UPDATE rubrikDataCollection rbk 296 | SET logfileCount = 0 297 | WHERE instName = (select instance_name from v$instance) 298 | and hostName= (select host_name from v$instance) 299 | and logfileCount is null; 300 | 301 | -- v$tempfile is container-aware (no need for container clause) 302 | UPDATE rubrikDataCollection rbk 303 | SET tempfileCount = (select count(*) from v$tempfile where con_id=rbk.con_id group by con_id) 304 | WHERE instName = (select instance_name from v$instance) 305 | and hostName= (select host_name from v$instance) 306 | and con_id=rbk.con_id; 307 | 308 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 309 | UPDATE rubrikDataCollection rbk 310 | SET tempfileCount = (SELECT SUM(total) 311 | FROM ( 312 | select count(*) total from v$tempfile where con_id=0 313 | UNION ALL 314 | select count(*) total from v$tempfile where con_id=1 315 | )) 316 | WHERE instName = (select instance_name from v$instance) 317 | and hostName= (select host_name from v$instance) 318 | and rbk.con_id=1; 319 | 320 | UPDATE rubrikDataCollection rbk 321 | SET tempfileCount = 0 322 | WHERE instName = (select instance_name from v$instance) 323 | and hostName= (select host_name from v$instance) 324 | and tempfileCount is null; 325 | 326 | -- v$archived_log is container-aware (no need for container clause) 327 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 328 | UPDATE rubrikDataCollection rbk 329 | SET dailyRedoSize = (select dailyRedoSize from (select con_id, avg(redo_size/1024/1024) dailyRedoSize from (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by con_id) where con_id=rbk.con_id) 330 | WHERE instName = (select instance_name from v$instance) 331 | and hostName= (select host_name from v$instance) 332 | and con_id=rbk.con_id; 333 | 334 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 335 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 336 | UPDATE rubrikDataCollection rbk 337 | SET dailyRedoSize = (select dailyRedoSize from (select con_id, avg(redo_size/1024/1024) dailyRedoSize from (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by con_id) where con_id=0) 338 | WHERE instName = (select instance_name from v$instance) 339 | and hostName= (select host_name from v$instance) 340 | and rbk.con_id=1; 341 | 342 | UPDATE rubrikDataCollection rbk 343 | SET dailyRedoSize = 0 344 | WHERE instName = (select instance_name from v$instance) 345 | and hostName= (select host_name from v$instance) 346 | and dailyRedoSize is null; 347 | 348 | -- update temp table with con_name for recorded con_id 349 | update rubrikDataCollection rbk set con_id=0 where con_id is null; 350 | -- update root container and pdb seed names to include cdb database name 351 | update rubrikDataCollection rbk set conName=(select name ||'.CDB$ROOT'from v$database) where conName='CDB$ROOT'; 352 | update rubrikDataCollection rbk set conName=(select name ||'.PDB$SEED'from v$database) where conName='PDB$SEED'; 353 | -- update remaining pdbs to append CDB name so pdb/cdb relationships are not lost in the csv 354 | update rubrikDataCollection rbk set conName=(select name ||'.' from v$database)||conName where con_id>2; 355 | 356 | commit; 357 | 358 | -- format data collected for csv output 359 | --set markup csv on 360 | set linesize 32000 361 | set colsep ,, 362 | set headsep off 363 | set head off 364 | set trimspool on 365 | set trimout on 366 | set feedback off 367 | set pagesize 0 368 | set wrap off 369 | 370 | spool rbkDiscovery.csv append 371 | 372 | -- select * from rubrikDataCollection; 373 | -- 20230322 - reordering query output to logically group data - smcelhinney 374 | -- 20240827 - changing column seperator to prevent data shift due to DG setting in LogArchiveConfig - smcelhinney 375 | select con_id ||',,'|| 376 | conName ||',,'|| 377 | dbSizeMB ||',,'|| 378 | allocated_dbSizeMB ||',,'|| 379 | dailyChangeRate ||',,'|| 380 | dailyRedoSize ||',,'|| 381 | datafileCount ||',,'|| 382 | tablespaceCount ||',,'|| 383 | encryptedTablespaceCount ||',,'|| 384 | encryptedDataSizeMB ||',,'|| 385 | biggestBigfileMB ||',,'|| 386 | bigfileTablespaceCount ||',,'|| 387 | bigfileDataSizeMB ||',,'|| 388 | blockSize ||',,'|| 389 | hostName ||',,'|| 390 | instName ||',,'|| 391 | dbVersion ||',,'|| 392 | dbEdition ||',,'|| 393 | platformName ||',,'|| 394 | dbName ||',,'|| 395 | dbUniqueName ||',,'|| 396 | dbID ||',,'|| 397 | flashbackEnabled ||',,'|| 398 | archiveLogEnabled ||',,'|| 399 | spfile ||',,'|| 400 | patchLevel ||',,'|| 401 | cpuCount ||',,'|| 402 | racEnabled ||',,'|| 403 | sgaMaxSize ||',,'|| 404 | sgaTarget ||',,'|| 405 | pgaAggregateTarget ||',,'|| 406 | physMemory ||',,'|| 407 | dNFSenabled ||',,'|| 408 | GoldenGate ||',,'|| 409 | exadataEnabled ||',,'|| 410 | bctEnabled ||',,'|| 411 | LogArchiveConfig ||',,'|| 412 | ArchiveLagTarget ||',,'|| 413 | logfileCount ||',,'|| 414 | tempfileCount 415 | from rubrikDataCollection; 416 | 417 | spool off 418 | 419 | truncate table rubrikDataCollection; 420 | 421 | drop table rubrikDataCollection; 422 | 423 | exit; 424 | -------------------------------------------------------------------------------- /ORACLE/rbkDataCollection_12c.sql: -------------------------------------------------------------------------------- 1 | REM Oracle Data Collection Script 2 | 3 | -- connect to the system schema 4 | --conn SYSTEM@$1 5 | 6 | -- create private temporary table to hold all collected 7 | 8 | create global temporary table rubrikDataCollection 9 | ( 10 | con_id number, 11 | conName varchar2(128), 12 | dbSizeMB number, 13 | allocated_dbSizeMB number, 14 | biggestBigfileMB number, 15 | dailyChangeRate number, 16 | dailyRedoSize number, 17 | datafileCount number, 18 | hostName varchar2(64), 19 | instName varchar2(16), 20 | dbVersion varchar2(17), 21 | -- dbEdition varchar2(7), 22 | -- updating dbEdition to support larger entries in v$instance.version 23 | dbEdition varchar2(100), 24 | platformName varchar2(101), 25 | dbName varchar2(9), 26 | dbUniqueName varchar2(30), 27 | dbID varchar2(200), 28 | flashbackEnabled varchar2(18), 29 | archiveLogEnabled varchar2(12), 30 | spfile varchar2(200), 31 | patchLevel varchar2(100), 32 | cpuCount number, 33 | blockSize number, 34 | racEnabled varchar2(20), 35 | sgaMaxSize number, 36 | sgaTarget number, 37 | pgaAggregateTarget number, 38 | physMemory number, 39 | dNFSenabled varchar2(20), 40 | GoldenGate varchar2(20), 41 | exadataEnabled varchar2(20), 42 | bctEnabled varchar2(20), 43 | LogArchiveConfig varchar2(200), 44 | ArchiveLagTarget number, 45 | tablespaceCount number, 46 | encryptedTablespaceCount number, 47 | encryptedDataSizeMB number, 48 | bigfileTablespaceCount number, 49 | bigfileDataSizeMB number, 50 | logfileCount number, 51 | tempfileCount number 52 | ) 53 | on commit preserve rows; 54 | 55 | insert into rubrikDataCollection 56 | ( 57 | con_id, 58 | conName, 59 | hostName, 60 | instName, 61 | dbVersion, 62 | dbEdition, 63 | platformName, 64 | dbName, 65 | dbUniqueName, 66 | dbID, 67 | flashbackEnabled, 68 | archiveLogEnabled 69 | ) 70 | select cont.con_id, 71 | cont.name, 72 | inst.host_name, 73 | inst.instance_name, 74 | inst.version, 75 | inst.edition, 76 | db.platform_name, 77 | db.name, 78 | db.db_unique_name, 79 | cont.dbid, 80 | db.flashback_on, 81 | db.log_mode 82 | from v$instance inst, 83 | v$database db, 84 | v$containers cont 85 | / 86 | 87 | UPDATE rubrikDataCollection rbk 88 | SET spfile = (select decode(count(*), 0, 'NO', 'YES') from v$parameter where name='spfile') 89 | WHERE instName = (select instance_name from v$instance) 90 | and hostName= (select host_name from v$instance); 91 | 92 | -- result is the latest patch 93 | UPDATE rubrikDataCollection rbk 94 | SET patchLevel = (select * from (select description from dba_registry_sqlpatch order by ACTION_TIME desc) where ROWNUM = 1) 95 | WHERE instName = (select instance_name from v$instance) 96 | and hostName= (select host_name from v$instance); 97 | 98 | UPDATE rubrikDataCollection rbk 99 | SET cpuCount = (SELECT value from v$parameter where name='cpu_count') 100 | WHERE instName = (select instance_name from v$instance) 101 | and hostName= (select host_name from v$instance); 102 | 103 | UPDATE rubrikDataCollection rbk 104 | SET blockSize = (SELECT value from v$parameter where name='db_block_size') 105 | WHERE instName = (select instance_name from v$instance) 106 | and hostName= (select host_name from v$instance); 107 | 108 | UPDATE rubrikDataCollection rbk 109 | SET racEnabled = (SELECT value from v$parameter where name='cluster_database') 110 | WHERE instName = (select instance_name from v$instance) 111 | and hostName= (select host_name from v$instance); 112 | 113 | UPDATE rubrikDataCollection rbk 114 | SET sgaMaxSize = (SELECT value from v$parameter where name='sga_max_size') 115 | WHERE instName = (select instance_name from v$instance) 116 | and hostName= (select host_name from v$instance); 117 | 118 | UPDATE rubrikDataCollection rbk 119 | SET sgaTarget = (SELECT value from v$parameter where name='sga_target') 120 | WHERE instName = (select instance_name from v$instance) 121 | and hostName= (select host_name from v$instance); 122 | 123 | UPDATE rubrikDataCollection rbk 124 | SET pgaAggregateTarget = (SELECT value from v$parameter where name='pga_aggregate_target') 125 | WHERE instName = (select instance_name from v$instance) 126 | and hostName= (select host_name from v$instance); 127 | 128 | UPDATE rubrikDataCollection rbk 129 | SET physMemory = (SELECT max(value) from dba_hist_osstat where stat_name = 'PHYSICAL_MEMORY_BYTES') 130 | WHERE instName = (select instance_name from v$instance) 131 | and hostName= (select host_name from v$instance); 132 | 133 | UPDATE rubrikDataCollection rbk 134 | SET dNFSenabled = (select decode(count(*), 0, 'NO', 'YES') from v$dnfs_servers) 135 | WHERE instName = (select instance_name from v$instance) 136 | and hostName= (select host_name from v$instance); 137 | 138 | -- cdb_segments can use the containers clause. 139 | -- this query returns USED space per container 140 | UPDATE rubrikDataCollection rbk 141 | SET dbSizeMB = (select sum(bytes)/1024/1024 bytes from containers(cdb_segments) where con_id=rbk.con_id) 142 | WHERE instName = (select instance_name from v$instance) 143 | and hostName= (select host_name from v$instance) 144 | and con_id=rbk.con_id; 145 | 146 | -- 20230322 - updated query to use containers clause 147 | UPDATE rubrikDataCollection rbk 148 | SET allocated_dbSizeMB = (select sum(bytes/1024/1024) bytes from containers(v$datafile) where con_id=rbk.con_id) 149 | WHERE instName = (select instance_name from v$instance) 150 | and hostName= (select host_name from v$instance) 151 | and con_id=rbk.con_id; 152 | 153 | 154 | -- v$archive_dest is container-aware 155 | -- if cont_id is 0, it means the entire CDB 156 | UPDATE rubrikDataCollection rbk 157 | SET GoldenGate = (select decode(count(*), 0, 'NO', 'YES') from v$archive_dest where status = 'VALID' and target = 'STANDBY' and con_id=0) 158 | WHERE instName = (select instance_name from v$instance) 159 | and hostName= (select host_name from v$instance); 160 | 161 | UPDATE rubrikDataCollection rbk 162 | SET GoldenGate = (select decode(count(*), 0, 'NO', 'YES') from v$archive_dest where status = 'VALID' and target = 'STANDBY' and con_id=rbk.con_id) 163 | WHERE instName = (select instance_name from v$instance) 164 | and hostName= (select host_name from v$instance) 165 | and con_id=rbk.con_id; 166 | 167 | -- gv$cell is container-aware 168 | -- if cont_id is 0, it means the entire CDB 169 | UPDATE rubrikDataCollection rbk 170 | SET exadataEnabled = (select decode(count(*), 0, 'NO', 'YES') from v$cell where con_id=0) 171 | WHERE instName = (select instance_name from v$instance) 172 | and hostName= (select host_name from v$instance); 173 | 174 | UPDATE rubrikDataCollection rbk 175 | SET exadataEnabled = (select decode(count(*), 0, 'NO', 'YES') from v$cell where con_id=rbk.con_id) 176 | WHERE instName = (select instance_name from v$instance) 177 | and hostName= (select host_name from v$instance) 178 | and con_id=rbk.con_id; 179 | 180 | -- v$block_change_tracking is container-aware 181 | -- for now, BCT is allowed only in CDB 182 | UPDATE rubrikDataCollection rbk 183 | SET bctEnabled = (select status from v$block_change_tracking) 184 | WHERE instName = (select instance_name from v$instance) 185 | and hostName= (select host_name from v$instance); 186 | 187 | UPDATE rubrikDataCollection rbk 188 | SET LogArchiveConfig = (SELECT value from v$parameter where name='log_archive_config') 189 | WHERE instName = (select instance_name from v$instance) 190 | and hostName= (select host_name from v$instance); 191 | 192 | UPDATE rubrikDataCollection rbk 193 | SET LogArchiveConfig = 'NO' 194 | WHERE instName = (select instance_name from v$instance) 195 | and hostName= (select host_name from v$instance) 196 | and LogArchiveConfig is null; 197 | 198 | UPDATE rubrikDataCollection rbk 199 | SET ArchiveLagTarget = (SELECT value from v$parameter where name='archive_lag_target') 200 | WHERE instName = (select instance_name from v$instance) 201 | and hostName= (select host_name from v$instance); 202 | 203 | -- v$tablespace is container-aware 204 | UPDATE rubrikDataCollection rbk 205 | SET tablespaceCount = (select count(*) from v$tablespace where con_id=rbk.con_id group by con_id) 206 | WHERE instName = (select instance_name from v$instance) 207 | and hostName= (select host_name from v$instance) 208 | and con_id=rbk.con_id; 209 | 210 | -- containers clause works on dba_tablespaces 211 | UPDATE rubrikDataCollection rbk 212 | SET encryptedTablespaceCount = (select count(*) from containers(dba_tablespaces) where encrypted='YES' and con_id=rbk.con_id) 213 | WHERE instName = (select instance_name from v$instance) 214 | and hostName= (select host_name from v$instance) 215 | and con_id=rbk.con_id; 216 | 217 | -- containers clause works on dba_data_files and dba_tablespaces 218 | UPDATE rubrikDataCollection rbk 219 | SET encryptedDataSizeMB = (select sum(bytes/1024/1024) from (select dbf.con_id,sum(bytes) bytes from containers(dba_data_files) dbf, containers(dba_tablespaces) tbsp where dbf.tablespace_name=tbsp.tablespace_name and dbf.con_id=tbsp.con_id and tbsp.encrypted='YES' group by dbf.con_id) where con_id=rbk.con_id) 220 | WHERE instName = (select instance_name from v$instance) 221 | and hostName= (select host_name from v$instance) 222 | and con_id=rbk.con_id; 223 | 224 | UPDATE rubrikDataCollection rbk 225 | SET encryptedDataSizeMB = 0 226 | WHERE instName = (select instance_name from v$instance) 227 | and hostName= (select host_name from v$instance) 228 | and encryptedDataSizeMB is null; 229 | 230 | UPDATE rubrikDataCollection rbk 231 | SET bigfileTablespaceCount = (select count(*) from containers(dba_tablespaces) where bigfile='YES' and con_id=rbk.con_id) 232 | WHERE instName = (select instance_name from v$instance) 233 | and hostName= (select host_name from v$instance) 234 | and con_id=rbk.con_id; 235 | 236 | -- containers clause works on dba_data_files and dba_tablespaces 237 | UPDATE rubrikDataCollection rbk 238 | SET biggestBigfileMB = (select sum(bytes/1024/1024) from (select dbf.con_id, max(bytes) bytes from containers(dba_data_files) dbf, containers(dba_tablespaces) tbsp where dbf.tablespace_name=tbsp.tablespace_name and dbf.con_id=tbsp.con_id and tbsp.bigfile='YES' group by dbf.con_id) where con_id=rbk.con_id) 239 | WHERE instName = (select instance_name from v$instance) 240 | and hostName= (select host_name from v$instance) 241 | and con_id=rbk.con_id; 242 | 243 | UPDATE rubrikDataCollection rbk 244 | SET biggestBigfileMB = 0 245 | WHERE instName = (select instance_name from v$instance) 246 | and hostName= (select host_name from v$instance) 247 | and biggestBigfileMB is null; 248 | 249 | UPDATE rubrikDataCollection rbk 250 | SET bigfileDataSizeMB = (select sum(bytes/1024/1024) from (select dbf.con_id, sum(bytes) bytes from containers(dba_data_files) dbf, containers(dba_tablespaces) tbsp where dbf.tablespace_name=tbsp.tablespace_name and dbf.con_id=tbsp.con_id and tbsp.bigfile='YES' group by dbf.con_id) where con_id=rbk.con_id) 251 | WHERE instName = (select instance_name from v$instance) 252 | and hostName= (select host_name from v$instance) 253 | and con_id=rbk.con_id; 254 | 255 | UPDATE rubrikDataCollection rbk 256 | SET bigfileDataSizeMB = 0 257 | WHERE instName = (select instance_name from v$instance) 258 | and hostName= (select host_name from v$instance) 259 | and bigfileDataSizeMB is null; 260 | 261 | -- v$datafile and v$archived_log are container-aware (no need for container clause) 262 | -- 20220310 smcelhinney removing division by 100 from dailyChangeRate as it negatively skews change rate 263 | -- 20230321 updated change rate calculations to leverage cdb_segments to determine actual space USED instead of ALLOCATED - smcelhinney 264 | UPDATE rubrikDataCollection rbk 265 | SET dailyChangeRate = (select dailyChangeRate from (select dbf.con_id, round((avg(redo_size)/sum(sgmt.bytes)),8) dailyChangeRate from containers(cdb_segments) sgmt, (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from containers(v$archived_log) where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by sgmt.con_id) where con_id=rbk.con_id) 266 | WHERE instName = (select instance_name from v$instance) 267 | and hostName= (select host_name from v$instance) 268 | and con_id=rbk.con_id; 269 | 270 | -- v$datafile is container-aware (no need for container clause) 271 | UPDATE rubrikDataCollection rbk 272 | SET datafileCount = (select count(*) from v$datafile where con_id=rbk.con_id group by con_id) 273 | WHERE instName = (select instance_name from v$instance) 274 | and hostName= (select host_name from v$instance) 275 | and con_id=rbk.con_id; 276 | 277 | -- v$logfile is container-aware (no need for container clause) 278 | UPDATE rubrikDataCollection rbk 279 | SET logfileCount = (select count(*) from v$logfile where con_id=rbk.con_id group by con_id) 280 | WHERE instName = (select instance_name from v$instance) 281 | and hostName= (select host_name from v$instance) 282 | and con_id=rbk.con_id; 283 | 284 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 285 | UPDATE rubrikDataCollection rbk 286 | SET logfileCount = (SELECT SUM(total) 287 | FROM ( 288 | select count(*) total from v$logfile where con_id=0 289 | UNION ALL 290 | select count(*) total from v$logfile where con_id=1 291 | )) 292 | WHERE instName = (select instance_name from v$instance) 293 | and hostName= (select host_name from v$instance) 294 | and rbk.con_id=1; 295 | 296 | UPDATE rubrikDataCollection rbk 297 | SET logfileCount = 0 298 | WHERE instName = (select instance_name from v$instance) 299 | and hostName= (select host_name from v$instance) 300 | and logfileCount is null; 301 | 302 | -- v$tempfile is container-aware (no need for container clause) 303 | UPDATE rubrikDataCollection rbk 304 | SET tempfileCount = (select count(*) from v$tempfile where con_id=rbk.con_id group by con_id) 305 | WHERE instName = (select instance_name from v$instance) 306 | and hostName= (select host_name from v$instance) 307 | and con_id=rbk.con_id; 308 | 309 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 310 | UPDATE rubrikDataCollection rbk 311 | SET tempfileCount = (SELECT SUM(total) 312 | FROM ( 313 | select count(*) total from v$tempfile where con_id=0 314 | UNION ALL 315 | select count(*) total from v$tempfile where con_id=1 316 | )) 317 | WHERE instName = (select instance_name from v$instance) 318 | and hostName= (select host_name from v$instance) 319 | and rbk.con_id=1; 320 | 321 | UPDATE rubrikDataCollection rbk 322 | SET tempfileCount = 0 323 | WHERE instName = (select instance_name from v$instance) 324 | and hostName= (select host_name from v$instance) 325 | and tempfileCount is null; 326 | 327 | -- v$archived_log is container-aware (no need for container clause) 328 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 329 | UPDATE rubrikDataCollection rbk 330 | SET dailyRedoSize = (select dailyRedoSize from (select con_id, avg(redo_size/1024/1024) dailyRedoSize from (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by con_id) where con_id=rbk.con_id) 331 | WHERE instName = (select instance_name from v$instance) 332 | and hostName= (select host_name from v$instance) 333 | and con_id=rbk.con_id; 334 | 335 | -- as Multitenant instance won't have con_id=0, the result will be add into the root container (con_id=1) 336 | -- 20230322 - updating query to return dailyRedoSize in MB - smcelhinney 337 | UPDATE rubrikDataCollection rbk 338 | SET dailyRedoSize = (select dailyRedoSize from (select con_id, avg(redo_size/1024/1024) dailyRedoSize from (select con_id, trunc(completion_time) rundate, sum(blocks*block_size) redo_size from v$archived_log where first_time > sysdate - 7 group by trunc(completion_time), con_id) group by con_id) where con_id=0) 339 | WHERE instName = (select instance_name from v$instance) 340 | and hostName= (select host_name from v$instance) 341 | and rbk.con_id=1; 342 | 343 | UPDATE rubrikDataCollection rbk 344 | SET dailyRedoSize = 0 345 | WHERE instName = (select instance_name from v$instance) 346 | and hostName= (select host_name from v$instance) 347 | and dailyRedoSize is null; 348 | 349 | -- update temp table with con_name for recorded con_id 350 | update rubrikDataCollection rbk set con_id=0 where con_id is null; 351 | -- update root container and pdb seed names to include cdb database name 352 | update rubrikDataCollection rbk set conName=(select name ||'.CDB$ROOT'from v$database) where conName='CDB$ROOT'; 353 | update rubrikDataCollection rbk set conName=(select name ||'.PDB$SEED'from v$database) where conName='PDB$SEED'; 354 | -- update remaining pdbs to append CDB name so pdb/cdb relationships are not lost in the csv 355 | update rubrikDataCollection rbk set conName=(select name ||'.' from v$database)||conName where con_id>2; 356 | 357 | commit; 358 | 359 | -- format data collected for csv output 360 | --set markup csv on 361 | set linesize 32000 362 | set colsep ,, 363 | set headsep off 364 | set head off 365 | set trimspool on 366 | set trimout on 367 | set feedback off 368 | set pagesize 0 369 | set wrap off 370 | 371 | spool rbkDiscovery.csv append 372 | 373 | -- select * from rubrikDataCollection; 374 | -- 20230322 - reordering query output to logically group data - smcelhinney 375 | -- 20240827 - changing column seperator to prevent data shift due to DG setting in LogArchiveConfig - smcelhinney 376 | select con_id ||',,'|| 377 | conName ||',,'|| 378 | dbSizeMB ||',,'|| 379 | allocated_dbSizeMB ||',,'|| 380 | dailyChangeRate ||',,'|| 381 | dailyRedoSize ||',,'|| 382 | datafileCount ||',,'|| 383 | tablespaceCount ||',,'|| 384 | encryptedTablespaceCount ||',,'|| 385 | encryptedDataSizeMB ||',,'|| 386 | biggestBigfileMB ||',,'|| 387 | bigfileTablespaceCount ||',,'|| 388 | bigfileDataSizeMB ||',,'|| 389 | blockSize ||',,'|| 390 | hostName ||',,'|| 391 | instName ||',,'|| 392 | dbVersion ||',,'|| 393 | dbEdition ||',,'|| 394 | platformName ||',,'|| 395 | dbName ||',,'|| 396 | dbUniqueName ||',,'|| 397 | dbID ||',,'|| 398 | flashbackEnabled ||',,'|| 399 | archiveLogEnabled ||',,'|| 400 | spfile ||',,'|| 401 | patchLevel ||',,'|| 402 | cpuCount ||',,'|| 403 | racEnabled ||',,'|| 404 | sgaMaxSize ||',,'|| 405 | sgaTarget ||',,'|| 406 | pgaAggregateTarget ||',,'|| 407 | physMemory ||',,'|| 408 | dNFSenabled ||',,'|| 409 | GoldenGate ||',,'|| 410 | exadataEnabled ||',,'|| 411 | bctEnabled ||',,'|| 412 | LogArchiveConfig ||',,'|| 413 | ArchiveLagTarget ||',,'|| 414 | logfileCount ||',,'|| 415 | tempfileCount 416 | from rubrikDataCollection; 417 | 418 | spool off 419 | 420 | truncate table rubrikDataCollection; 421 | 422 | drop table rubrikDataCollection; 423 | 424 | exit; 425 | -------------------------------------------------------------------------------- /ORACLE/rbkDiscovery.csv: -------------------------------------------------------------------------------- 1 | CON_ID,CONNAME,DBSIZEMB,ALLOCATED_DBSIZEMB,DAILYCHANGERATE,DAILYREDOSIZEMB,DATAFILECOUNT,TABLESPACECOUNT,ENCRYPTEDTABLESPACECOUNT,ENCRYPTEDDATASIZEMB,BIGGESTBIGFILEMB,BIGFILETABLESPACECOUNT,BIGFILEDATASIZEMB,BLOCKSIZE,HOSTNAME,INSTNAME,DBVERSION,DBEDITION,PLATFORMNAME,DBNAME,DBUNIQUENAME,DBID,FLASHBACKENABLED,ARCHIVELOGENABLED,SPFILE,PATCHLEVEL,CPUCOUNT,RACENABLED,SGAMAXSIZE,SGATARGET,PGAAGGREGATETARGET,PHYSMEMORY,DNFSENABLED,GOLDENGATE,EXADATAENABLED,BCTENABLED,LOGARCHIVECONFIG,ARCHIVELAGTARGET,LOGFILECOUNT,TEMPFILECOUNT -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rubrik Sizing Scripts 2 | This repository contains sizing scripts for use by Rubrik Sales Engineers and Rubrik customers to gather data for Rubrik sizing. 3 | 4 | CODE HERE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 5 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 6 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 7 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR 8 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 9 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 10 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /VMWARE/Get-VMwareDiskStats.ps1: -------------------------------------------------------------------------------- 1 | #requires -module VMware.PowerCLI 2 | # https://build.rubrik.com 3 | 4 | <# 5 | .SYNOPSIS 6 | Pulls VMware VM and VMDK write throughput disk stats for Rubrik sizing. 7 | 8 | .DESCRIPTION 9 | The Get-VMwareDiskStats.ps1 script pulls VM and VMDK write throughput disk stats for Rubrik sizing. 10 | Requires PowerCLI and a vCenter read-only user. 11 | 12 | .NOTES 13 | Written by Steven Tong for community usage 14 | GitHub: stevenctong 15 | Date: 10/20/21 16 | 17 | vCenter stats collection should be configured for at least Level 2, duration 5 min, saved for 5 days. 18 | If there is not enough space in vCenter to save it for 5 days then run this script multiple times to collect the data. 19 | Make sure that the data gathering covers the busiest days for the VMs. 20 | To configure stats collection, click on your vCenter -> Configure -> General -> Edit 21 | 22 | $highKBps and $lowKBps are set to highlight any VMDKs that we need to take a closer look at for sizing. 23 | 24 | This script will attempt to gather 5 min stats for a list of VMs. 25 | Three different results files may be created: 26 | 1) VM level stats - for each 5 min time period, contains the sum of all VM write throughput 27 | 2) VMDK level stats - a list of any VMDK that has a write throughput greater than $lowKBps 28 | 3) Raw stats that are gathered - if the # of rows are too large, the output will be split by each day 29 | 30 | By default, the script will gather stats for all VMs listed in vCenter. 31 | You can also pass in a CSV with a list of VMs to gather stats for. 32 | The list of VMs should have a column "Name" with a list of VMs to gather stats for. 33 | 34 | A list of VMs in vCenter can also be generated with this script which can be edited and then passed back in. 35 | 36 | If you are using Windows Powershell (not Core) you can also store vCenter credentials using: 37 | - New-VICredentialStoreItem 38 | 39 | .EXAMPLE 40 | ./Get-VMwareDiskStats.ps1 41 | Prompts for vCenter server & login and gets stats for all VMs. 42 | 43 | ./Get-VMwareDiskStats.ps1 -server 44 | Prompts for vCenter username & password and gets stats on all VMs. 45 | 46 | ./Get-VMwareDiskStats.ps1 -server -username -password 47 | Pass your vCenter credentials as parameters and get stats on all VMs. 48 | 49 | ./Get-VMwareDiskStats.ps1 -outputVMfile 50 | Outputs a list of VMs from vCenter and exits script. Prompts for vCenter info. 51 | 52 | ./Get-VMwareDiskStats.ps1 -importVMfile 53 | Imports a list of VMs to gather stats on. VMs should be under a "Name" column. Prompts for vCenter info. 54 | 55 | #> 56 | 57 | param ( 58 | [CmdletBinding()] 59 | 60 | # vCenter server hostname or IP address 61 | [Parameter(Mandatory=$false)] 62 | [string]$server = '', 63 | 64 | # vCenter username 65 | [Parameter(Mandatory=$false)] 66 | [string]$user = '', 67 | 68 | # vCenter password 69 | [Parameter(Mandatory=$false)] 70 | [string]$password = '', 71 | 72 | # Specify a filename just to output a list of VMs to a CSV file 73 | [Parameter(Mandatory=$false)] 74 | [string]$outputVMfile = '', 75 | 76 | # Specify a filename with a list of VMs to gather stats on using the "Name" column 77 | [Parameter(Mandatory=$false)] 78 | [string]$importVMfile = $null 79 | ) 80 | 81 | Import-Module VMware.PowerCLI 82 | 83 | # Base filename to output the stats to 84 | $vmCSVoutput = "./vm_level_disk_stats-" 85 | $vmdkCSVoutput = "./vmdk_level_disk_stats-" 86 | $rawCSVoutput = "./vm_raw_disk_stats-" 87 | 88 | # List of stats to gather 89 | $statList = @('virtualDisk.write.average') 90 | # Max sustained KBps to highlight for a VMDK 91 | $highKBps = 50000 92 | # Warning sustained KBps to highlight for a VMDK 93 | $lowKBps = 40000 94 | 95 | ### Begin - PowerCLI authentication ### 96 | if (!$server) { $server = Read-Host "vCenter hostname or IP" } 97 | 98 | if (!$user) { 99 | Connect-VIServer -server $server 100 | } else { 101 | Connect-VIServer -server $server -user $user -password $password 102 | } 103 | ### End - PowerCLI authentication 104 | 105 | $date = Get-Date 106 | 107 | # Get a list of VMs, output to the specified CSV file, and exit script 108 | if ($outputVMfile -ne '') 109 | { 110 | Get-VM | Export-Csv -NoTypeInformation -Path $outVMFile 111 | exit 112 | } 113 | 114 | # If a CSV with a list of VMs is specified, import it. 115 | # Otherwise, get a list of all VMs from vCenter to run the stats collection against. 116 | if ($importVMfile -ne '') 117 | { 118 | Write-Host "`nImporting VM list CSV file: $importVMfile`n" -foregroundcolor Green 119 | $vmList = Import-CSV $importVMfile | Sort-Object 120 | } else { 121 | $vmList = Get-VM | Sort-Object 122 | } 123 | 124 | # Initialize arrays to hold the gathered data in 125 | $vmDataArray = @() 126 | $vmdkDataArray = @() 127 | 128 | # For each VM, gather status 129 | foreach ($vm in $vmList) 130 | { 131 | Write-Host "Getting stats for VM: $($vm.Name)" 132 | # Loop through each stat we want to gather 133 | foreach ($stat in $statList) 134 | { 135 | $data = Get-Stat -entity $vm.Name -stat $stat -interval 5 136 | 137 | # If there is no "Instance" (disk) value then add it to the VM level array 138 | $vmDataArray += $data | Where Instance -eq '' 139 | 140 | # If there is "Instance" (disk) value then add it to the VMDK level array 141 | $vmdkDataArray += $data | Where Instance -ne '' 142 | } # foreach ($stat in $statList) 143 | } # foreach ($vm in $vmList) 144 | 145 | # Initialize array to hold calculated results in 146 | $vmResults = @() 147 | 148 | # For VM level stats, group everything by Timestamp 149 | $vmGroup = $vmDataArray | Group-Object -Property Timestamp 150 | 151 | # For VM level stats, sum up the values for each Timestamp 152 | foreach ($i in $vmGroup) 153 | { 154 | $KBpsPerTimestamp = [PSCustomObject] @{ 155 | KBps = ($i.group | Measure-Object -Property Value -Sum).Sum 156 | Timestamp = $i.name 157 | MetricId = $i.group[0].MetricId 158 | } 159 | $vmResults += $KBpsPerTimestamp 160 | } # foreach ($i in $vmGroup) 161 | 162 | # For each VMDK level stat, build a list of VMDKs whose Value are greater than $highKBps 163 | $highVMDKs = $vmdkDataArray | Where Value -ge $highKBps | Sort-Object -Property Value -Descending | 164 | Select @{n='KBps'; e={$_.Value}}, @{n='VM'; e={$_.Entity}}, 'Instance', 'Timestamp', 'MetricId' 165 | 166 | # For each VMDK level stat, build a list of VMDKs whose Value are greater than $lowKBps 167 | $lowVMDKs = $vmdkDataArray | Where { $_.value -ge $lowKBps -and $_.value -lt $highKBps } | 168 | Sort-Object -Property Value -Descending | Select @{n='KBps'; e={$_.Value}}, @{n='VM'; e={$_.Entity}}, 'Instance', 'Timestamp', 'MetricId' 169 | 170 | Write-Host "" 171 | Write-Host "These VMDKs had sustained write throughput that crossed the low threshold of $lowKBps KBps:" -foregroundcolor green 172 | $lowVMDKs | Format-Table 173 | 174 | Write-Host "These VMDKs had sustained write throughput that crossed the high threshold of $highKBps KBps:" -foregroundcolor green 175 | $highVMDKs | Format-Table 176 | 177 | Write-Host "Top 5 time time periods that had the highest sustained write throughput:" -foregroundcolor green 178 | $vmResults | Sort-Object KBps -Desc | Select -First 5 | Format-Table 179 | 180 | Write-Host 181 | Write-Host "Total times a VMDK crossed the low threshold of $lowKBps KBps: $($lowVMDKs.count)" 182 | Write-Host "Total times a VMDK crossed the high threshold of $highKBps KBps: $($highVMDKs.count)" 183 | Write-Host "" 184 | Write-Host "Number of unique VMs that crossed the low threshold of $lowKBps KBps: $(($lowVMDKs.VM | 185 | Sort-Object | Unique).count)" -foregroundcolor green 186 | Write-Host "Number of unique VMs that crossed the high threshold of $highKBps KBps: $(($highVMDKs.VM | 187 | Sort-Object | Unique).count)" -foregroundcolor green 188 | Write-Host "Highest sustained write throughput: $(($vmResults.KBps | Measure -Maximum).maximum) KBps" -foregroundcolor green 189 | Write-Host "Average sustained write throughput: $((($vmResults.KBps | Measure -Average).average).ToString("#.###")) KBps" -foregroundcolor green 190 | Write-Host 191 | 192 | if ($vmResults.count -gt 0) { 193 | $vmResults | Export-CSV -NoTypeInformation -Path $vmCSVoutput$($date.ToString("yyyy-MM-dd_HHmm")).csv 194 | Write-Host "VM level results output to: $vmCSVoutput$($date.ToString("yyyy-MM-dd_HHmm")).csv" -foregroundcolor green 195 | } else { 196 | Write-Host "No VM level results to output" -foregroundcolor green 197 | } 198 | 199 | # Combine VMDKs that are above $lowKBps and $highKBps into one and output to a CSV file if there are results 200 | $highVMDKs += $lowVMDKs 201 | if ($highVMDKs.count -gt 0) { 202 | $highVMDKs | Export-CSV -NoTypeInformation -Path $vmdkCSVoutput$($date.ToString("yyyy-MM-dd_HHmm")).csv 203 | Write-Host "VMDK level results output to: $vmdkCSVoutput$($date.ToString("yyyy-MM-dd_HHmm")).csv" -foregroundcolor green 204 | } else { 205 | Write-Host "No VMDK throughput higher than low threshold to output" -foregroundcolor green 206 | } 207 | 208 | # Combine the raw results for the VM summary results and VMDK results 209 | $vmDataArray += $vmdkDataArray 210 | 211 | # Excel supports 1M rows. If the raw data is less than a large number, output raw results to a single file 212 | # Otherwise, split up outputting the raw data by date 213 | if ($vmDataArray.count -eq 0) { 214 | Write-Host "No raw data captured to output" -foregroundcolor green 215 | } elseif ($vmDataArray.count -lt 800000) 216 | { 217 | $vmDataArray | Select 'Timestamp', 'Value', 'Entity', 'Instance', 'MetricId', 'Unit', 'IntervalSecs' | 218 | Export-CSV -NoTypeInformation -Path $rawCSVoutput$($date.ToString("yyyy-MM-dd_HHmm")).csv 219 | Write-Host "Raw data captured output to: $rawCSVoutput$($date.ToString("yyyy-MM-dd_HHmm")).csv" -foregroundcolor green 220 | } else { 221 | Write-Host "Splitting raw data output by date since number of rows was very large" 222 | for ($days = 0; $days -gt -7; $days--) { 223 | $dateComp = $date.date.adddays($days) 224 | 225 | if (($vmDataArray | Where-object { $_.timestamp.date -eq $dateComp.date }).count -gt 0) { 226 | $vmDataArray | Where-object { $_.timestamp.date -eq $dateComp.date } | 227 | Select 'Timestamp', 'Value', 'Entity', 'Instance', 'MetricId', 'Unit', 'IntervalSecs' | 228 | Export-CSV -NoTypeInformation -Path $rawCSVoutput$($dateComp.ToString("MM-dd"))_$($date.ToString("yyyy-MM-dd_HHmm")).csv 229 | Write-Host "Raw data captured output to: $rawCSVoutput$($dateComp.ToString("MM-dd"))_$($date.ToString("yyyy-MM-dd_HHmm")).csv" -foregroundcolor green 230 | } 231 | } 232 | } 233 | --------------------------------------------------------------------------------