how to make perfmon to run a batch file RRS feed

  • Question

  • an someone please help me with the same issue?

    I created a batch file that sends an email and writes a log in a text file. It works if I manually run it, but I have no clue how to make this thing work in perfmon...

    In perfmon, I created a data collector that should monitor a program and send me an email alert if/when the processor jumps over 50%.

    In the DataCollector's properties, on the Alert Task tab, the first option I have is "Run this task when an alert is triggered". I put this line in the field "%systemdrive%\SendEmail\testbatch.bat". I don't know what/if I should populate anything in the Task Arguments fields... The way it is right now it doesn't work...it's not sending any emails.

    Can anyone please help me with this?
    I'd kindly appreciate it.


    Monday, October 17, 2011 7:34 PM


  • Hi,


    Let’s follow the steps below:


    1. Create a scheduled task to run the batch file.

    2. On the property sheet for the schedule task, on the Actions tab click edit for the start a program that was added to point to the batch file and in the "Add arguments" window type in $(Arg0).

    3. Set up the perfmon alert with the task name on the properties of the Alert and on the Alert Task with the name of the scheduled task that was created

    4. Enter the task arguments


    The $(Arg0) argument should then allow to pass the arguments from the perfmon alert to the scheduled task.



    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, October 20, 2011 9:11 AM