Jump to content

Recommended Posts

Posted

Hi,

 

For a while now i'v wanted to create a small system which gathers data from windows 7 PCs around our school...

 

Data I want to be monitoring would be things like:

CPU Temperature,

Memory/CPU Usage,

Catch Specific Events from Event veiwer (or even if it did a school-wide check every morning.. or even, a different batch of PCs every morning to avoid slowing down network ro sumin, instead of catching),

Processes running,

 

and anything else that I might think of as time goes on....

 

Im not a guru at this stuff, so Im just working with what I know from college really.

 

All I can think of to get started with this is having a Mysql database to store the data in, then I could easily display that on a website. But I have no idea what programming lanugage to use or the best way to write programs which takes this data and then sends it to the DB.

 

so, to start with anyone know a good language I could write these programs in? Something I can run in the background on windows 7, do the things above and send he data to a sql database (on the sam networkO)

 

-Thanks

Posted

There's a couple of approaches. I have started doing something similar at our school district to try and gather system information, at this stage im more interested in gathering machine specs, serial numbers, memory and hard disk space. I also wanted to try and learn powershell. It uses WMI to connect to remote machines and pull various configuration data, and saves out to CSV files.

 

You could use c# (visual studio express) / sqlexpress. I'm know the same WMI framework can be accessed from that, and there both free. I think the powershell scripting is more hackable, c# may take longer but you'll end up with a developed app.

 

Another option, also something I use here is "the dude" also free which is a network monitoring program which can monitor cpu/memory usage (not sure about cpu temp), interconnection speeds of switches.

Posted
We use a program called Mutiny (it's free for up to 10 devices so you can give it a go and is heavily discounted for education as it's written by a University). Also SCOM can be used for this sort of thing - again, very cost effective for education.
Posted
There's a couple of approaches. I have started doing something similar at our school district to try and gather system information, at this stage im more interested in gathering machine specs, serial numbers, memory and hard disk space. I also wanted to try and learn powershell. It uses WMI to connect to remote machines and pull various configuration data, and saves out to CSV files.

 

You could use c# (visual studio express) / sqlexpress. I'm know the same WMI framework can be accessed from that, and there both free. I think the powershell scripting is more hackable, c# may take longer but you'll end up with a developed app.

 

Another option, also something I use here is "the dude" also free which is a network monitoring program which can monitor cpu/memory usage (not sure about cpu temp), interconnection speeds of switches.

 

Played with WMI and powershell - EXACTLY what i needed and better from what Ive seen so far. I played with it last night, but today gonna try to make a program which gets the PCs memory usage.

 

The main thing that I'm strugglnig with is getting information about CPU temperature and that sort of thing... But for now i've got enough that i can ply with it.

Posted (edited)

Use C# and WMI to get the data, using the MySQL C# Connector to upload it and PHP to view the results.

 

We have done the same here and it's pretty snazzy. (Client App always running on machines checking for things, app runs on login and logoff to record history and set logins etc)

 

enet1.PNG enet2.PNG enet3.PNG

 

Client app also has a built in TCP stack for me to send messages to any machine, the client app has its own command structure so I can send it for example "takescreen" and then I would get a popup back with a picture of the machine from the PC i sent the command.

Edited by SovietRussia
  • Thanks 1
Posted
Use C# and WMI to get the data, using the MySQL C# Connector to upload it and PHP to view the results.

 

We have done the same here and it's pretty snazzy. (Client App always running on machines checking for things, app runs on login and logoff to record history and set logins etc)

 

[ATTACH=CONFIG]30291[/ATTACH] [ATTACH=CONFIG]30292[/ATTACH] [ATTACH=CONFIG]30293[/ATTACH]

 

Client app also has a built in TCP stack for me to send messages to any machine, the client app has its own command structure so I can send it for example "takescreen" and then I would get a popup back with a picture of the machine from the PC i sent the command.

 

Wow, nice. Thats the sorta thing I want to build!

 

so, is your system all being run from the ONE machine? It just remotely gets the information it needs? Or have you created something thats installed on all machines?

Posted
Wow, nice. Thats the sorta thing I want to build!

 

so, is your system all being run from the ONE machine? It just remotely gets the information it needs? Or have you created something thats installed on all machines?

 

All the machine info is pulled remotely from ONE machine using the website (I have translated WMI to PHP so I can do the calls in PHP)

Posted
so, to start with anyone know a good language I could write these programs in? Something I can run in the background on windows 7, do the things above and send he data to a sql database (on the sam networkO)

nagios already does a lot of what you need, it should be just a matter of some minor configuration to monitor the events and services you are interested in.

Posted (edited)

SovietRussia Looks very good, a couple of questions.

 

How long did the system take you to develop?

how come your using php/mysql for web interface, not c#/mssql/.asp/.net framework?

 

 

Zezima it looks like there's cpu temp call MSAcpi_ThermalZoneTemperature in root\WMI but it also looks like its broken. Possibly you can write bespoke functions if you can find were to get a reliable cpu temp. I used a custom .MOF file (https://technet.microsoft.com/en-us/library/cc180827.aspx) to extract installed applications as the win32_product needs care of use as it can trigger dependacy install things to happen. This allows me to use wmi call sampleproductlist and sampleproductlist32 to pull installed applications instead.

 

 

my sampleproduct.mof

 

// "AS-IS" sample MOF file for returning the two uninstall registry subkeys

// Unsupported, provided purely as a sample

// Requires compilation. Example: mofcomp.exe sampleproductslist.mof

// Implements sample classes: "SampleProductList" and "SampleProductlist32"

// (for 64-bit systems with 32-bit software)

 

 

#PRAGMA AUTORECOVER

 

 

[dynamic, provider("RegProv"),

ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]

class SampleProductsList {

[key] string KeyName;

[read, propertycontext("DisplayName")] string DisplayName;

[read, propertycontext("DisplayVersion")] string DisplayVersion;

[read, propertycontext("InstallDate")] string InstallDate;

[read, propertycontext("UninstallString")] string UninstallString;

};

 

 

[dynamic, provider("RegProv"),

ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432node\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]

class SampleProductsList32 {

[key] string KeyName;

[read, propertycontext("DisplayName")] string DisplayName;

[read, propertycontext("DisplayVersion")] string DisplayVersion;

[read, propertycontext("InstallDate")] string InstallDate;

[read, propertycontext("UninstallString")] string UninstallString;

};

 

 

.mofs have to be compiled client side also, so i ended up using group policy to deploy a scheduled task to mofcomp my file.

Edited by mikeyd101

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...