Re: Performance Alert - Passing command line arguments to email script

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • Re: FTP delete problem
    ... But i have wrote that manually the delete command it's OK!!! ... Dim strLocalFolderName, strFTPServerName, strLoginID ... In my script I use the options -s for the file. ... If i am in session in the server the scheduled script result OK. ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: iterating through a list of servers to issue a T-SQL ?
    ... Is it possible from command line to do this? ... Note that you can run the same script on multiple instances from SQL 2008 SSMS by creating a registered server group with the desired servers and opening a multi-server query window from that group node. ... FETCH NEXT FROM DatabaseList INTO @DatabaseName; ...
    (microsoft.public.sqlserver.server)
  • Re: FTP in ASP.NET C#
    ... It has native .NET classes that will allow you to use the FTP protocol. ... >I would like to have my application FTP a file to a server after a user ... > ' This script assumes the file to be FTP'ed is in the same directory as ... > ' If there are multiple files to put, we need to use the command ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Error when calling wscript
    ... We need to move this to a new server and it has service ... at this point when the script is running in this instance (some ... I've checked permissions for setroot, getpid.pl, ... Running this batch file from a Command Prompt will probably tell you ...
    (microsoft.public.scripting.wsh)
  • Re: replace field contents - record locking
    ... (windows, server 8, clients 8.5) ... If a user is in a record, then it is locked, and the replace command ... You can script navigation to force a record commit. ... successive editions of Filemaker have been successively slower. ...
    (comp.databases.filemaker)