Command line interface to SQL Monitor

SQL Server performance monitoring and alerting

Command line interface to SQL Monitor

Postby bolingerm » Fri May 25, 2012 11:54 pm

Is there a command line interface (or some other mechanism) to SQL Monitor such that I could create a script to suspend and another script to activate maintenance windows? We have scripts that restart our servers and we would like to include suspending and reactivating monitoring so that alert messages will not be created (as we create text messages to phones from SQL Monitor alert messages). Thanks.
bolingerm
 
Posts: 3
Joined: Tue Sep 02, 2008 6:51 pm
Location: Monterey County

Postby Chris Spencer » Mon May 28, 2012 3:25 pm

Apologies but we currently have no command line interface for SQL Monitor and therefore it isn't possible to programmatically trigger our maintenance windows.

It would be possible to stop / start our base monitoring service using commands like: "net stop MonitorBaseDeploymentService" and "net start MonitorBaseDeploymentService" but as well as preventing alerts this would stop collection leading to gaps in the data.

Regards
Chris
Chris Spencer
Test Engineer
Red Gate
Chris Spencer
 
Posts: 301
Joined: Tue Aug 29, 2006 9:09 am
Location: Red Gate - Cambridge

Postby bolingerm » Tue May 29, 2012 5:39 pm

Chris,

Thanks for your response... I don't see a big down side (yet) to the gaps in the data if I disable the base monitoring service as suggested... that data has little value to me and I am assuming the graphical display of previous events (last month, etc.) will just show a drop off when monitoring is turned off and would resume the charting of events indicative of when monitoring was turned back on...I presume I can leave the web service alone and just turn off / turn on the base monitoring service via my OS scripts... or if I turn off just the web service (and leave base monitoring on to avoid the data collection gaps) will this stop email alerts from being sent outbound via the email functionality... my primary goal is to not get my Outlook rule based created text messages from the Redgate email alerts that are created when we are doing our monthly maintenance or server restarts and / or server patching...

Thanks again,
Michael
bolingerm
 
Posts: 3
Joined: Tue Sep 02, 2008 6:51 pm
Location: Monterey County

Postby Chris Spencer » Wed May 30, 2012 11:02 am

The base monitor service does nearly all the work, including sending the emails.

If your need is just to disable the emails for a specific period of time then it's possible to do this by updating SQL Monitor's data repository directly from your scripts.

Turn emails off (globally):
UPDATE [RedGateMonitor].[settings].[EmailSettings]
SET GlobalAlertEmailEnable=0

Turn emails back on:
UPDATE [RedGateMonitor].[settings].[EmailSettings]
SET GlobalAlertEmailEnable=1

I've tested this and it seems to work. Data collection is not stopped so there won't be any gaps in your data. Alerts are generated and will appear in the Alert Inbox (on the website). They just don't get emailed.

SQLCMD can be used to run the SQL from your OS scripts I believe.
http://msdn.microsoft.com/en-us/library/ms162773.aspx

Hope this helps
Chris
Chris Spencer
Test Engineer
Red Gate
Chris Spencer
 
Posts: 301
Joined: Tue Aug 29, 2006 9:09 am
Location: Red Gate - Cambridge

Postby bolingerm » Wed May 30, 2012 10:38 pm

Chris,

Thanks again for your timely and detailed response. I have tested this today and intend to use it in production later this month.

Michael
bolingerm
 
Posts: 3
Joined: Tue Sep 02, 2008 6:51 pm
Location: Monterey County


Return to SQL Monitor 3

Who is online

Users browsing this forum: No registered users and 0 guests