简体   繁体   中英

How to monitor applications status using .NET?

I have to develop a system that monitors applications runnig in a network. It should collects informations about the status of applications as well as sends alerts in case of problems. I choose to develop this application on .NET. Please indicates me if there is any APIs for that purpose or any ideas that can help me to begin. If you suggest any other framework to develop such project may I know the reasons!

Thank you

WMI (System.Management namespace) or hooking into the windows performance monitors would give you a good running start. You can also set up your own sort of 'client-server' monitoring infrastructure, where a program runs as a windows service on each of the target machines. Said program would then be able to run whatever monitoring code you want, such as checking that a process with a particular name is running. This program would send reports to the central server (via remoting, or sockets, or a webservice, or whatever you're comfortable with) containing a 'status' report of the given machine. The central server could then aggregate the statuses and send an alert or set off a klaxon or whatever is appropriate for your business needs.

This depends on whether you mean any arbitrary application, without any coding changes or support within the applications themselves? Or do you mean a suite of applications that are custom coded to cooperate with the monitoring system you are building.

In the latter case I would add a remoting channel to the applications, that a monitoring system could connect to on a regular basis, (functionally like a ping) and with a generic GetStatus() method that would report appropriate health stats to the monitoring system... I would add this functionality as a separate dependant assembly to each app I wanted to monitor...

In the first case, I believe you will need to hook into OS APIs, especially to communicate with OS's running on other machines on the network (if that is also a requirement) As You mentioned .Net I assume you are talking WIn32 Machines only. I do not know what fuinctionality is exposed by the WIn32 API in this area.

You need to define monitoring. How are you planning to monitor the applications and what kind of information do you plan on recording?

What is your definition of a "problem" for the app? Do you have code control over the app(s) to be monitored? Generally an app having "problems" doesn't announce it, as it's usually due to a bug. How you would detect that is very difficult if the app isn't already designed to send out information specifically for you to look for problems.

The only thing remotely similar I've done in the past was to hook into the scheduler itself(in Windows CE) to monito the amount of quantum threads were getting to look for something consuming too much of the processor, but be forewarned that doing that kind of thing has huge potential for bugs, it uses a lot of the processor itself (and I have no idea if you can even do it on the desktop).

Well, monitoring applications is not as simple, since you have to look into other pc's and what is going on in them.

Common ways for monitoring a Network are using the SNM-Protocol suite, or going more into Windows world the WMI-Path.

WMI is wrapped in .NET but not at a hole, so you need to know how to handle WMI and build your own wrappers for that.

SNMP, I bet, is not really helpful, since not all applications support this.

To be more clear, in my network I have different machines and servers where are running some applications like databases, web applications and many ohers.

The manager of this network need a monitoring application that alerts him if any application was fall down. But I haven't specifications about the kind of problems that may occur!!

May I have more explanations about WMI.

Thank you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM