| Author |
Message |
bolingerm
Joined: 02 Sep 2008 Posts: 3 Location: Monterey County
|
Posted: Fri May 25, 2012 11:54 pm Post subject: Command line interface to SQL Monitor |
|
|
| 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. |
|
| Back to top |
|
 |
Chris Spencer
Joined: 29 Aug 2006 Posts: 300 Location: Red Gate - Cambridge
|
Posted: Mon May 28, 2012 3:25 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
bolingerm
Joined: 02 Sep 2008 Posts: 3 Location: Monterey County
|
Posted: Tue May 29, 2012 5:39 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Chris Spencer
Joined: 29 Aug 2006 Posts: 300 Location: Red Gate - Cambridge
|
Posted: Wed May 30, 2012 11:02 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
bolingerm
Joined: 02 Sep 2008 Posts: 3 Location: Monterey County
|
Posted: Wed May 30, 2012 10:38 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group