views:

106

answers:

3

i would like to monitor my systems in my network using c#, below is the list of things to monitor

  1. Status of remote system(logged in, logged out, turned off)
  2. Shutdown/reboot/logoff remote system
+2  A: 

This is a broad question. Are you using SNMP? If these are Windows computers you can use WMI. Both of those items can be done simply with WMI.

You may find this link useful for basic WMI information.

Here is a WMI reference.

Essentially, you can think of any piece of system information you like and then search for how to retrieve it using WMI. It doesn't matter if you find samples for VBScript (which is what most examples probably will be coded for), you can convert that to C# easy.

Alternatively, you can use SNMP, which is a bit more complex and requires extra setup.

Another possibility, and more work than WMI but less setup than SNMP, is to write your own code to query various pieces of information using the actual API calls. This is overkill for most things, stick with WMI where you can.

BobbyShaftoe
i am not using snmp
JKS
A: 

You should be able to monitor the status of remote systems using WMI and the System.Management namespace. An introductory article is here.

To force remove shutdown, reboots and logoff, probably the easiest way is to use the Sysinternals psshutdown (details). You can use this from C# by running it as an external Process.

Jeremy McGee
A: 

This networking monitoring software may help,give it a go.

Sienna Johansson
@Sienna Johansson,He needs to do that pro grammatically, not with some software. No offence, but please don't post answers like this to prevent downvotes.
Vivek Bernard