{"id":537,"date":"2009-04-05T17:18:51","date_gmt":"2009-04-05T15:18:51","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=537"},"modified":"2009-07-12T19:42:27","modified_gmt":"2009-07-12T17:42:27","slug":"custom-aem-report","status":"publish","type":"post","link":"https:\/\/contoso.se\/blog\/?p=537","title":{"rendered":"Custom AEM Report"},"content":{"rendered":"<p>Monitoring desktop client hardware, operating system and application faults can be of great value in terms of reducing total cost of ownership (TCO) through identification of widespread faults in the monitored environment. In Operations Manager 2007, there are actually three components for monitoring the client experience:<\/p>\n<ul>\n<li>Agentless Exception Monitoring (AEM)<\/li>\n<li>Customer Experience Improvement Program (CEIP)<\/li>\n<li>Management Packs for Windows-based workstation operating systems and applications<\/li>\n<\/ul>\n<p>I have received a number of questions both from customers and in the community about custom AEM reports, including more information. In this post I will give you some tips how to write custom AEM reports. I wrote <a href=\"http:\/\/contoso.se\/blog\/?p=398\">another post<\/a> about author reports in general for Ops Mgr 2007.<\/p>\n<p>I write my AEM reports in Microsoft Visual Studio 2008. When you start Visual Studio you can choose to start a new Report Server Project. When you blank project has opened you should start with creating a shared data source, specify your Operations Manager data warehouse database. Then add a new item, a report, under the Reports folder in the Solution Explorer window.<\/p>\n<p>The example report below is a &#8220;per user&#8221; report, which will show you all AEM events for a specified username. I have included some numbers, with total number of users, total number of events, average number of events per user and total number of events for the specified user. I have also included info about the last event for the specified user and a table with all events for the specified user.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone\" src=\"http:\/\/contoso.se\/files\/AEMReport02.jpg\" alt=\"\" width=\"587\" height=\"494\" \/><\/p>\n<p>In my example report I use four dataset.<\/p>\n<ol>\n<li>One to get all Aem users that have a event in the database<\/li>\n<li>One to get info for the first table, for example total number of events<\/li>\n<li>One to get last crash for the specified user<\/li>\n<li>One to get all the events for the specified user<\/li>\n<\/ol>\n<p>List usernames<\/p>\n<blockquote><p>SELECT DISTINCT AemUserName FROM [CM].[vCMAemRaw] Rw<br \/>\nINNER JOIN dbo.AemComputer Computer ON Computer.AemComputerRowID = Rw.AemComputerRowID<br \/>\nINNER JOIN dbo.AemUser Usr ON Usr.AemUserRowId = Rw.AemUserRowId<br \/>\nINNER JOIN dbo.AemErrorGroup EGrp ON Egrp.ErrorGroupRowId = Rw.ErrorGroupRowId<br \/>\nINNER JOIN dbo.AemApplication App ON App.ApplicationRowId = Egrp.ApplicationRowId<\/p><\/blockquote>\n<p>All info for the first table in the example<\/p>\n<blockquote><p>SELECT (SELECT COUNT(CrashID) FROM CM.vCMAemRaw) AS TotalEvents, (SELECT COUNT(DISTINCT AemUserRowID) FROM CM.vCMAemRaw) AS TotalUsers, (SELECT (SELECT COUNT(CrashID) FROM CM.vCMAemRaw ) \/ (SELECT COUNT(DISTINCT AemUserRowID) FROM CM.vCMAemRaw)) AS TotalAverage, (SELECT COUNT(CrashID) FROM [CM].[vCMAemRaw] Rw<br \/>\nINNER JOIN dbo.AemComputer Computer ON Computer.AemComputerRowID = Rw.AemComputerRowID<br \/>\nINNER JOIN dbo.AemUser Usr ON Usr.AemUserRowId = Rw.AemUserRowId<br \/>\nWHERE <a href=\"mailto:AemUserName=@UserName\">AemUserName=@UserName<\/a>) AS UserTotal<\/p><\/blockquote>\n<p>Note that I use a parameter, @UserName. Last problem for the specified user<\/p>\n<blockquote><p>SELECT top 1 CrashTime FROM [CM].[vCMAemRaw] Rw<br \/>\nINNER JOIN dbo.AemComputer Computer ON Computer.AemComputerRowID = Rw.AemComputerRowID<br \/>\nINNER JOIN dbo.AemUser Usr ON Usr.AemUserRowId = Rw.AemUserRowId<br \/>\nINNER JOIN dbo.AemErrorGroup EGrp ON Egrp.ErrorGroupRowId = Rw.ErrorGroupRowId<br \/>\nINNER JOIN dbo.AemApplication App ON App.ApplicationRowId = Egrp.ApplicationRowId<br \/>\nWHERE AemUserName = @UserName ORDER BY CrashTime desc<\/p><\/blockquote>\n<p>Info for the &#8220;all events for user&#8221; table<\/p>\n<blockquote><p>SELECT CrashTime, AemComputerName,BucketType,Parameter1,Parameter2,CompanyName, AemUserName FROM [CM].[vCMAemRaw] Rw<br \/>\nINNER JOIN dbo.AemComputer Computer ON Computer.AemComputerRowID = Rw.AemComputerRowID<br \/>\nINNER JOIN dbo.AemUser Usr ON Usr.AemUserRowId = Rw.AemUserRowId<br \/>\nINNER JOIN dbo.AemErrorGroup EGrp ON Egrp.ErrorGroupRowId = Rw.ErrorGroupRowId<br \/>\nINNER JOIN dbo.AemApplication App ON App.ApplicationRowId = Egrp.ApplicationRowId<br \/>\nWHERE AemUserName = @UserName<\/p><\/blockquote>\n<p>When you have added the fields from all datasets to your report, you can simple deploy it to your reporting server. The base SQL query I used is<\/p>\n<blockquote><p>select * from [CM].[vCMAemRaw] Rw<br \/>\ninner join dbo.AemComputer Computer on Computer.AemComputerRowID = Rw.AemComputerRowID<br \/>\ninner join dbo.AemUser Usr on Usr.AemUserRowId = Rw.AemUserRowId<br \/>\ninner join dbo.AemErrorGroup EGrp on Egrp.ErrorGroupRowId = Rw.ErrorGroupRowId<br \/>\nInner join dbo.AemApplication App on App.ApplicationRowId = Egrp.ApplicationRowId<\/p><\/blockquote>\n<p>Thanks to Kevin Holman for that one. I think that with the base SQL query for AEM you can build all kind of AEM reports that your organization needs. And when doing that, check out all new cool gauges in Visual Studio 2008.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone\" src=\"http:\/\/contoso.se\/files\/AEMReport03.jpg\" alt=\"\" width=\"391\" height=\"276\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Monitoring desktop client hardware, operating system and application faults can be of great value in terms of reducing total cost of ownership (TCO) through identification of widespread faults in the monitored environment. In Operations Manager 2007, there are actually three components for monitoring the client experience: Agentless Exception Monitoring (AEM) Customer Experience Improvement Program (CEIP) &hellip; <a href=\"https:\/\/contoso.se\/blog\/?p=537\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/537"}],"collection":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=537"}],"version-history":[{"count":24,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/537\/revisions"}],"predecessor-version":[{"id":823,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/537\/revisions\/823"}],"wp:attachment":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}