Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 813
  • Last Modified:

Starting Performance Alerts on System Startup

I am trying to configure Performance Monitor so that it will automatically start an alert on startup/reboot.  

I have been able to save and reload Alerts in HTML files, and I see how to start perfmon from the command line.  But I don't see how to include the HTML file in the command line, or how to replicate the Performance "Logs & Alerts --> Alerts --> New Alert Settings From" on the command line.
0
JoshuaSharf
Asked:
JoshuaSharf
  • 6
  • 3
1 Solution
 
GeoffSuttonCommented:
To start the HTML from the commandline, try iexplore.exe <<html filename>>.  You can also put this batch (or the html file/URL) into the startup group of the start menu.  That will cause it to start automatically.  Also, of you create a text file with all the dos prompts listed in order that you want to run, and save it with .bat (16 bit) or .cmd(32 bit) then you can double click on that file to run those commands in sequence.  I will need time to research the actual performance monitor and manipulating that from the command line.  I expect we will be looking at VBScript to provide functionality.

Geoff
0
 
JoshuaSharfAuthor Commented:
Close.  I've been able to bring up the ActiveX in IE, but that only shows the monitor; it doesn't fire the alert or appear to start the alert.

Another alternative: is there some way of bring up smlogsvc.exe directly without having to go through Perfmon?  Maybe the logman script in the other URL is the way to go, but I don't see how to set thresholds or actions when those thresholds are exceeded.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GeoffSuttonCommented:
I gather that you would like to automate the performance monitoring on the system right from startup, correct?  I read the other URL on the logman and that implements behind the scenes data gathering without (hopefully) delving into system scripting.  That Data can be stored to a file, then loaded into the performance monitor to be reviewed and read over (I think).  I have not dealt with Performance monitor in quite some time, so I am trying to remember the ins and outs of it.

If I have the wrong idea of what you are trying to accomplish please let me know.  The more details the easier it is to solve the problem.

Thanks,

Geoff
0
 
JoshuaSharfAuthor Commented:
Well, that's about half of what I want to do.  The monitor only monitors a given attribute; I also want the alert to start up automatically.

Here's what we're trying to accomplish: we'd like to monitor a given process for high threads, and stop and restart the process when the number of threads exceeds a threshold.  We've got that part working.  The second part is to have both 1) the monitoring and 2) the alert that stops & restarts the errant process, restart when we need to reboot the machine for other reasons.
0
 
GeoffSuttonCommented:
I wonder if process monitor is the route to take then?  You should be able to create a vbscript TSR to handle all that for you, or to call another process if threadcount> setNumber.  It seems like you are trying to use Procmon beyond its design parameters.  

Try going with something like this (which I grabbed from http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/monitoring/processes/ and modified):

This is likely a more efficient and configurable version of what you are trying to accomplish.

I hope this works for you,

Geoff
MAX_ALLOWED_THREADS=250 ' set this as you want
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process")
 
 
For Each objProcess in colProcessList
    if objProcess.ThreadCount > MAX_ALLOWED_THREADS then
      ' put restart process here, either function call or spawn
    end if
Next
 
Wscript.sleep 30000 ' 30 seconds
' call this function again from here.

Open in new window

0
 
GeoffSuttonCommented:
PS this is untested, but the general form is correct :)

Geoff
0
 
JoshuaSharfAuthor Commented:
Forgive my relative ignorance here, but is this a regular shell script, or do I need to download and install the ActiveXperts Network Monitor in order for this to work?

I understand from the pseudo-script what it should do, and it looks just right.  What is it written in?
0
 
GeoffSuttonCommented:
Should run under the wscript host.  It's VBScript.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now