How can we help you today? How can we help you today?
benrees
Hi there This is definitely something we're looking in to for the future, though not in the next release, I'm afraid. Thank you for your input. Regards Ben / comments
Hi there This is definitely something we're looking in to for the future, though not in the next release, I'm afraid. Thank you for your input. Regards Ben
0 votes
Hi lehrsj24 Below is some code I've put together linking the Alerts VIEW [alert].[Alert_Current] and the Job History VIEW [data].[Cluster_SqlServer_Agent_Job_History_Instances_View]. I've put the most relevant info in the first few columns (alert ID, error message, date/time of alert), but have also included other columns in case you're interested in these. NB: I've put this together quite hastily - let me know if you have any problems with this code and I'll try to fix it! Hope this helps. Ben Rees SELECT AlertID , Cluster_SqlServer_Agent_Job_History_Message , DateTimeRaised , Id AS Job_History_Id , IdCollectionDate , Cluster_SqlServer_Agent_Job_History_RunDuration , Cluster_SqlServer_Agent_Job_History_RunStatus , Cluster_SqlServer_Agent_Job_History_SqlMessageId , Cluster_SqlServer_Agent_Job_History_SqlSeverity , CollectionDate , CollectionDate_DateTime , Cluster_Name , Cluster_SqlServer_Name , Cluster_SqlServer_Agent_Job_Id , Cluster_SqlServer_Agent_Job_History_Id , Cluster_SqlServer_Agent_Job_History_RunDate , Cluster_SqlServer_Agent_Job_History_RunDate_DateTime , AlertType , AlertDescription , AlertTicks FROM ( SELECT [Id] , [IdCollectionDate] , [Cluster_SqlServer_Agent_Job_History_Message] , [Cluster_SqlServer_Agent_Job_History_RunDuration] , [Cluster_SqlServer_Agent_Job_History_RunStatus] , [Cluster_SqlServer_Agent_Job_History_SqlMessageId] , [Cluster_SqlServer_Agent_Job_History_SqlSeverity] , [CollectionDate] , [CollectionDate_DateTime] , [Cluster_Name] , [Cluster_SqlServer_Name] , [Cluster_SqlServer_Agent_Job_Id] , [Cluster_SqlServer_Agent_Job_History_Id] , [Cluster_SqlServer_Agent_Job_History_RunDate] , [Cluster_SqlServer_Agent_Job_History_RunDate_DateTime] FROM [data].[Cluster_SqlServer_Agent_Job_History_Instances_View] ) AS jh INNER JOIN ( SELECT SUBSTRING(TargetObject, 21 + PATINDEX('%:%', SUBSTRING(TargetObject, 21, 4)), CAST(SUBSTRING(TargetObject, 21, PATINDEX('%:%', SUBSTRING(TargetObject, 21, 4)) - 1) AS INT)) AS ClusterName , CASE WHEN PATINDEX('%7:Machine,1,4:Name%', TargetObject) > 0 THEN SUBSTRING(TargetObject, PATINDEX('%7:Machine,1,4:Name%', TargetObject) + 20 + PATINDEX('%:%', SUBSTRING(TargetObject, PATINDEX('%7:Machine,1,4:Name%', TargetObject) + 20, 4)), CAST(SUBSTRING(TargetObject, PATINDEX('%7:Machine,1,4:Name%', TargetObject) + 20, PATINDEX('%:%', SUBSTRING(TargetObject, PATINDEX('%7:Machine,1,4:Name%', TargetObject) + 20, 4)) - 1) AS INT)) ELSE '' END AS MachineName , CASE WHEN PATINDEX('%9:SqlServer,1,4:Name%', TargetObject) > 0 THEN SUBSTRING(TargetObject, PATINDEX('%9:SqlServer,1,4:Name%', TargetObject) + 22 + PATINDEX('%:%', SUBSTRING(TargetObject, PATINDEX('%9:SqlServer,1,4:Name%', TargetObject) + 22, 4)), CAST(SUBSTRING(TargetObject, PATINDEX('%9:SqlServer,1,4:Name%', TargetObject) + 22, PATINDEX('%:%', SUBSTRING(TargetObject, PATINDEX('%9:SqlServer,1,4:Name%', TargetObject) + 22, 4)) - 1) AS INT)) ELSE '' END AS SQLServerName , at.Name AS AlertType , at.Description AS AlertDescription , [utils].[TicksToDateTime](ai.Raised) AS DateTimeRaised , ai.Raised AS AlertTicks , ai.AlertId AS AlertID FROM alert.Alert_Current AS ai INNER JOIN alert.Alert_Type AS at ON ai.AlertType = at.AlertType ) AS ad ON ad.ClusterName = jh.Cluster_Name AND ad.SQLServerName = jh.Cluster_SqlServer_Name WHERE ad.AlertType = 'Job failed' AND AlertTicks = Cluster_SqlServer_Agent_Job_History_RunDate ORDER BY ad.DateTimeRaised DESC / comments
Hi lehrsj24 Below is some code I've put together linking the Alerts VIEW [alert].[Alert_Current] and the Job History VIEW [data].[Cluster_SqlServer_Agent_Job_History_Instances_View]. I've put the m...
0 votes
Hi there We have put in a number of VIEWs which should, hopefully, help you create reports or queries for the sort of data you’re looking for. The most interesting VIEWs can be found under [data].xxxxx_View. A lot of these should be self-explanatory. For example, looking at the information that you mention: Monitored Servers with OS info etc This can be found in the view [data].[Cluster_SqlServer_Properties_StableSamples_View] Mem Disk Space Memory values can be found in [data].[Cluster_Machine_Memory_UnstableSamples_View] Disk space can be found in [data].[Cluster_Machine_LogicalDisk_UnstableSamples_View] Databases Lists of databases can be found in [data].[Cluster_SqlServer_Database_StableSamples_View] though this needs to be grouped (there is more than one row per database as this table also includes some availability information.) Database Size This can be found in [data].[Cluster_SqlServer_Database_Storage_UnstableSamples_View] NB: There’s also a couple of functions to convert between Ticks (as used in many views and tables) and proper date times, [utils].[DateTimeToTicks] and [utils].[TicksToDateTime] Hope that helps! Ben / comments
Hi there We have put in a number of VIEWs which should, hopefully, help you create reports or queries for the sort of data you’re looking for. The most interesting VIEWs can be found under [data]...
0 votes
Hi there I'm taking a look at this request, though I'm afraid it's not as trivial as some other possible reports! I'll post back as soon as I've put some T-SQL together.. Apologies for the delay. Regards Ben / comments
Hi there I'm taking a look at this request, though I'm afraid it's not as trivial as some other possible reports! I'll post back as soon as I've put some T-SQL together.. Apologies for the delay. R...
0 votes