Creating a MOM event from a script
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Creating a MOM event from a script

 
Post new topic   Reply to topic    Windows Server Forum Index -> MOM
Author Message
Jeff
Guest





Posted: Mon Jan 10, 2005 11:47 pm    Post subject: Creating a MOM event from a script Reply with quote

Hi All,

I'm hoping someone can tell me what I'm doing wrong. I haven't been able to
successfully create an event in MOM. I am using the SDK and have written the
following script:

Option Explicit

'Event Constants
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16

Function MakeEvent()
Dim objEvent

Set objEvent = ScriptContext.CreateEvent()

objEvent.EventSource = "TestPing"
objEvent.EventNumber = 999
objEvent.EventType = EVENT_TYPE_WARNING
objEvent.LoggingDomain = "DOMAIN1"
objEvent.SourceDomain = "DOMAIN1"
objEvent.Message = "This is a test."

Set MakeEvent = objEvent
End Function


Sub Main()

On Error Resume Next

ScriptContext.Submit(MakeEvent)

End Sub

I have then entered this as a script in the Administrator console. I then
created a rule using a one minute timed provider, and this script as the
response. I have waited for the rule to be pushed out to the agents, and
nothing seems to be logged in the MOM event log, or the Windows event log.

I created the rule in a group this is only applied to the MOM management
server itself, and currently have the script set to execute on the agent
machine - although I had it previously set to execute on the MOM server
itself without luck.

Can someone point me in the right direction?

TIA,

Jeff
Back to top
Arie de Haan
Guest





Posted: Tue Jan 11, 2005 5:17 am    Post subject: Re: Creating a MOM event from a script Reply with quote

In article <B5C7B4E5-6B4D-4AF8-8C64-263FAEAD1CFE@microsoft.com>,
Jeff@discussions.microsoft.com says...
Quote:
Hi All,

I'm hoping someone can tell me what I'm doing wrong. I haven't been able to
successfully create an event in MOM. I am using the SDK and have written the
following script:

Option Explicit

'Event Constants
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16

Function MakeEvent()
Dim objEvent

Set objEvent = ScriptContext.CreateEvent()

objEvent.EventSource = "TestPing"
objEvent.EventNumber = 999
objEvent.EventType = EVENT_TYPE_WARNING
objEvent.LoggingDomain = "DOMAIN1"
objEvent.SourceDomain = "DOMAIN1"
objEvent.Message = "This is a test."

Set MakeEvent = objEvent
End Function


Sub Main()

On Error Resume Next

ScriptContext.Submit(MakeEvent)

End Sub

I have then entered this as a script in the Administrator console. I then
created a rule using a one minute timed provider, and this script as the
response. I have waited for the rule to be pushed out to the agents, and
nothing seems to be logged in the MOM event log, or the Windows event log.

I created the rule in a group this is only applied to the MOM management
server itself, and currently have the script set to execute on the agent
machine - although I had it previously set to execute on the MOM server
itself without luck.

Can someone point me in the right direction?

TIA,

Jeff

Maybe the event creator from the resource kit can help?

download at:
http://www.microsoft.com/mom/downloads/2005/reskit/default.mspx


--
Greetz,

Arie
This posting is provide "AS IS" with no guarantees, warranties, rigths
etc.
Back to top
Jeff
Guest





Posted: Tue Jan 11, 2005 9:21 pm    Post subject: Re: Creating a MOM event from a script Reply with quote

Hi Arie,

Thanks for the reply. I have looked at that tool in the past, and it looks
to be designed more for testing various management packs by creating events
in the Windows event log. I would like to create an event within MOM. I
want this to become part of a larger script that queries a server gateway
when it misses a heartbeat, so that additional information can be included
with any missed heartbeat notifications. It looks like there are functions
already built into MOM that should allow this, but I'm having trouble
triggering them.

Anyone else had success creating their own events from a script?

Jeff

"Arie de Haan" wrote:

Quote:
In article <B5C7B4E5-6B4D-4AF8-8C64-263FAEAD1CFE@microsoft.com>,
Jeff@discussions.microsoft.com says...
Hi All,

I'm hoping someone can tell me what I'm doing wrong. I haven't been able to
successfully create an event in MOM. I am using the SDK and have written the
following script:

Option Explicit

'Event Constants
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16

Function MakeEvent()
Dim objEvent

Set objEvent = ScriptContext.CreateEvent()

objEvent.EventSource = "TestPing"
objEvent.EventNumber = 999
objEvent.EventType = EVENT_TYPE_WARNING
objEvent.LoggingDomain = "DOMAIN1"
objEvent.SourceDomain = "DOMAIN1"
objEvent.Message = "This is a test."

Set MakeEvent = objEvent
End Function


Sub Main()

On Error Resume Next

ScriptContext.Submit(MakeEvent)

End Sub

I have then entered this as a script in the Administrator console. I then
created a rule using a one minute timed provider, and this script as the
response. I have waited for the rule to be pushed out to the agents, and
nothing seems to be logged in the MOM event log, or the Windows event log.

I created the rule in a group this is only applied to the MOM management
server itself, and currently have the script set to execute on the agent
machine - although I had it previously set to execute on the MOM server
itself without luck.

Can someone point me in the right direction?

TIA,

Jeff

Maybe the event creator from the resource kit can help?
download at:
http://www.microsoft.com/mom/downloads/2005/reskit/default.mspx


--
Greetz,

Arie
This posting is provide "AS IS" with no guarantees, warranties, rigths
etc.

Back to top
Trevor
Guest





Posted: Tue Jan 11, 2005 10:09 pm    Post subject: Re: Creating a MOM event from a script Reply with quote

This is what I use :

LoggingComputer = ScriptContext.TargetComputer
Set oEvent = ScriptContext.CreateEvent
oEvent.EventSource = "TestSource"
oEvent.Message = "This is my message"
oEvent.EventNumber = 1234
oEvent.EventType = 1
oEvent.LoggingComputer = LoggingComputer
ScriptContext.Submit oEvent


Hope it helps.

Trevor

"Jeff" wrote:

Quote:
Hi Arie,

Thanks for the reply. I have looked at that tool in the past, and it looks
to be designed more for testing various management packs by creating events
in the Windows event log. I would like to create an event within MOM. I
want this to become part of a larger script that queries a server gateway
when it misses a heartbeat, so that additional information can be included
with any missed heartbeat notifications. It looks like there are functions
already built into MOM that should allow this, but I'm having trouble
triggering them.

Anyone else had success creating their own events from a script?

Jeff

"Arie de Haan" wrote:

In article <B5C7B4E5-6B4D-4AF8-8C64-263FAEAD1CFE@microsoft.com>,
Jeff@discussions.microsoft.com says...
Hi All,

I'm hoping someone can tell me what I'm doing wrong. I haven't been able to
successfully create an event in MOM. I am using the SDK and have written the
following script:

Option Explicit

'Event Constants
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16

Function MakeEvent()
Dim objEvent

Set objEvent = ScriptContext.CreateEvent()

objEvent.EventSource = "TestPing"
objEvent.EventNumber = 999
objEvent.EventType = EVENT_TYPE_WARNING
objEvent.LoggingDomain = "DOMAIN1"
objEvent.SourceDomain = "DOMAIN1"
objEvent.Message = "This is a test."

Set MakeEvent = objEvent
End Function


Sub Main()

On Error Resume Next

ScriptContext.Submit(MakeEvent)

End Sub

I have then entered this as a script in the Administrator console. I then
created a rule using a one minute timed provider, and this script as the
response. I have waited for the rule to be pushed out to the agents, and
nothing seems to be logged in the MOM event log, or the Windows event log.

I created the rule in a group this is only applied to the MOM management
server itself, and currently have the script set to execute on the agent
machine - although I had it previously set to execute on the MOM server
itself without luck.

Can someone point me in the right direction?

TIA,

Jeff

Maybe the event creator from the resource kit can help?
download at:
http://www.microsoft.com/mom/downloads/2005/reskit/default.mspx


--
Greetz,

Arie
This posting is provide "AS IS" with no guarantees, warranties, rigths
etc.

Back to top
Jeff
Guest





Posted: Tue Jan 11, 2005 10:55 pm    Post subject: Re: Creating a MOM event from a script Reply with quote

Thanks Trevor. It looks like my script has started to work now as well.
There might have been another script hung up that was stopping this one from
executing. My best guess anyway. Thanks for the response though!

Jeff

"Trevor" wrote:

Quote:
This is what I use :

LoggingComputer = ScriptContext.TargetComputer
Set oEvent = ScriptContext.CreateEvent
oEvent.EventSource = "TestSource"
oEvent.Message = "This is my message"
oEvent.EventNumber = 1234
oEvent.EventType = 1
oEvent.LoggingComputer = LoggingComputer
ScriptContext.Submit oEvent


Hope it helps.

Trevor

"Jeff" wrote:

Hi Arie,

Thanks for the reply. I have looked at that tool in the past, and it looks
to be designed more for testing various management packs by creating events
in the Windows event log. I would like to create an event within MOM. I
want this to become part of a larger script that queries a server gateway
when it misses a heartbeat, so that additional information can be included
with any missed heartbeat notifications. It looks like there are functions
already built into MOM that should allow this, but I'm having trouble
triggering them.

Anyone else had success creating their own events from a script?

Jeff

"Arie de Haan" wrote:

In article <B5C7B4E5-6B4D-4AF8-8C64-263FAEAD1CFE@microsoft.com>,
Jeff@discussions.microsoft.com says...
Hi All,

I'm hoping someone can tell me what I'm doing wrong. I haven't been able to
successfully create an event in MOM. I am using the SDK and have written the
following script:

Option Explicit

'Event Constants
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16

Function MakeEvent()
Dim objEvent

Set objEvent = ScriptContext.CreateEvent()

objEvent.EventSource = "TestPing"
objEvent.EventNumber = 999
objEvent.EventType = EVENT_TYPE_WARNING
objEvent.LoggingDomain = "DOMAIN1"
objEvent.SourceDomain = "DOMAIN1"
objEvent.Message = "This is a test."

Set MakeEvent = objEvent
End Function


Sub Main()

On Error Resume Next

ScriptContext.Submit(MakeEvent)

End Sub

I have then entered this as a script in the Administrator console. I then
created a rule using a one minute timed provider, and this script as the
response. I have waited for the rule to be pushed out to the agents, and
nothing seems to be logged in the MOM event log, or the Windows event log.

I created the rule in a group this is only applied to the MOM management
server itself, and currently have the script set to execute on the agent
machine - although I had it previously set to execute on the MOM server
itself without luck.

Can someone point me in the right direction?

TIA,

Jeff

Maybe the event creator from the resource kit can help?
download at:
http://www.microsoft.com/mom/downloads/2005/reskit/default.mspx


--
Greetz,

Arie
This posting is provide "AS IS" with no guarantees, warranties, rigths
etc.

Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> MOM All times are GMT
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




New Topics Powered by phpBB