New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_blitz incorrectly excludes checks on EC2 VM with default name #1925

Closed
rknight29 opened this Issue Jan 18, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@rknight29
Copy link

rknight29 commented Jan 18, 2019

Version of the script
7.1

What is the current behavior?
When running on an EC2 VM (actually an AWS workspace in this case) it will exclude the checks that don't work on RDS. This is because it is looking at the server name to decide if its RDS or not.

If the current behavior is a bug, please provide the steps to reproduce.
Run on any server with a hostname staring with EC2AMAZ-. It doesn't even have to be an AWS instance.

What is the expected behavior?
This should only apply to actual RDS databases, not IaaS VMs

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
I just noticed this so I don't know. This was on SQL 2017 but it doesn't appear to be in a version specific part of the code.

2019-01-17 18_14_11-sqlquery10 sql - local ssg_healthcheck_a09610eb011c4e6eb03896c7da3fd43c corp_

@BrentOzar

This comment has been minimized.

Copy link
Member

BrentOzar commented Jan 18, 2019

Awwww, c'mon, man, you're not even bothering to change your server names? ;-)

Yeah, I bet I can reverse engineer it based on some of the system objects they put in. I'll spin one up and check.

@BrentOzar BrentOzar self-assigned this Jan 18, 2019

BrentOzar added a commit that referenced this issue Jan 18, 2019

#1925 sp_Blitz AWS RDS detection
Don't just rely on EC2 VM name to detect RDS. Also adds a new result noting that checks were skipped. Closes #1925.
@BrentOzar

This comment has been minimized.

Copy link
Member

BrentOzar commented Jan 18, 2019

Fixed. The dev branch now detects RDS by also looking for:

		   AND db_id('rdsadmin') IS NOT NULL
		   AND EXISTS(SELECT * FROM master.sys.all_objects WHERE name IN ('rds_startup_tasks', 'rds_help_revlogin', 'rds_hexadecimal', 'rds_failover_tracking', 'rds_database_tracking', 'rds_track_change'))

And then also adds a priority 0 (top) result noting that checks were skipped because RDS was detected. Also added that for Express Edition and Azure SQL DB Managed Instances while I was in there.

@BrentOzar BrentOzar closed this Jan 18, 2019

BrentOzar added a commit that referenced this issue Jan 18, 2019

#1925 sp_Blitz AWS RDS detection (#1926)
Don't just rely on EC2 VM name to detect RDS. Also adds a new result noting that checks were skipped. Closes #1925.
@BrentOzar

This comment has been minimized.

Copy link
Member

BrentOzar commented Jan 18, 2019

screen shot 2019-01-18 at 7 56 11 am

@rknight29

This comment has been minimized.

Copy link
Author

rknight29 commented Jan 18, 2019

BrentOzar added a commit that referenced this issue Jan 28, 2019

2019-01 Release (#1932)
* Updating readme.md for sp_DatabaseRestore

Documenting @ExistingDBAction for https://dba.stackexchange.com/questions/226145/sp-databaserestore-msg-50000.

* 1900 sp_BlitzIndex add histograms

When @TableName is specified and sys.dm_db_stats_histogram is available. Closes #1900.

* #1903 sp_Blitz SQLServerCheckup

Adding filter for that app name. Closes #1903.

* #1905 sp_BlitzIndex remove BOU link

Nothing against BOU, just don't need it in that particular place. Closes #1905.

* #1908 Update copyright dates

Ah, the glamour. Closes #1908.

* Issue #1904 Change RAISERROR 'severity' for that should trigger throw and error.

* Issue #1910 Add SQL Server version check before choosing 'memory grant' as the @BlitzCacheSortOrder.

* Issue #1910 Add temp table creation.

* #1914 sp_BlitzIndex partition error severity

Dropping severity level from 16 to 0 since we're logging it in the result set anyway. Closes #1914.

* Issue 1894 Moved RESTORE HEADERONLY up

* LF line endings

* added some extra checks + corrected some nesting

* rebase and line endings

* Web site commit

Does this fix line endings?

* #1916 sp_Blitz ignore backup on TempDB drive

Closes #1916.

* Auto line endings

Dealing with sp_DatabaseRestore's line endings.

* 1919 sp_Blitz ignoring a few checks for Managed Instances (#1920)

* 1919 sp_Blitz ignoring a few checks for Managed Instances

Working on #1919.

* #1919 sp_Blitz excluding restored databases

When checking backup history. Working on #1919.

* #1919 sp_Blitz ignore some checks on Mgd Instances

Changing RCSI wording on Azure SQL DB. Working on #1919.

* #1921 Sp_BlitzIndex Add Drop and Create Columns to Output (#1923)

Joined output query to #IndexCreateTsql to retrieve the CreateTsql already generated earlier in the script.  Created Drop TSQL based off evaluating what type of index was present.

* #1921 sp_BlitzIndex adding drops (#1924)

Moving drop and create TSQL to the end of mode 2's results. Closes #1921.

* #1925 sp_Blitz AWS RDS detection (#1926)

Don't just rely on EC2 VM name to detect RDS. Also adds a new result noting that checks were skipped. Closes #1925.

* #1927 sp_BlitzIndex skip rdsadmin db (#1928)

GetAllDatabases = 1 fails when it hits rdsadmin because they're referring to the resource db. Closes #1927.

* 2019_01 Release (#1931)

Prep work for the release - changing version numbers, building build scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment