{"name":"Default TCP Port","description":"This metric checks whether your SQL Server installation is using the default TCP port.\r\nIt\u2019s widely known that SQL Server 2005 and 2008 listen on TCP port 1433. Keeping this default gives hackers a potential way of attacking your server. For information on how to change the TCP a server listens on, see MSDN http:\/\/msdn.microsoft.com\/en-GB\/library\/ms177440(v=sql.90).aspx. ","tsql":"DECLARE @KeyValue VarChar(500),\r\n        @Data Varchar(255),\r\n        @InstanceName VarChar(200)\r\n\r\nSET @InstanceName = CONVERT(VarChar(200), ISNULL(SERVERPROPERTY('InstanceName'), 'MSSQLSERVER'))\r\nSET @KeyValue = 'SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\\SQL'\r\nEXEC xp_regread 'HKEY_LOCAL_MACHINE',\r\n                @KeyValue,\r\n                @InstanceName,\r\n                @InstanceName OUTPUT\r\n\r\nSET @Data = NULL\r\nSET @KeyValue = 'SOFTWARE\\Microsoft\\Microsoft SQL Server\\' + @InstanceName + '\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll\\'\r\nEXEC xp_regread 'HKEY_LOCAL_MACHINE',\r\n                @KeyValue,\r\n                'TcpPort',\r\n                @Data OUTPUT\r\n\r\nIF (COALESCE(@Data,1433) = 1433)\r\n  SELECT 1 AS IsDefaultTCPPort\r\nELSE \r\n  SELECT 0 AS IsDefaultTCPPort\r\n","instances":true,"frequency":86400,"databases":{"mode":1},"rateofchange":false,"metricenabled":true,"alertname":"Default TCP Port Alert","alertdescription":"This alert is raised when you are using the default port of 1433, which is a known security risk. ","aboveorbelow":"above","collections":1,"alertenabled":true,"_thresholds_high":{"selected":true,"value":0},"_thresholds_medium":{"selected":false},"_thresholds_low":{"selected":false},"targetentitytype":0}