Monitoring SQL Server Agent Jobs with SCOM



Similar documents
Idera SQL Diagnostic Manager Management Pack Guide for System Center Operations Manager. Install Guide. Idera Inc., Published: April 2013

AppMetrics for Transactions SCOM Management Pack Users Guide

SonicWALL CDP 5.0 Microsoft Exchange InfoStore Backup and Restore

StarWind iscsi SAN & NAS: Configuring HA Shared Storage for Scale- Out File Servers in Windows Server 2012 January 2013

StarWind iscsi SAN & NAS: Configuring HA File Server on Windows Server 2012 for SMB NAS January 2013

Integrating Eaton PRO Management Pack for Microsoft System Center Virtual Machine Manager 2008 v1.0 Page 2

Using AppMetrics to Handle Hung Components and Applications

Install MS SQL Server 2012 Express Edition

StarWind iscsi SAN: Configuring HA File Server for SMB NAS February 2012

Team Foundation Server 2012 Installation Guide

How to Configure Microsoft System Operation Manager to Monitor Active Directory, Group Policy and Exchange Changes Using NetWrix Active Directory

User Manual. Version connmove GmbH Version: Seite 1 von 33

StarWind iscsi SAN & NAS: Configuring HA Storage for Hyper-V October 2012

NetIQ. How to guides: AppManager v7.04 Initial Setup for a trial. Haf Saba Attachmate NetIQ. Prepared by. Haf Saba. Senior Technical Consultant

Installing Windows Server Update Services (WSUS) on Windows Server 2012 R2 Essentials

Chapter 3 Application Monitors

StarWind iscsi SAN Configuring HA File Server for SMB NAS

Monitoring SQL Server with Microsoft Operations Manager 2005

Sage HRMS 2014 Sage Employee Self Service Tech Installation Guide for Windows 2003, 2008, and October 2013

Deploying System Center 2012 R2 Configuration Manager

QUANTIFY INSTALLATION GUIDE

Configuring Network Load Balancing with Cerberus FTP Server

StarWind iscsi SAN Software: Using StarWind with MS Cluster on Windows Server 2008

ECA IIS Instructions. January 2005

How to Install SQL Server 2008

Using Jive for Outlook

Step-by-step installation guide for monitoring untrusted servers using Operations Manager ( Part 3 of 3)

General Tips: Page 1 of 20. By Khaled Elshaer.

educ Office Remove & create new Outlook profile

Team Foundation Server 2010, Visual Studio Ultimate 2010, Team Build 2010, & Lab Management Beta 2 Installation Guide

Using HP Systems Insight Manager to achieve high availability for Microsoft Team Foundation Server

Junk Settings. Options

Automating Administration with SQL Agent

WhatsUp Gold v16.3 Installation and Configuration Guide

Configuring Thunderbird for Flinders Mail at home.

StarWind Virtual SAN Installation and Configuration of Hyper-Converged 2 Nodes with Hyper-V Cluster

Nexio Connectus Cluster Set Up with SQL Server Backend

StarWind iscsi SAN Software: Using an existing SAN for configuring High Availability storage with Windows Server 2003 and 2008

Avaya Modular Messaging Microsoft Outlook Client Release 5.2

Moving the Web Security Log Database

0651 Installing PointCentral 8.0 For the First Time

Outlook Profile Setup Guide Exchange 2010 Quick Start and Detailed Instructions

Microsoft Dynamics GP SQL Server Reporting Services Guide

StarWind Virtual SAN Installing & Configuring a SQL Server 2012 Failover Cluster

SonicWALL CDP 5.0 Microsoft Exchange User Mailbox Backup and Restore

Altaro Hyper-V Backup - Getting Started

Hyper-V Replica Essentials

Introduction. There are several bits of information that must be moved:

Visual Studio.NET Database Projects

How to install and use the File Sharing Outlook Plugin

GETTING STARTED WITH SQL SERVER

Using SQL Server 2008 Automated Backup

Updating KP Learner Manager Enterprise X On Your Server

Installation Guide. . All right reserved. For more information about Specops Inventory and other Specops products, visit

MATLAB Distributed Computing Server with HPC Cluster in Microsoft Azure

Managing Software Updates with System Center 2012 R2 Configuration Manager

ArcMail Technology Defender Mail Server Configuration Guide for Microsoft Exchange Server 2003 / 2000

System Center 2012 R2 Lab 5: Application Management

Administration GUIDE. Exchange Database idataagent. Published On: 11/19/2013 V10 Service Pack 4A Page 1 of 233

Flexible Identity. LDAP Synchronization Agent guide. Bronze. version 1.2

Dell Enterprise Reporter 2.5. Configuration Manager User Guide

Distribution List Manager User s Manual

Creating a New Database and a Table Owner in SQL Server 2005 for exchange@pam

Symantec Mail Security for Microsoft Exchange Management Pack Integration Guide

Getting Started with the Ed-Fi ODS and Ed-Fi ODS API

Adding Outlook to a Blackberry, Downloading, Installing and Configuring Blackberry Desktop Manager

ProactiveWatch 2.0 Patch Management and Reporting

Smart Cloud Integration Pack. For System Center Operation Manager. v User's Guide

Installation Guide. Live Maps 7.4 for System Center 2012

Intellicus Enterprise Reporting and BI Platform

Group Policy for Beginners

Windows Firewall Configuration with Group Policy for SyAM System Client Installation

Tool Tip. SyAM Management Utilities and Non-Admin Domain Users

HELP DOCUMENTATION E-SSOM BACKUP AND RESTORE GUIDE

Scribe Demonstration Script Web Leads to Dynamics CRM. October 4,

EntroWatch - Software Installation Troubleshooting Guide

Supermicro Server Monitoring with SuperDoctor 5 and SCOM 2012

Insights for Microsoft Dynamics CRM Online User s Guide December 2014

Creating trouble-free numbering in Microsoft Word

Deep Freeze and Microsoft System Center Configuration Manager 2012 Integration

Installing Windows Rights Management Services with Service Pack 2 Step-by- Step Guide

10 Integration with System Center Operations Manager 2012 SP1

Intelligent Power Protector User manual extension for Microsoft Virtual architectures: Hyper-V 6.0 Manager Hyper-V Server (R1&R2)

Panorama NovaView. Load Balancing Installation Guide

TSM Studio Server User Guide

Synchronization Agent Configuration Guide

Microsoft Exchange Mailbox Software Setup Guide

Print Audit 6 Network Installation Guide

Installing Autodesk Vault Server 2012 on Small Business Server 2008

Administration GUIDE. SharePoint Server idataagent. Published On: 11/19/2013 V10 Service Pack 4A Page 1 of 201

Team Foundation Server 2013 Installation Guide

How to set up SQL Source Control. The short guide for evaluators

Dell UPS Local Node Manager USER'S GUIDE EXTENSION FOR MICROSOFT VIRTUAL ARCHITECTURES Dellups.com

EventTracker: Support to Non English Systems

Installing and Configuring a. SQL Server 2012 Failover Cluster

Enabling Kerberos SSO in IBM Cognos Express on Windows Server 2008

Deploying Windows Streaming Media Servers NLB Cluster and metasan

CentreWare Management Pack for System Center Operations Manager User Guide Version 1.8

Project management integrated into Outlook

Transcription:

Monitoring SQL Server Agent Jobs with SCOM Keeping Tabs on Maintenance Jobs

Introduction In an environment where you work, there is a high degree of probably that you use Microsoft SQL Server of some version of edition to provide a database to an application. In the same environment, there s a good chance, if you are a Microsoft shop that you are using System Center Operations Manager (SCOM) to monitor your environments. All good database administrators (DBAs) create jobs, plans and tasks to keep their SQL servers in tip top shape but a lot of the time, insight as to the status of these jobs is left either unturned like an age old stone or is done by configuring SQL Database Mail on your SQL servers so that email alerts are generated which means you have additional configuration being done on every server to configure this and it s yet another thing to manage. In this guide, I am going to walk you through configuring a System Center Operations Manager 2012 R2 environment to extend the monitoring of your SQL Servers to include the health state of your SQL Server Agent Jobs, allowing you to keep an eye on not just the SQL Server platform but also on the jobs that run to make the platform healthy. This guide as are all my publications, dedicated to my wife Nicky and my three daughters; Madison, Jessica and Layla who are subjected to living with me and technology and not always in that order. Authors Richard J Green works as a Consultant for Fordway Solutions Limited, dealing in all things Microsoft whilst specializing in delivering System Center solutions helping customers leverage their investment in IT through Microsoft management technologies. Richard works extensively with Windows Azure. He has an unhealthy obsession with the colour pink hence the colour choice of this book. You can follow Richard on Twitter @richardjgreen or read his blog at focusing on Microsoft products and technologies along with other digital ramblings at http://richardjgreen.net. Copyright This book is copyright of Richard J Green and co-authors. No unauthorised copying of material in this book shall be performed without the prior written consent of Richard Green or one of the coauthors. 2014

Contents Introduction... 2 Authors... 2 Copyright... 2 Prerequisites for Configuration... 4 SQL Server and SQL Server Agent... 4 SQL Server Agent Jobs... 4 System Center Operations Manager... 4 Configuring SQL Agent Job Monitoring... 5 Create a SQL Server Agent Targeting Group... 5 Enable the Agent Job Object Discovery... 6 Create a SQL Server Agent Job Targeting Group... 8 Enable Alerting for Failed SQL Server Agent Jobs... 10 Extra Credit Tasks... 11 Closing Credits... 11

Monitoring SQL Server Agent Jobs with SCOM Prerequisites for Configuration In order to be able to complete the steps in this guide, you need to have some things in place in your environment, nothing that you shouldn t already have though mind you. SQL Server and SQL Server Agent It goes without saying that to monitor SQL Server Agent Jobs, the scope of this guide, you will need to have a SQL Server that has a running SQL Server Agent. This can be either a standalone SQL Server, a SQL Server Failover Cluster or a SQL Server AlwaysOn Availability Group. The SQL Server Agent should be configured with a service type of Automatic for Standalone and AlwaysOn Availability Group servers or to Manual and controlled by the Cluster Service for Failover Cluster instances of SQL Server. In this guide, I am working with SQL Server 2012 but there is no rule for this. You can deploy this configuration with any version or edition of SQL Server and adjust the steps in the guide accordingly. SQL Server Agent Jobs As the scope of this guide is configuring SQL Server Agent Jobs, it is fairly obvious that we need to have some jobs to monitor. The scope of this guide is not to tell you how to create SQL Server Agent Jobs or what jobs you should have but I have a blog post exploring the Ola Hallengren SQL Maintenance Solution at http://richardjgreen.net/sql-server-maintenance-solution/ if you want more information. System Center Operations Manager In this guide, I am working with System Center Operations Manager 2012 R2 which is the latest release, ignoring the System Center vnext Technical Preview recently made available. There is no limitation for this to only work with SCOM 2012 R2 and it would be entirely possible to do this with older versions of SCOM. The only limiting factor with SCOM is Management Packs. In order to be able to follow this guide, you need to have the SQL Server Management Packs for the appropriate versions of SQL Server installed. The System Center Management Pack for SQL Server supporting SQL Server 2005, 2008, 2008 R2 and 2012 can be downloaded from http://www.microsoft.com/en-gb/download/details.aspx?id=10631. The System Center Management Pack for SQL Server 2014 can be downloaded from http://www.microsoft.com/en-us/download/details.aspx?id=42573. 4

Configuring SQL Agent Job Monitoring Configuring SQL Agent Job Monitoring With all of our prerequisite talk out of the way, we can now get to the real topic, how to configure this monitoring. By default, the SQL Server Management Pack for SCOM monitors SQL Server health but with respect to the SQL Server Agent, it only monitors the health of the Agent service and not what runs inside that agent. Create a SQL Server Agent Targeting Group To get started, you need to make a choice: do you want to monitor the SQL Server Agent for a selection of your servers or for all of them? I made the choice that I want to only target a sub-set of servers for this monitoring so the first step is to create a group for these servers. In SCOM, we create a group from the Groups node of the Authoring pane in the Operations Console. As you will see from the screenshot of the group creation, the object that needs to be added is the SQLAgent$SERVER object, where SERVER is the SQL Server server name. If you wanted to include all SQL Servers in your environment, you could create the appropriate Dynamic Members statement or you could ignore this step and apply the following step to All Objects of a Class instead of to the Group. 5

Monitoring SQL Server Agent Jobs with SCOM Enable the Agent Job Object Discovery With our group created, we now need to turn our attention to actually discovering the Agent Jobs and that is as the name suggests, done by an Object Discovery. In the Operations Console, on the Authoring pane, open the Object Discoveries node and change the scope of the Management Packs to be limited to SQL Server 2012 Agent Job. You will need to change the radio button at the bottom of the scope dialog to View All Targets whilst doing this as the Agent is not defined as a common Management Pack. You should then see the Object Discovery Discover SQL Server 2012 Agent Jobs job which is disabled by default hence why we don t get the statuses for our SQL Server Agent Jobs out of the box. Right-click this Object Discovery and select Overrides > Override the Object Discovery > For a Group and from the group picker, select the group we created previously in the SQL Server and SQL Server Agent step. 6

Configuring SQL Agent Job Monitoring In the Override Properties as you can see from the screenshot above, we want to override the status of this Object Discovery from Disabled to Enabled. Select the Override checkbox for the Parameter Name Enabled and set the Override Value to True. Once you have done this, select OK to apply the change. The next part depends on your level of patience. If you are happy to wait, then leave everything along and come back the following day as that is how long it will take the Microsoft Monitoring Agent on the SQL Server hosts to pick up the change to the Object Discovery and run it because of the Interval on the discovery. If like me, you don t want to wait for that, simply restart the Microsoft Monitoring Agent service on your SQL Servers and the changes will be pulled in immediately and the Object Discovery forced to run at the agent restart. We can check that our SQL Server Agent Jobs have been discovered by SCOM using the Monitoring view. Click the Monitoring pane in the Operations Console and drill down to Microsoft SQL Server > SQL Server Database Engines > SQL Server 2005/2008/2012 > SQL Agent and open the SQL Agent Job State state view. As you can see from this screenshot, the two servers that I included in the group have performed the discovery of the SQL Server Agent Jobs and their status has been reported into SCOM as Healthy. In the screenshot, there are three jobs per server, dbcc_checkdb_weekly and defragment_indexes_weekly which are user created SQL Server Agent Jobs and syspolicy_purge_history which is a system job. Because syspolicy_purge_history is a system job that s only purpose is to clear down the history of SQL Server Agent Jobs history I am not actually interested in monitoring this. Furthermore, we probably don t want to monitor SQL Server Agent Jobs which individual administrators have chosen to create to aid their work; we only want to monitor the company mandated jobs used for maintaining our servers. 7

Monitoring SQL Server Agent Jobs with SCOM Create a SQL Server Agent Job Targeting Group So far, we are collecting the status of the Jobs from the SQL Server Agents into SCOM. The status for these jobs is based on the Last Run Status monitor however right now, we are only seeing the status and there will not be any alerting. To get the alerting that we desire, we need to prepare another group to allow us to scope the user created jobs and to then allow those jobs to generate alerts. As shown in the screenshot above, I have started the process of creating a group however this time, the group is based on Dynamic Membership. By using Dynamic Membership, we can define here in the group the Job Names that we want to monitor and based on the membership of our first group, these will automatically be targeted and will be automatically applied to all our SQL Servers. In this Dynamic Group, I have chosen to include Or expression groups for each of the SQL Server Agent Job versions so that should somebody later add a SQL Server to our Agent Job monitoring group that is running a different version of SQL Server that it will still work. This is covered briefly in the Extra Credit Tasks task at the end of this guide but not a requirement. Once we have created our new group, we can use the View Group Members menu option in the Groups node of the Authoring pane in the Operations Console to check that we have correctly targeted our Classes and that everything has been detected properly. 8

Configuring SQL Agent Job Monitoring As you can see from the image above, the user created SQL Server Agent Jobs that we designated to be part of this Dynamic Group have been correctly detected confirming both that our Class Targeting has been set correctly and that our expression to match the Job Name is working also. 9

Monitoring SQL Server Agent Jobs with SCOM Enable Alerting for Failed SQL Server Agent Jobs So far, we ve achieved a lot by targeting our SQL Servers and getting monitoring insight into the status of our SQL Server Agent Jobs but to get the full story, we now want to generate alerts for any failures and because we are kind SCOM Administrators, we want our alerts to automatically resolve which means we are using a Monitor for the SCOM educated amongst you. On the Authoring pane of the Operations Console, select the Monitor node. In the Monitor node, scope the Management Packs to SQL Server 2012 Agent Jobs which may already be the case from our previous scoping efforts. Right-click the Last Run Status Monitor and select Overrides > Override the Monitor > For a Group and select the group that we created in the last step Create a SQL Server Agent Job Targeting Group. At the Override Properties dialog as shown above in the screenshot, override the Auto-Resolve Alert and Generate Alert Parameter Names and change both of their Override Values to True. Once you ve made these changes, select OK to apply the override. You now have a solution in place to bring visibly to the status of your SQL Server Agent Jobs into SCOM and you have alert generation for failures. 10

Extra Credit Tasks Extra Credit Tasks Now that you are finished, here are some extra credit tasks you can consider to make this even better: Repeat the steps in this guide for other versions of SQL Server such as SQL Server 2014 to future-proof your efforts if someone in your environment decides to be cutting-edge and deploys a SQL Server 2014 instance. Configure a Notification Channel and Subscriber for the SQL Server Agent Jobs alerts and have the alerts sent to your monitoring team or your SQL DBA team, whichever is relevant in your environment. Use Dynamic Membership on the first group we created in the Create a SQL Server Agent Targeting Group step so automatically include all of your SQL Servers but just make that you are happy that the health state of all of your SQL Servers is in a good place before you do otherwise the people receiving your alerts might be a bit unhappy with you. Closing Credits I hope you ve enjoyed this guide and found it helpful and please feel free to reach out to me via my blog at http://richardjgreen.net or via Twitter at @richardjgreen if you want more information about this guide or have any suggestions for how it could be made even better. 11