Solved

Starting Performance Alerts on System Startup

Posted on 2008-10-17
11
790 Views
Last Modified: 2010-05-18
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
Comment
Question by:JoshuaSharf
  • 6
  • 3
11 Comments
 
LVL 10

Expert Comment

by:GeoffSutton
Comment Utility
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
 
LVL 10

Expert Comment

by:GeoffSutton
Comment Utility
0
 

Author Comment

by:JoshuaSharf
Comment Utility
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
 
LVL 10

Expert Comment

by:GeoffSutton
Comment Utility
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
Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

 

Author Comment

by:JoshuaSharf
Comment Utility
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
 
LVL 10

Accepted Solution

by:
GeoffSutton earned 250 total points
Comment Utility
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
 
LVL 10

Expert Comment

by:GeoffSutton
Comment Utility
PS this is untested, but the general form is correct :)

Geoff
0
 

Author Comment

by:JoshuaSharf
Comment Utility
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
 
LVL 10

Expert Comment

by:GeoffSutton
Comment Utility
Should run under the wscript host.  It's VBScript.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now