Monitoring application startup in .NET?

We have several applications that run on a Windows 2003/2008 server. Some of these applications are Java JAR files that start with the Scheduled Task using the app.cmd file.

Others are large, such as SQL Server and IIS.

I would like to write an application (or a service, in fact) that simply controls these programs and sees if they work or not.

This is slightly higher than what I did before. Oh, that should be written in C #.

I was thinking of some kind of "heart rate", so every few minutes I check if the stream is working (again, a new extended stream), and if so, send the message "Everything is OK" (using SMTP or something )

What clues start?

Thanks for any suggestions.

+4
source share
2 answers

You can use Process.GetProcesses() :

Use this method to create an array of new process components and link them to all process resources on the local computer.

+2
source

You should probably process each application on a case-by-case basis, for example, although you could just check for an SQL process, you'd better run a query that (for example) checks for a specific database on the server.

Similarly, you can run a simple HTTP request on the IIS server to check if permissions are set correctly, etc.

Obviously, the way you check your Java processes will depend on what they do, although you can still just check if this process works (remember that if they work as a service, they can work inside the same svchost.exe processes - this not relevant to scheduled tasks though).

+2
source

Source: https://habr.com/ru/post/1347192/


All Articles