Click here to Skip to main content
14,172,376 members
Click here to Skip to main content
Add your own
alternative version


59 bookmarked
Posted 7 Jul 2009
Licenced CPOL

Monitor System Information

, 18 Jul 2009
Rate this:
Please Sign up or sign in to vote.
A program to monitor and collect basic system information from remote machines.


Monitor Center is a system designed to help you control and monitor your computers in a local network. The system allows you to see, in real time, useful information about any of your computers using an easy interface that can be suited to your own needs.

This article supplies examples of how to access different information on the Windows Operating System, such as process information, performance counters, and basic system information.



The program uses the .NET Framework libraries in order to get the requested information.

Using the code

How can you use the program?

After you unzipp the demo file, copy MonitorCenter1.0.exe from the Server folder to any location on the server machine. This EXE is the central interface of the system from which you can perform all your actions on each one of the clients you wish to monitor (including the machine on which MonitorCenter1.0.exe is located). After this, copy the folder named Client to a location of your choice.

You can read the User Guide document that is included in the demo zip file for further instructions about using the program.

Now, the system is ready for use; just run both the server and client exe files! Here are some examples of collecting the required information.

Reading the processes information:

using System.Diagnostic;

Process[] ProcessList = Process.GetProcesses();

foreach (Process CurrProcess in ProcessList)
    Console.WriteLine("Process Name:" + CurrProcess.ProcessName);
    Console.WriteLine("Main Module FileName:" + CurrProcess.MainModule.FileName);
    Console.WriteLine("Start Time:" + CurrProcess.CurrProcess.StartTime);

The process owner, for example, is not part of the Process class, so we get this data from WMI:

using System.Management;

public string GetProcessOwner(int processID)
    string owner = string.Empty;
    string queryString = "Select * From Win32_Process Where ProcessID = " + processID;
    ManagementObjectSearcher searcher = new ManagementObjectSearcher(queryString);
    ManagementObjectCollection processList = searcher.Get(); 

    foreach (ManagementObject currentProcess in processList)
        string[] argList = { string.Empty };
        int returnValue = Convert.ToInt32(currentProcess.InvokeMethod("GetOwner", argList));
        if (returnValue == 0)
            owner = argList[0];

    return owner;

In order to get information of the Operating System performance counters, such as CPU usage, use the following code:

using System.Diagnostic;

PerformanceCounter CurrCounter = new PerformanceCounter("Processor%", 
                                 "ProcessorTime", "_Total");
int CPUTimeValue = CurrCounter.NextValue(); 

The information we collected was presented in line graphs which we built using ZedGraph. ZedGraph is an open source which you can download for free and use it to build any kind of graph you like.

All the above code examples are parts of the project source file.

Points of interest

Not all users have permissions to access system information. Moreover, sometimes, even the system administrator cannot access certain data. Use try and catch blocks when accessing information of the Operating System.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

Questioncan it work internet??? Pin
jfan20919-Jul-09 2:59
memberjfan20919-Jul-09 2:59 
Generalmy vote of 1 Pin
mbyamukama16-Jul-09 1:02
membermbyamukama16-Jul-09 1:02 
GeneralRe: my vote of 1 Pin
adambl17-Jul-09 2:05
professionaladambl17-Jul-09 2:05 
GeneralAwesome! [modified] Pin
Bit-Smacker14-Jul-09 8:27
memberBit-Smacker14-Jul-09 8:27 
Thank you! Thumbs Up | :thumbsup:

I've been wasting time trying to create all of my own system monitors from scratch, and this gave me a huge jump-start. As a bonus, I've been meaning to test-drive the ZedGraph library and you included that functionality as well!

It's a very nice monitoring tool as-is, but I'm planning to use it at a more basic level to only report exceeded threshold triggers for LAN monitoring. It would be nice to come in each morning and have a heads-up on what will be eating up my time.

Thanks for providing such a complete, functional, and useful applcation!

modified on Tuesday, July 14, 2009 2:33 PM

GeneralMore clarification Pin
Md. Marufuzzaman7-Jul-09 22:19
mentorMd. Marufuzzaman7-Jul-09 22:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03 | 2.8.190524.3 | Last Updated 18 Jul 2009
Article Copyright 2009 by NitzanO
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid