SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Find the file size of Windows logs(Event,security & system) Using TSQL script.


Find the file size of Windows logs(Event,security & system) Using TSQL script.

Author
Message
sameer_bhagat_1
sameer_bhagat_1
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 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.
sameer_bhagat_1
sameer_bhagat_1
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 299
Hi,

Any one have any solution/suggestion on this ?Doze
Pei Zhu-415513
Pei Zhu-415513
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1835 Visits: 4167
it is interesting. it is possible to parse the event log from tsql as well.
BLADE-1043594
BLADE-1043594
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 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+++Cool
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search