Solved

Starting Performance Alerts on System Startup

Posted on 2008-10-17
11
801 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
11 Comments
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22745468
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
ID: 22745533
0
 

Author Comment

by:JoshuaSharf
ID: 22745597
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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22746072
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
 

Author Comment

by:JoshuaSharf
ID: 22757818
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
ID: 22759739
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
ID: 22759790
PS this is untested, but the general form is correct :)

Geoff
0
 

Author Comment

by:JoshuaSharf
ID: 22788920
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
ID: 22790252
Should run under the wscript host.  It's VBScript.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

710 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