i would开发者_开发百科 like to monitor my systems in my network using c#, below is the list of things to monitor
- Status of remote system(logged in, logged out, turned off)
- Shutdown/reboot/logoff remote system
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.
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.
精彩评论