Send messages from multiple services/application and display them in one place

Inside system I’m developing I have several Windows Services, couple of applications running in Scheduler and COM+ application that is running my custom DLL’s.
Some of them are running on same PC, but most of them on different machines but in same local network.
I’d like to monitor status of tasks each element does. For example one of Windows Services in checking if there are files in specific folder, if so then starts to process them.

I need to know when each element starts and stops and have info about status (for example “processing files 2/300”).

I want to have one place (single application) that will display list of services/applications/COM+ DLL’s and their status. I don’t need to control those elements (restart them, start, stop) I want to see their status.

I’ve searched over the internet and found several options, but before I start to implement one of them I must pick one that will be most suitable for my case.

Below are options I fond:
1. store everything in database, for example in table:

Name           | Status | Date               | Error message
---------------------------------------------------------------
Print server   | Working| 2016-06-18 21:20:11|
Backup service | Failed | 2016-06-18 20:17:49| Not enough space

and using for example https://tabledependency.codeplex.com/ display everything in my app as grid, this way when something changes in sql table my app will auto update.

  1. Write everything to event log and then read all logs in my C# app. This way I must configure every new element in my app, because my app would have to know location of event log for each service/application.

  2. Use NamedPipes/Sockets/ UDP message to broadcast messages from every application/service I want to monitor. I’m not sure if this will work if I’d have 2 applications sending messages on same port from same pc. I can’t do standard server-clients approach, because I won’t have my monitoring application running all the time, so clients (services/applications) won’t be able to connect to it, besides that I can have multiple monitoring applications running.

Basically I need a way to send (broadcast) messages from multiple places (standard application/windows service/custom DLL) without knowing if someone is listening for them. Also I’d like to be able to start multiple applications and have messages displayed in all of them.
First solution is the easiest for me to create, but easiest solution isn’t always the best.

Since you want to be able to launch multiple instances of your monitoring application and be able to use the solution even if no one is “listening”, eventually all of the data needs to get distilled into some sort of central data store (data base, flat file, in memory in some central application).

Personally I would stand up a web service for your logging needs if the applications you need insight into do NOT all ready have access to a central database. All of the logging and status updates would go to the web service end point which would then get written to a data store (SQL Server, Mongo, Raven etc). By having a web service that gets hit you can change the data store with out having to change any of your other applications

Your monitoring application would then read from this data store on startup to generate the UI.

If the applications all have access to the same database then the easiest is also the simplest (and with libraries like log4net it gets very robust) method to centralize the information.

2

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *