Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can SQL server agent read a system monitor alert?

Status
Not open for further replies.

sqlturbo

IS-IT--Management
Mar 11, 2002
67
US
Is it possible to configure SQL server agent to send an e-mail based on a system monitor alert? Here's the situation...I have a database that I assume would grow by 20-50 MB per day. I'd like to get notified before the database runs out of disk space. Now, I could do something similar by schedculing sp_spaced procedure to run daily but that would be a overkill. Or, I could set the maximum size of the database and define an alert to go off when the data file reaches that size. But I was wondering if I could get SQLServer agent to read a system monitor alert. So far I have not been able to figure it out. Also, are there better ways of monitoring space usage?

Any ideas are welcome? Thanks in advance.
 
Are you open to setting the max size and then having an alert fire when the database has grown to a certain percentage? (say 80% full)?
 
Thanks for the reply. Yes, I could do that. But is there way I could get SQLServer Agent to raise an alert by checking the windows application log? I know definig a percentage would work but I was curious if there are other ways to go about this.
 
If you're using SQL Server 7.0, you can use SQL Server's undocumented xp_eventlog extended stored procedure to return a result set of entries for a specific event log.

You could create an SP that loads the resulting data into a temp table, do a search on it for text referencing the database your are trying to monitor and then set your alert accordingly.

(Unfortunately, the xp_eventlog extended stored procedure doesn't work in SQL Server 2000.) The following example shows how you can retrieve the contents of the Application log:

xp_eventlog 'Application'



Thanks

J. Kusch
 
To me it seems that if all you are after is a notification when disk capacity reaches n% of total capacity, that there are easier way to accomplish this outside of SQL. I'm not a Network or Server admin so I don't know all of the available tools, but there has to be disk administration tools already designed for this need. I know in Win Server apps you can set a warning when a drive nears max capacity that will pop a message to the screen of the designated user. If funds to purchase an app to do this is a problem I'm sure it wouldn't take long for a programmer to write a service to do this. I know this hasn't provided any means in T-SQL to accomplish your need but I believe this is something that is better handled outside of SQL.

"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top