O'Reilly logo

Programming Windows® Services with Microsoft® Visual Basic® 2008 by Michael Gernaey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required