WMI System Monitoring

Although WMI is great for gathering information, it can also be a very powerful monitoring and debugging tool. In this section we will use WMI to monitor the processes on our system and then use WMI to shut down an application that we define as behaving poorly. Because we don’t want to negatively affect our system at the moment, we will simulate this sitation by using NotePad.exe.

Updating the Configuration File

We need to be able to store the process or processes that we want to monitor for. Example 8-10 shows the updated configuration file with the process element added.

Example 8-10. Process monitoring elements.

<Process>Notepad.exe</Process>

We can implement the process element in several ways, depending on the complexity ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.