This script will allow you to monitor the number of Handles/Threads/Processes on a remote machine, without using SNMP and Microsoft's Performance Monitoring SNMP Extensions.
The sample script returns the following:
- 1 if the number of handles/threads/processes matches or is below the threshold
- 0 if the number of handles/threads/processes is greater than the threshold value
Sample Monitor Settings
For the following example, we will assume the following:
Maximum Number of Processes to be Running: 50
Counter Type: PROCESSES
Script Location: c:\ipmscripts\
For Windows 2000
Executable Name: cscript.exe
Directory: c:\winnt\system32\
Command Line Parameters: perfmon_totals.vbs REMOTESRV 50 PROCESSES
Startup Directory: c:\ipmscripts\
Compare the Process Return Value = SELECTED
Expected Return Value: 1
For Windows XP / 2003
Executable Name: cscript.exe
Directory: c:\windows\system32\
Command Line Parameters: perfmon_totals.vbs REMOTESRV 50 PROCESSES
Startup Directory: c:\ipmscripts\
Compare the Process Return Value = SELECTED
Expected Return Value: 1
In the event the number of handles/threads/processes exceeds the threshold value, the script will return a 0, which will trigger an Alert.