Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Find the file size of Windows logs(Event,security & system) Using TSQL script. Expand / Collapse
Author
Message
Posted Monday, May 4, 2009 6:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 29, 2010 12:52 AM
Points: 8, Visits: 299
Hi,

I need to find the file size of Windows logs(Application ,security & system) Using TSQL script.

I have Both environments (MSSQL 2000 & 2005). I want to set the alert when these files grow beyond certain limit.

I know that there is provision itself in it to overwrite the events, but still I want to set alerts on it using MSSQL.

I have tried with code below.

exec master.dbo.xp_instance_regread
'HKEY_LOCAL_MACHINE'
,'SYSTEM\CurrentControlSet\Services\Eventlog\Application'
,'File'


But its not working on every server I have, that is because of some AD issues (permission on the 'config' folder).

Please let me know is there any other way to do the same.

Thanks in advance.


Regards,

Sameer.




Post #709337
Posted Wednesday, May 6, 2009 2:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 29, 2010 12:52 AM
Points: 8, Visits: 299
Hi,

Any one have any solution/suggestion on this ?
Post #710882
Posted Thursday, May 7, 2009 8:18 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:23 AM
Points: 1,207, Visits: 3,190
it is interesting. it is possible to parse the event log from tsql as well.
Post #712057
Posted Thursday, May 7, 2009 9:00 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, June 1, 2009 6:06 AM
Points: 518, Visits: 354
The Windows Event Logs on any server can provide insight to potential and real problems. As a SQL Server Database
Administrator, it is important to have knowledge of problems that exist outside of SQL Server as well as inside of SQL
Server. At times hardware problems such as controller failures, may be logged in the Windows Event Logs prior to
SQL Server reading a page from the database that is corrupt.

There is no native method in SQL Server that can be used to monitor the System Event Logs. However, VBScript and
WMI can be used to read the System Event Logs in a SQL Agent Job through a Operating System(cmdExec) job step.
In SQL Server 2005 and 2008 it is also possible to use a WMI Data Reader in Integration Services as well as make use
of CLR to allow easy access to the System Event Logs.




http://www.codecomments.com/WSH/message462337.html


+++BLADE+++
Post #712090
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse