понедельник, 14 октября 2013 г.

SQL Server Management Pack 6.4.1.0 is released!

SQL Server Management Pack 6.4.1.0 is released after the month after release of SQL MP 6.4.0.0

Changes in October 2013 Update:
Fixed CPU Utilization Monitor
Fixed SQL Server seed discovery for WoW64 environments
Alert severity of Average Wait Time Monitor was changed to Warning, added consecutive sampling to reduce noise, threshold was changed to 250
Alert severity of SQL Re-Compilation monitor was changed to Warning, threshold was changed to 25. The monitor was disabled by default.
Minor fixes


вторник, 17 сентября 2013 г.

Manage Allow Agent to Act as a proxy option management pack

I want to share management pack which allows to manage "Allow Agent act as a proxy"  setting in simple and smarter way!

SCOM 2012 Tweaker

Usually SCOM administrators use some scheduler and script, which sets option for all agents. I do not recomend set this option for all agents because of security risk. Instead of this unsecure approach I suggest to use Groups and set option based on Agent's membership in a group.

There are two groups in this management pack:

  • Allow Agent to Act as a Proxy
  • Deny Agent to Act as a Proxy
All you need to do is to import the MP, and add agents into the corresponding group:
You could also use dynamic membership.
 "Manage Allow Agent to act as a proxy setting" rule checks Agent Group membership and apply corresponding setting. 
By default Rule interval is 30 minutes, but you can tune it in the rule's settings.
Pay Attention that Deny restriction has higher priority!
Rule does nothing to the Agents which doesn't belong to any group.

Script sources:

вторник, 10 сентября 2013 г.

How to configure monitoring under the "Low Privilege" for SQL 2012 Cluster

Since last post I continue explore new SQL MP...
Monitoring  under the "Low Privilege" for SQL 2012 cluster it is one of the interesting features in the new SQL MP 6.4.0.0!
It is good to know that now it is possible to do SQL 2012 Cluster monitoring with not SA permissions, which means operations are unable to access to user's confidential information.

Usually Run As and monitoring under the "Low Privilege" configuration is not trivial, so I want to share with you this guide.

Meet with my sandbox:
  • Active Directory server
  • SCOM 2012 SP1 server on Windows 2012 server
  • 2-nodes Windows Server 2012 cluster with SQL 2012 Cluster Instance
  • iSCSI software target server - shared storage for my cluster
image

Ok let’s go!

  1. AD configuration:

1.    In Active Directory, create three domain users that will be commonly used for low-privilege access to all target SQL Server instances:
a.    SQLDefaultAction
b.    SQLDiscovery
c.    SQLMonitor
2.    Create a domain group named SQLMPLowPriv and add the following domain users:
a.    SQLDiscovery
b.    SQLMonitor
 Just Open Active Directory Users and Computers and create users and Groups:
2013-09-09 12_32_38-172.17.7.200 - Remote Desktop Connection


3.   Grant special permission: Read-only Domain Controllers - “Read Permission” to the SQLMPLowPriv
Open SQLMPlowPriv properties in Active Directory Users and Computers, go to Security tab and click Advanced:
2013-09-09 13_12_42-172.17.7.200 - Remote Desktop Connection


On Advanced settings click add:
2013-09-09 13_11_19-172.17.7.200 - Remote Desktop Connection


Type Read-only Domain Controllers, click ok:
image


Grant Read permission and save settings:
2013-09-09 13_10_24-172.17.7.200 - Remote Desktop Connection

2. Cluster node configuration

NOTE: Whatever setting you made on first cluster node, the same must be done on a second node of a cluster.
1. On the agent machine, add the SQLDefaultAction and SQLMonitor domain users to the “Performance Monitor Users” local group.
image


2.    If the operating system of the agent machine is Windows Server 2008 or above, add the SQLDefaultAction and SQLMonitor domain users to “EventLogReaders” local group. 
 image


3.    Add the SQLDefaultAction domain user and SQLMPLowPriv domain group as members to the local Users group.
 image


4.    Configure the “Log On Locally” local security policy setting to allow the SQLDefaultAction domain user and SQLMPLowPriv domain group users to log on locally.
 image


5.   Grant Read permission on HKLM:\Software\Microsoft\Microsoft SQL Server registry path for SQLDefaultAction and SQLMPLowPriv
image

image

6.   Grant “Execute Methods”, “Enable Account”, “Remote Enable”, “Read Security” permissions  for root, root\cimv2, root\default, root\Microsoft\SqlServer\ComputerManagement11 WMI namespaces to SQLDefaultAction and SQLMPLowPriv

Start WMImgmt.msc console from the command line, open properties
image


Open Root, click security
image


Add SQLDefaultAction and SQLMPLowPriv and grant permissions. Do the same for all needed WMI namespaces. Do not forget do the same on second node!
image


7.   Grant Read permission on HKLM:\Software\Microsoft\Microsoft SQL Server\[InstanceID]\MSSQLServer\Parameters registry path for SQLMPLowPriv for each monitored instance
This step is required because it does not inherits parameters from the top level, but MP need access to this registry key
image

Time for cluster-specific configuration:
1.   Grant “Remote Launch” and  “Remote Activation” DCOM permissions to the SQLMPLowPriv, SQLDefaultAction  using DCOMCNFG
Run from command prompt DCOMCNFG command to open Component Services management console, than open My  computer properties
image
Edit Defaults of Launch and Activation Permissions:

image
Note: On some configurations Defaults doesn't work, so need also set Limits.

Grant Permissions - do not remove Local Launch, just add Remote Launch and Activation:
image


2.   Allow Windows Remote Management through the Windows Firewall  
 image
*In fact I just turned Firewall off, for simplicity, because otherwise I have to spent time to add exceptions for SCOM agent and so on.

3.   Grant “Read” and “Full Control” access for the cluster to the SQLMPLowPriv using Failover Cluster Manager
 In FC Manager open cluster properties:
image
On a Cluster Permissions tab grant Read and Full control permissions:
image

3. SQL Server configuration

1. In SQL Server Management Studio, create a login for “SQLMPLowPriv” on all SQL Server instances to be monitored on the agent machine, and grant the following permissions to each “SQLMPLowPriv” login:
a. VIEW ANY DEFINITION
b. VIEW SERVER STATE
c. VIEW ANY DATABASE
2. Create a SQLMPLowPriv user that maps to the SQLMPLowPriv login in each existing user database, master, msdb, and model. By putting user in the model database, it will automatically create a SQLMPLowPriv user in each future user-created database. See the code sample below. You will need to manually provision the user for attached and restored databases.
3. Add the SQLMPLowPriv user on msdb to the SQLAgentReaderRole database role.
4. Add the SQLMPLowPriv user on msdb to the PolicyAdministratorRole database role.


All steps above are easy with using sample scripts which inside the guide:


Results of second script will provision SQLMPLowPriv to all user databases.
I’ve also perform above steps for SQLDefaultAction
I’ll skip tasks configuration, lets move to Operations Manager configuration.

4. Operations Manager Configuration
1. Import the SQL Server Management Pack if it has not been imported.


I have absolutely clean environment, so I have to import MP first:
image


2. Create a SQLDefaultAction, SQLDiscovery and SQLMonitor Run As accounts with “Windows” account type.

In Operations Console go to Administrator, open Run As Configuration/Accounts, create new accounts


I recommend to use more secure Run AS accounts distribution, as in this case you explicitly map account to computer.



On absolutely clean environment I have to deploy agents on cluster nodes before next step

Do not forget set Allow Agent act as a proxy setting for both cluster nodes! Cluster will be not discovered in such case

3. On the System Center Operations Manager console, configure the Run As profiles for the SQL Server Management Pack as following:
a. Set the “SQL Server Default Action Account” Run As profile to use the SQLDefaultAction Run As account.
Create Group and include Cluster node Agents in this group - it allows to scope down Run As profiles to SQL Cluster in next steps

 Open Run As Configuration/Profiles, configure profiles - do not furget select group created on previous step as a target! Useing all target objects is not safe - if appropriate security is not configured on some machine or distribution is not set monitoring will stop work properly on thouse machines


Do not forget to set run as account distribution – add both nodes of cluster

Do the same for SQL Discovery and SQL Monitor
b. Set the “SQL Server Discovery Account” Run As profile to use the SQLDiscovery Run As account.
c. Set the “SQL Server Monitoring Account” Run As profile to use the SQLMonitor Run As account.

Next step is map user account with enough permissions to the Windows Cluster Action Account, I’ve used freshly created Cluster admin account, otherwise Windows Cluster may be not discovered:

Same as for other accounts do not forget to configure account distribution – map both nodes for Cluster admin account.
That’s all, configuration is ready!

Now let's wait while Windows Failover cluster will be discovered, than SQL discovery will be stared. 
It may take for a while… Of course there are several ways to push the discovery, but for reasons of clarity I will not touch my environment.

After about 10 minutes virtual nodes of a cluster are discovered:


One virtual node it is WFC, second it is SQL Cluster name.

Finally, after another 10 minutes SQL Server Cluster is discovered and monitored!


Databases are also discovered and monitored!

Let's do simple test - take user DB offline

After some time Alert appeared and DB is in critical State

Cheers!!!


пятница, 6 сентября 2013 г.

Hot news! SQL Server Management Pack 6.4.0.0 is release and available for download!

Hello, dear friends!
Hot news - SQL Server Management Pack v. 6.4.0.0 released and available for download

List of new features:

  • New Dashboard for SQL Server 2012 DB
  • New Monitors and Rules – only for SQL 2008 and SQL 2012
    • Collect DB Active Connections count
    • Collect DB Active Requests count
    • Collect DB Active Sessions count
    • Collect DB Active Transactions count
    • Collect DB Engine Thread count
    • Thread Count monitor
    • Transaction Log Free Space (%) monitor
    • Transaction Log Free Space (%) collection
    • Collect DB Engine CPU Utilization (%)
    • CPU Utilization (%) monitor for DB engine
    • Buffer Cache Hit Ratio monitor
    • Collect DB Engine Page Life Expectancy (s)
    • Page Life Expectancy monitor
    • Collect DB Disk Read Latency (ms)
    • Collect DB Disk Write Latency (ms)
    • Disk Read Latency monitor
    • Disk Write Latency monitor
    • Collect DB Transactions per second count
    • Collect DB Engine Average Wait Time (ms)
    • Average Wait Time monitor
    • Collect DB Engine Stolen Server Memory (MB)
    • Stolen Server Memory monitor
    • Collect DB Allocated Free Space (MB)
    • Collect DB Used Space (MB)
    • Collect DB Disk Free Space (MB)
    • SQL Re-Compilation monitor
  • Run As configuration changes to support Low privilege for SQL Server 2012 Cluster


I've deployed it and on my brand new sandbox.
Some screenshots of new dashboard web and regular console:


BTW To make tiles green I've have to enabled corresponding monitors.

First post - Welcome!

I'm Aleksandr Andrushchenko IT Management and System Center expert with 6 years experience.
I'll share with you my experience in IT Management and System Center, also news, tips and so on.