Hot to get a Alert-Generated Field into a script Parameter
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
Hot to get a Alert-Generated Field into a script Parameter

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





Posted: Fri Oct 28, 2005 4:51 pm    Post subject: Hot to get a Alert-Generated Field into a script Parameter Reply with quote

I want to pass a Field generated by an Alert, e.g. $Description$ for the
Alert's decriptive Test into a script Parameter, so that the script (it
actually sends a SMS) can tell me what Alert occurred. I tried to simply put
$Description$ into the Script parameters, but this didnt work. So how can I
do it?
Back to top
Daniel Lai [MVP-Managemen
Guest





Posted: Sat Oct 29, 2005 12:50 am    Post subject: Re: Hot to get a Alert-Generated Field into a script Paramet Reply with quote

Hello,

Thank you for your posting!

You can try to configure the criteria in the event rule. And then add a
script response to that send out SMS

If you have any questions, please feel to let me know. I am glad to be of
assistance.


--
Daniel Lai
Microsoft MVP Program Top Contributor
Windows Server-Management Infrastructure
Microsoft Management Solution Consultant
http://msmvps.com/daniel

"Uwe Stoppel" <UweStoppel@discussions.microsoft.com> wrote in message
news:887AADA9-319A-426C-A887-6F44BF165156@microsoft.com...
Quote:
I want to pass a Field generated by an Alert, e.g. $Description$ for the
Alert's decriptive Test into a script Parameter, so that the script (it
actually sends a SMS) can tell me what Alert occurred. I tried to simply
put
$Description$ into the Script parameters, but this didnt work. So how can
I
do it?
Back to top
Uwe Stoppel
Guest





Posted: Sat Oct 29, 2005 12:50 pm    Post subject: Re: Hot to get a Alert-Generated Field into a script Paramet Reply with quote

Thank you for your reply, but unfortunately I dont think that would resolve
my problem. The script ist already working very well. The only problem I
currently have is that I want to get the $Decription$ filed generated be the
EVentAlert inside my script as a Variable. How do i do that?

"Daniel Lai [MVP-Management Infrastructur" wrote:

Quote:
Hello,

Thank you for your posting!

You can try to configure the criteria in the event rule. And then add a
script response to that send out SMS

If you have any questions, please feel to let me know. I am glad to be of
assistance.


--
Daniel Lai
Microsoft MVP Program Top Contributor
Windows Server-Management Infrastructure
Microsoft Management Solution Consultant
http://msmvps.com/daniel

"Uwe Stoppel" <UweStoppel@discussions.microsoft.com> wrote in message
news:887AADA9-319A-426C-A887-6F44BF165156@microsoft.com...
I want to pass a Field generated by an Alert, e.g. $Description$ for the
Alert's decriptive Test into a script Parameter, so that the script (it
actually sends a SMS) can tell me what Alert occurred. I tried to simply
put
$Description$ into the Script parameters, but this didnt work. So how can
I
do it?


Back to top
Adam White
Guest





Posted: Tue Nov 01, 2005 8:05 am    Post subject: Re: Hot to get a Alert-Generated Field into a script Paramet Reply with quote

Are you trying to run the script as a response to an existing alert, ie via
an alert rule?

- Adam

"Uwe Stoppel" wrote:

Quote:
Thank you for your reply, but unfortunately I dont think that would resolve
my problem. The script ist already working very well. The only problem I
currently have is that I want to get the $Decription$ filed generated be the
EVentAlert inside my script as a Variable. How do i do that?

"Daniel Lai [MVP-Management Infrastructur" wrote:

Hello,

Thank you for your posting!

You can try to configure the criteria in the event rule. And then add a
script response to that send out SMS

If you have any questions, please feel to let me know. I am glad to be of
assistance.


--
Daniel Lai
Microsoft MVP Program Top Contributor
Windows Server-Management Infrastructure
Microsoft Management Solution Consultant
http://msmvps.com/daniel

"Uwe Stoppel" <UweStoppel@discussions.microsoft.com> wrote in message
news:887AADA9-319A-426C-A887-6F44BF165156@microsoft.com...
I want to pass a Field generated by an Alert, e.g. $Description$ for the
Alert's decriptive Test into a script Parameter, so that the script (it
actually sends a SMS) can tell me what Alert occurred. I tried to simply
put
$Description$ into the Script parameters, but this didnt work. So how can
I
do it?


Back to top
Uwe Stoppel
Guest





Posted: Tue Nov 01, 2005 9:51 am    Post subject: Re: Hot to get a Alert-Generated Field into a script Paramet Reply with quote

Exactly. I have several scripts running that read out sensor data
(Temperature, Smoke/Fire...). The scripts then post an Information-type Event
when the Sensor values are ok, and a Warning- or Error-Type Event when the
specified values are out of range (lets say when the temperatures get too
high). The $Description$ Field of these Events then contains a Message like
"Alert! Sensor #1234 reports a temperature of 35°C.".

I then specified two rules that generate different Types of Alerts when
Error- or Warning-Type Events occur (lets say a Warning when the temperatures
rise, but an Error when there's smoke detected). These Alerts take the
$Description$ Field of the Events they were generated from with them, so that
the Alerts also have a text like "Alert! Sensor........".

Finally, I specified two Alert rules:

Rule #1 has no Duplicate Alert Suppression and is intended to send a
Notification (E-Mail) every Tick the Sensor data is read out when there is a
Warning-Type Event (lets say that would be One E-mail every 10 Minutes as
long as the temperatures are too high). The $Description$ Field from the
Initial Event is automatically taken into the E-mail by MOM.

Rule #2 has Duplicate Alert Suppression activated and is intended to run a
script once when an Error-Type Event occurs. The script then sends SMS to
every specified Cell Phone Number. The Only Problem I have is that I cannot
get the $Description$ Field into these SMS via the Script Parameters, so that
the SMS Text is only a static Text like "An error has been generated". But I
would prefer to know what exactly happened.

So how do I get that field into my Script?

"Adam White" wrote:

Quote:
Are you trying to run the script as a response to an existing alert, ie via
an alert rule?

- Adam

"Uwe Stoppel" wrote:

Thank you for your reply, but unfortunately I dont think that would resolve
my problem. The script ist already working very well. The only problem I
currently have is that I want to get the $Decription$ filed generated be the
EVentAlert inside my script as a Variable. How do i do that?

"Daniel Lai [MVP-Management Infrastructur" wrote:

Hello,

Thank you for your posting!

You can try to configure the criteria in the event rule. And then add a
script response to that send out SMS

If you have any questions, please feel to let me know. I am glad to be of
assistance.


--
Daniel Lai
Microsoft MVP Program Top Contributor
Windows Server-Management Infrastructure
Microsoft Management Solution Consultant
http://msmvps.com/daniel

"Uwe Stoppel" <UweStoppel@discussions.microsoft.com> wrote in message
news:887AADA9-319A-426C-A887-6F44BF165156@microsoft.com...
I want to pass a Field generated by an Alert, e.g. $Description$ for the
Alert's decriptive Test into a script Parameter, so that the script (it
actually sends a SMS) can tell me what Alert occurred. I tried to simply
put
$Description$ into the Script parameters, but this didnt work. So how can
I
do it?


Back to top
Uwe Stoppel
Guest





Posted: Wed Nov 02, 2005 1:50 pm    Post subject: Re: Hot to get a Alert-Generated Field into a script Paramet Reply with quote

So this is how i did it:

If (ScriptContext.IsAlert()) Then
Set objAlert = ScriptContext.Alert

This detemines the Alert the Script was started from. You can then access
every fields you want, like:

objAlert.Description

"Uwe Stoppel" wrote:

Quote:
Exactly. I have several scripts running that read out sensor data
(Temperature, Smoke/Fire...). The scripts then post an Information-type Event
when the Sensor values are ok, and a Warning- or Error-Type Event when the
specified values are out of range (lets say when the temperatures get too
high). The $Description$ Field of these Events then contains a Message like
"Alert! Sensor #1234 reports a temperature of 35°C.".

I then specified two rules that generate different Types of Alerts when
Error- or Warning-Type Events occur (lets say a Warning when the temperatures
rise, but an Error when there's smoke detected). These Alerts take the
$Description$ Field of the Events they were generated from with them, so that
the Alerts also have a text like "Alert! Sensor........".

Finally, I specified two Alert rules:

Rule #1 has no Duplicate Alert Suppression and is intended to send a
Notification (E-Mail) every Tick the Sensor data is read out when there is a
Warning-Type Event (lets say that would be One E-mail every 10 Minutes as
long as the temperatures are too high). The $Description$ Field from the
Initial Event is automatically taken into the E-mail by MOM.

Rule #2 has Duplicate Alert Suppression activated and is intended to run a
script once when an Error-Type Event occurs. The script then sends SMS to
every specified Cell Phone Number. The Only Problem I have is that I cannot
get the $Description$ Field into these SMS via the Script Parameters, so that
the SMS Text is only a static Text like "An error has been generated". But I
would prefer to know what exactly happened.

So how do I get that field into my Script?

"Adam White" wrote:

Are you trying to run the script as a response to an existing alert, ie via
an alert rule?

- Adam

"Uwe Stoppel" wrote:

Thank you for your reply, but unfortunately I dont think that would resolve
my problem. The script ist already working very well. The only problem I
currently have is that I want to get the $Decription$ filed generated be the
EVentAlert inside my script as a Variable. How do i do that?

"Daniel Lai [MVP-Management Infrastructur" wrote:

Hello,

Thank you for your posting!

You can try to configure the criteria in the event rule. And then add a
script response to that send out SMS

If you have any questions, please feel to let me know. I am glad to be of
assistance.


--
Daniel Lai
Microsoft MVP Program Top Contributor
Windows Server-Management Infrastructure
Microsoft Management Solution Consultant
http://msmvps.com/daniel

"Uwe Stoppel" <UweStoppel@discussions.microsoft.com> wrote in message
news:887AADA9-319A-426C-A887-6F44BF165156@microsoft.com...
I want to pass a Field generated by an Alert, e.g. $Description$ for the
Alert's decriptive Test into a script Parameter, so that the script (it
actually sends a SMS) can tell me what Alert occurred. I tried to simply
put
$Description$ into the Script parameters, but this didnt work. So how can
I
do it?


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