Howdy!
I have this query to tell me when the sys admins change volume resources. What I can't figure out is how to get the date of change, if its even possible.
SELECT N.Caption AS [Node] ,V.Caption AS [Volume] ,Round(MIN(DiskSize)/1024/1024/1024,0) AS [Before_GB] ,Round(MAX(DiskSize)/1024/1024/1024,0) AS [After_GB] ,N.DetailsUrl AS [_LinkFor_Node] ,V.DetailsUrl AS [_LinkFor_Volume] FROM Orion.VolumeUsageHistory AS VS INNER JOIN Orion.Volumes AS V on VS.VolumeID=V.VolumeID INNER JOIN Orion.Nodes AS N ON V.NodeID=N.NodeID WHERE VS.DateTime>GETUTCDATE()-7 --Check last x days AND V.VolumeTypeID IN (2,4,100) -- Physical RAM, Fixed disk, mount point GROUP BY N.Caption,V.Caption, N.DetailsUrl, V.DetailsUrl HAVING MAX(VS.DiskSize)<>MIN(VS.DiskSize) ORDER BY N.Caption
This is an example of what I am trying to get. The code above pulls the difference in DiskSize (shown in yellow in the pic), but I also want to pull the date (in blue) when the DiskSize changed. This is pic is only showing/using the VolumeUsageHistory table. I hope that helps clarify.
Any ideas?
Cheers!