Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Availability is the simplest form of process monitoring: with this approach, you simply ensure that the process is running. When you monitor for process availability, you typically retrieve a list of processes running on a computer and then verify that a particular process is still active. If the process is active, it is considered available. If the process is not active, it is not available.
The Win32_Process class enables you to create scripts that identify the processes currently running on any computer in your organization.
Listing 14.1 contains a script that monitors process availability by checking the list of processes running on a computer and issuing a notification if the Database.exe process is not found. To carry out this task, the script must perform the following steps:
To restrict data retrieval to a single process, a WHERE clause is used to limit data retrieval to the process with the name Database.exe.
The Count method provides a quick way to determine whether Database.exe is running. If Count is equal to 1, that means one instance of Database.exe is running on the computer. If Count is equal to 0, no instances of Database.exe are running on the computer.
Listing 14.1 Monitoring Process Availability
|
|
Send us your feedback | « Previous | Next » |