{"id":236,"date":"2007-11-20T21:35:44","date_gmt":"2007-11-20T19:35:44","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=236"},"modified":"2007-11-20T21:36:40","modified_gmt":"2007-11-20T19:36:40","slug":"monitor-and-report-sql-logon","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=236","title":{"rendered":"Monitor and Report SQL Logons"},"content":{"rendered":"<p>In this post I will show how to setup SQL logon auditing. You will have to complete a number of steps before you have a complete auditing. Beware that logging all logon events can fill up your database. This post includes the following steps:<\/p>\n<ol>\n<li>Configure SQL to audit logon events<\/li>\n<li>Configure Ops Mgr to collect logon events<\/li>\n<li>Create a report to show the collected data<\/li>\n<\/ol>\n<p><strong>Configure SQL to audit logon events<\/strong><\/p>\n<p>Login auditing can be configured to write to the error log on the following events.<\/p>\n<ul>\n<li>Failed logins<\/li>\n<li>Successful logins<\/li>\n<li>Both failed and successful logins<\/li>\n<\/ul>\n<p>To configure login auditing<\/p>\n<ol>\n<li>In SQL Server Management Studio, connect to an instance of the SQL Server Database Engine with Object Explorer.<\/li>\n<li>In Object Explorer, right-click the server name, and then click Properties.<\/li>\n<li>On the Security page, under Login auditing, click the desired option.<\/li>\n<li>After you have applied this setting you might need to restart the SQL service before it take effect. After that you should see logon events in the local application log, in event viewer.<\/li>\n<\/ol>\n<p><strong>Configure Ops Mgr to collect logon events<\/strong><\/p>\n<p>You will need some suitable class to target your rule to. If you import the SQL MP you will get a number of\u00c2\u00a0SQL classes.<\/p>\n<ol>\n<li>In the Ops Mgr Console click Authoring<\/li>\n<li>Right-click Rules and choose to create a new rule<\/li>\n<li>Create Rule Wizard &#8211; Rule Type: Choose to create a Collection Rules\/Event Based\/NT Event log. Choose a suitable management pack and click next<\/li>\n<li>Create Rule Wizard &#8211; General: Input a rule name for example &#8220;SQL Auditing &#8211; Success Logon&#8221;. Choose a target, for example &#8220;SQL 2005 DB Engine&#8221;. Click Next<\/li>\n<li>Create Rule Wizard &#8211; Event Log Type: Log Name should be Application then click Next<\/li>\n<li>Create Rule Wizard &#8211; Build Event Expression: input<br \/>\nEvent ID equals 18453<br \/>\nEvent Source equals MSSQLSERVER<br \/>\nClick Create<\/li>\n<\/ol>\n<p>To collect also failed logon you need to create a rule to collect event ID 18456.<\/p>\n<p>You can use the Effective Configuration Viewer from the Ops Mgr 2007 resource kit to verify if\u00c2\u00a0your new rule affect a SQL machine. You can also create a new event view, to show these events,\u00c2\u00a0after a couple of minutes you should see them.<\/p>\n<p><strong>Create a report to show the collected data<\/strong><\/p>\n<p>There is no report model in Ops Mgr by default, so if you want to create a brand new report, you\u00c2\u00a0must start with create\u00c2\u00a0a report model. You can do that with SQL Server Business Intelligence Development Studio. Take a look at Jonathan Hamb step by step guide how to create a report model <a href=\"http:\/\/opsmgr.wordpress.com\/2007\/07\/19\/want-to-design-a-new-report-in-scom-2007\/\">here<\/a>.<\/p>\n<p>What you can do, with default reports, is a linked report. A linked report is like a shortcut to a program, it is a link that provide settings that inputs in a existing report. A linked report always inherits report layout and data source properties of the original report. All other properties and settings can be different from those of the original report, including security, parameters, location, subscriptions, and schedules.<\/p>\n<p>To create a new report, for example a report showing all success logon events,<\/p>\n<ol>\n<li>Start the Ops Mgr console and click Reporting<\/li>\n<li>Click Microsoft Generic Report Library<\/li>\n<li>Click Event Analysis and then Open<\/li>\n<li>In the report select suitable FROM and TO for example<\/li>\n<li>Click Add Group and select SQL 2005 DB Engine Group<\/li>\n<li>Select MSSQLSERVER as SOURCE,\u00c2\u00a04 as Type, 18453 as Event ID and Success Audit as Event Type<\/li>\n<li>Click Run<\/li>\n<\/ol>\n<p>Now you can see a report with all Sucess Audit. You can now click the File menu and choose Publish. This report will now be stored as a linked report under Authored Reports. The next time you want to see success logons to SQL you can click this report direct in the console, and all the parameters will be there.<\/p>\n<p>If you select MSSQLSERVER as source and 4 as event type, you will get both Failure and Success audit events, but\u00c2\u00a0you must first make sure you have rules to collect them both.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I will show how to setup SQL logon auditing. You will have to complete a number of steps before you have a complete auditing. Beware that logging all logon events can fill up your database. This post includes the following steps: Configure SQL to audit logon events Configure Ops Mgr to collect &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=236\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-operations-manager-2007"],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=236"}],"version-history":[{"count":0,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}