Re: Performance Alert - Passing command line arguments to email script
- From: "saraga" <scott.saraga@xxxxxxxxxxxxxxxxxxxxx>
- Date: 7 Dec 2005 11:02:44 -0800
Your script is good. You are almost there. All you need to do is adjust
the command line arguments that is available in the perfmon utility.
btw, i sent an email to your gmail account that has a snapshot.
in the Action tab do the following:
1. put "c:\windows\system32\cscript.exe" for run this program.
2. click on command line arguments button.
3. Uncheck all fields but 'text message'
4. put in the text message field the path to script and the message
5. pay close attention to the 'example' field to see how the quotes are
messing up your operation. (note, you only need a quote on the inside
for example:
c:\pathto\script\johnmail.vbs" "message for email
notice how i didn't put the quotes on the outside.
6. have a beer
7. share the knowledge
foxj77@xxxxxxxxx wrote:
> Can anyone help me out with this problem. I have setup the following
> two scripts to fire an email every time an alert is triggered.
>
> I want to be able to use a generic script to email me when an alert is
> tripped and include details of the alert. I plan to use the following
> two scripts to send an email and select all of the command line
> arguments in the alert (as one string).
>
> The problem is that the script doesn't send when configured in the
> alert. It works fine from the command line using the johnmail.cmd
> "test string" as well as typing cscript johnmail.vbs "alert text in
> here".
>
> When I try and configure it within the performance alert it doesn't
> send an email. The alert writes to event log so that I know the alert
> is being triggered.
>
> Can anyone help me out.
>
> Thanks in advance
>
>
> John
> ------------------------------------------------
> Johnmail.cmd
>
> cscript johnmail.vbs %1
> ------------------------------------------------
> johnmail.vbs
>
> dim server
> dim eventlog
> dim eventid
>
> server = WScript.Arguments.Item(0)
>
> Set objMessage = CreateObject("CDO.Message")
> objMessage.Subject = "Example CDO Message"
> objMessage.Sender = "john@xxxxxxxxxxxxx"
> objMessage.To = "john@xxxxxxxxxxxxx"
> objMessage.TextBody = "This is some sample message text. ===" &
> server
>
> '==This section provides the configuration information for the remote
> SMTP server.
> '==Normally you will only change the server name or IP.
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
>
> 'Name or IP of Remote SMTP Server
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> "newminddc"
>
> 'Server port (typically 25)
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
>
> objMessage.Configuration.Fields.Update
>
> '==End remote SMTP server configuration section==
>
> objMessage.Send
.
- References:
- Prev by Date: RE: A lot of events 333
- Next by Date: Re: Forcing Refresh of Credentials
- Previous by thread: Performance Alert - Passing command line arguments to email script
- Next by thread: Re: Adding new Domain Controller
- Index(es):
Relevant Pages
|