Monday, February 20, 2012

Logging NT Events

Hi,
Is it possbile to retrieve all the Event Id's of a registerd source
(Ex. MSSQLSERVER)? If it possible then can we retrieve the description
of those Event Id's and can we generate the NT Event with the above NT
Event and the desc for that?
Some how I retrieve all the Event Id's of SQL Server application and
then for each Event ID retrieve the Event Id Description and gererate
the same NT Event.
SMGENIE.EXE from MS Resource kit do the same.
Can anyone please let me know if its possible.
Thanks in advance,
Regards,
PramodHi
You don't say which version of SQL server you are using! With SQL 2005 you
can use SSIS to do this, alternatively you could write your own WMI scripts
or write your own xp.
To write to the event log you can use xp_logevent, or the LOG option of
RAISERROR, but you will not have a great deal flexibility.
John
"ipramod@.gmail.com" wrote:
> Hi,
> Is it possbile to retrieve all the Event Id's of a registerd source
> (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> of those Event Id's and can we generate the NT Event with the above NT
> Event and the desc for that?
>
> Some how I retrieve all the Event Id's of SQL Server application and
> then for each Event ID retrieve the Event Id Description and gererate
> the same NT Event.
>
> SMGENIE.EXE from MS Resource kit do the same.
>
> Can anyone please let me know if its possible.
>
> Thanks in advance,
> Regards,
> Pramod
>|||Hi John,
I am using SQL Server 2000. Is there any WMI Class that gives all the
event Id's and their description?
Thanks for replying,
Regards,
Pramod Ingle
John Bell wrote:
> Hi
> You don't say which version of SQL server you are using! With SQL 2005 you
> can use SSIS to do this, alternatively you could write your own WMI scripts
> or write your own xp.
> To write to the event log you can use xp_logevent, or the LOG option of
> RAISERROR, but you will not have a great deal flexibility.
> John
> "ipramod@.gmail.com" wrote:
> > Hi,
> >
> > Is it possbile to retrieve all the Event Id's of a registerd source
> > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > of those Event Id's and can we generate the NT Event with the above NT
> > Event and the desc for that?
> >
> >
> > Some how I retrieve all the Event Id's of SQL Server application and
> > then for each Event ID retrieve the Event Id Description and gererate
> > the same NT Event.
> >
> >
> > SMGENIE.EXE from MS Resource kit do the same.
> >
> >
> > Can anyone please let me know if its possible.
> >
> >
> > Thanks in advance,
> > Regards,
> > Pramod
> >
> >|||Hi
You may want to start from these examples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
John
"ipramod@.gmail.com" wrote:
> Hi John,
> I am using SQL Server 2000. Is there any WMI Class that gives all the
> event Id's and their description?
> Thanks for replying,
> Regards,
> Pramod Ingle
>
> John Bell wrote:
> > Hi
> >
> > You don't say which version of SQL server you are using! With SQL 2005 you
> > can use SSIS to do this, alternatively you could write your own WMI scripts
> > or write your own xp.
> >
> > To write to the event log you can use xp_logevent, or the LOG option of
> > RAISERROR, but you will not have a great deal flexibility.
> >
> > John
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Hi,
> > >
> > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > of those Event Id's and can we generate the NT Event with the above NT
> > > Event and the desc for that?
> > >
> > >
> > > Some how I retrieve all the Event Id's of SQL Server application and
> > > then for each Event ID retrieve the Event Id Description and gererate
> > > the same NT Event.
> > >
> > >
> > > SMGENIE.EXE from MS Resource kit do the same.
> > >
> > >
> > > Can anyone please let me know if its possible.
> > >
> > >
> > > Thanks in advance,
> > > Regards,
> > > Pramod
> > >
> > >
>|||Hi John,
The link you specified does not indicate how to get all event id's of a
registered source and also does not specify how to write events.
Thanks for your suggestion. Expecting more help :-)
Regards
Pramod
John Bell wrote:
> Hi
> You may want to start from these examples:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> John
> "ipramod@.gmail.com" wrote:
> > Hi John,
> >
> > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > event Id's and their description?
> >
> > Thanks for replying,
> > Regards,
> > Pramod Ingle
> >
> >
> > John Bell wrote:
> > > Hi
> > >
> > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > or write your own xp.
> > >
> > > To write to the event log you can use xp_logevent, or the LOG option of
> > > RAISERROR, but you will not have a great deal flexibility.
> > >
> > > John
> > >
> > > "ipramod@.gmail.com" wrote:
> > >
> > > > Hi,
> > > >
> > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > Event and the desc for that?
> > > >
> > > >
> > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > the same NT Event.
> > > >
> > > >
> > > > SMGENIE.EXE from MS Resource kit do the same.
> > > >
> > > >
> > > > Can anyone please let me know if its possible.
> > > >
> > > >
> > > > Thanks in advance,
> > > > Regards,
> > > > Pramod
> > > >
> > > >
> >
> >|||Hi
The last example show you almost everything that you need to do, it is not a
great step to work out how to limit the sourcename by changing the where
clause in the query or specifying specific EventCode values. If you can't
then the following explains how to use WQL
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
See also
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
for more information on what the Win32_NTLogEvent class contains
"ipramod@.gmail.com" wrote:
> Hi John,
> The link you specified does not indicate how to get all event id's of a
> registered source and also does not specify how to write events.
> Thanks for your suggestion. Expecting more help :-)
> Regards
> Pramod
>
>
> John Bell wrote:
> > Hi
> >
> > You may want to start from these examples:
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> >
> > John
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Hi John,
> > >
> > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > event Id's and their description?
> > >
> > > Thanks for replying,
> > > Regards,
> > > Pramod Ingle
> > >
> > >
> > > John Bell wrote:
> > > > Hi
> > > >
> > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > or write your own xp.
> > > >
> > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > RAISERROR, but you will not have a great deal flexibility.
> > > >
> > > > John
> > > >
> > > > "ipramod@.gmail.com" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > Event and the desc for that?
> > > > >
> > > > >
> > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > the same NT Event.
> > > > >
> > > > >
> > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > >
> > > > >
> > > > > Can anyone please let me know if its possible.
> > > > >
> > > > >
> > > > > Thanks in advance,
> > > > > Regards,
> > > > > Pramod
> > > > >
> > > > >
> > >
> > >
>|||Thanks John,
Actually I want to write SQLServer events to Application Log. Is there
any way to that?
Regards,
Pramod
John Bell wrote:
> Hi
> The last example show you almost everything that you need to do, it is not a
> great step to work out how to limit the sourcename by changing the where
> clause in the query or specifying specific EventCode values. If you can't
> then the following explains how to use WQL
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> See also
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> for more information on what the Win32_NTLogEvent class contains
> "ipramod@.gmail.com" wrote:
> > Hi John,
> >
> > The link you specified does not indicate how to get all event id's of a
> > registered source and also does not specify how to write events.
> >
> > Thanks for your suggestion. Expecting more help :-)
> >
> > Regards
> > Pramod
> >
> >
> >
> >
> > John Bell wrote:
> > > Hi
> > >
> > > You may want to start from these examples:
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > >
> > > John
> > >
> > > "ipramod@.gmail.com" wrote:
> > >
> > > > Hi John,
> > > >
> > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > event Id's and their description?
> > > >
> > > > Thanks for replying,
> > > > Regards,
> > > > Pramod Ingle
> > > >
> > > >
> > > > John Bell wrote:
> > > > > Hi
> > > > >
> > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > or write your own xp.
> > > > >
> > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > >
> > > > > John
> > > > >
> > > > > "ipramod@.gmail.com" wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > Event and the desc for that?
> > > > > >
> > > > > >
> > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > the same NT Event.
> > > > > >
> > > > > >
> > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > >
> > > > > >
> > > > > > Can anyone please let me know if its possible.
> > > > > >
> > > > > >
> > > > > > Thanks in advance,
> > > > > > Regards,
> > > > > > Pramod
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >|||Hi
Have you looked at RAISERROR or xp_logevent? Failing that you could call
xp_cmdshell with the a script that takes parameters.
John
"ipramod@.gmail.com" wrote:
> Thanks John,
> Actually I want to write SQLServer events to Application Log. Is there
> any way to that?
> Regards,
> Pramod
> John Bell wrote:
> > Hi
> >
> > The last example show you almost everything that you need to do, it is not a
> > great step to work out how to limit the sourcename by changing the where
> > clause in the query or specifying specific EventCode values. If you can't
> > then the following explains how to use WQL
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> >
> > See also
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> > for more information on what the Win32_NTLogEvent class contains
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Hi John,
> > >
> > > The link you specified does not indicate how to get all event id's of a
> > > registered source and also does not specify how to write events.
> > >
> > > Thanks for your suggestion. Expecting more help :-)
> > >
> > > Regards
> > > Pramod
> > >
> > >
> > >
> > >
> > > John Bell wrote:
> > > > Hi
> > > >
> > > > You may want to start from these examples:
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > > >
> > > > John
> > > >
> > > > "ipramod@.gmail.com" wrote:
> > > >
> > > > > Hi John,
> > > > >
> > > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > > event Id's and their description?
> > > > >
> > > > > Thanks for replying,
> > > > > Regards,
> > > > > Pramod Ingle
> > > > >
> > > > >
> > > > > John Bell wrote:
> > > > > > Hi
> > > > > >
> > > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > > or write your own xp.
> > > > > >
> > > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "ipramod@.gmail.com" wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > > Event and the desc for that?
> > > > > > >
> > > > > > >
> > > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > > the same NT Event.
> > > > > > >
> > > > > > >
> > > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > > >
> > > > > > >
> > > > > > > Can anyone please let me know if its possible.
> > > > > > >
> > > > > > >
> > > > > > > Thanks in advance,
> > > > > > > Regards,
> > > > > > > Pramod
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>|||No, can you give me the link
Regards,
Pramod
John Bell wrote:
> Hi
> Have you looked at RAISERROR or xp_logevent? Failing that you could call
> xp_cmdshell with the a script that takes parameters.
> John
> "ipramod@.gmail.com" wrote:
> > Thanks John,
> >
> > Actually I want to write SQLServer events to Application Log. Is there
> > any way to that?
> >
> > Regards,
> > Pramod
> >
> > John Bell wrote:
> > > Hi
> > >
> > > The last example show you almost everything that you need to do, it is not a
> > > great step to work out how to limit the sourcename by changing the where
> > > clause in the query or specifying specific EventCode values. If you can't
> > > then the following explains how to use WQL
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> > >
> > > See also
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> > > for more information on what the Win32_NTLogEvent class contains
> > >
> > > "ipramod@.gmail.com" wrote:
> > >
> > > > Hi John,
> > > >
> > > > The link you specified does not indicate how to get all event id's of a
> > > > registered source and also does not specify how to write events.
> > > >
> > > > Thanks for your suggestion. Expecting more help :-)
> > > >
> > > > Regards
> > > > Pramod
> > > >
> > > >
> > > >
> > > >
> > > > John Bell wrote:
> > > > > Hi
> > > > >
> > > > > You may want to start from these examples:
> > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > > > >
> > > > > John
> > > > >
> > > > > "ipramod@.gmail.com" wrote:
> > > > >
> > > > > > Hi John,
> > > > > >
> > > > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > > > event Id's and their description?
> > > > > >
> > > > > > Thanks for replying,
> > > > > > Regards,
> > > > > > Pramod Ingle
> > > > > >
> > > > > >
> > > > > > John Bell wrote:
> > > > > > > Hi
> > > > > > >
> > > > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > > > or write your own xp.
> > > > > > >
> > > > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > "ipramod@.gmail.com" wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > > > Event and the desc for that?
> > > > > > > >
> > > > > > > >
> > > > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > > > the same NT Event.
> > > > > > > >
> > > > > > > >
> > > > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > > > >
> > > > > > > >
> > > > > > > > Can anyone please let me know if its possible.
> > > > > > > >
> > > > > > > >
> > > > > > > > Thanks in advance,
> > > > > > > > Regards,
> > > > > > > > Pramod
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >|||Hi
Both are documented in Books Online.
John
"ipramod@.gmail.com" wrote:
> No, can you give me the link
> Regards,
> Pramod
>
> John Bell wrote:
> > Hi
> >
> > Have you looked at RAISERROR or xp_logevent? Failing that you could call
> > xp_cmdshell with the a script that takes parameters.
> >
> > John
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Thanks John,
> > >
> > > Actually I want to write SQLServer events to Application Log. Is there
> > > any way to that?
> > >
> > > Regards,
> > > Pramod
> > >
> > > John Bell wrote:
> > > > Hi
> > > >
> > > > The last example show you almost everything that you need to do, it is not a
> > > > great step to work out how to limit the sourcename by changing the where
> > > > clause in the query or specifying specific EventCode values. If you can't
> > > > then the following explains how to use WQL
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> > > >
> > > > See also
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> > > > for more information on what the Win32_NTLogEvent class contains
> > > >
> > > > "ipramod@.gmail.com" wrote:
> > > >
> > > > > Hi John,
> > > > >
> > > > > The link you specified does not indicate how to get all event id's of a
> > > > > registered source and also does not specify how to write events.
> > > > >
> > > > > Thanks for your suggestion. Expecting more help :-)
> > > > >
> > > > > Regards
> > > > > Pramod
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > John Bell wrote:
> > > > > > Hi
> > > > > >
> > > > > > You may want to start from these examples:
> > > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "ipramod@.gmail.com" wrote:
> > > > > >
> > > > > > > Hi John,
> > > > > > >
> > > > > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > > > > event Id's and their description?
> > > > > > >
> > > > > > > Thanks for replying,
> > > > > > > Regards,
> > > > > > > Pramod Ingle
> > > > > > >
> > > > > > >
> > > > > > > John Bell wrote:
> > > > > > > > Hi
> > > > > > > >
> > > > > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > > > > or write your own xp.
> > > > > > > >
> > > > > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > "ipramod@.gmail.com" wrote:
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > > > > Event and the desc for that?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > > > > the same NT Event.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Can anyone please let me know if its possible.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Thanks in advance,
> > > > > > > > > Regards,
> > > > > > > > > Pramod
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>

No comments:

Post a Comment