I was recently tasked with a project to design a monitoring web application for our "in-house" built web applications. There is a certain set of modules and parameters that we need to monitor: GSLB --> Web Tier --> App Tier --> Database.
Almost all (80%) of our applications share the same parameters that need to be monitored, but there are about a hundred of them. So here is what I'm thinking of doing....
1. Create an XML document for each application (An example layout is included at the end of this post) and save it in the Applications directory.
2. Setup a Spring project, and create code to dynamically go through the Applications directory and kick-off the monitoring logic for each <application/> item. Basically, the code will just traverse through all of the xml files (I might even create just 1 xml file with all of the <application/> items in it), read the "metadata" for each application, and start the backend processing, as well as display the data in a dynamically-generated web GUI (based on the XML structure and data).
Again, most of our applications (80%) have the same modules/parameters, therefore adding an application would only require us adding another <application/> element to the already-existing xml document (or adding an additional XML document). The code would do the rest...In regards to the rest 20% of applications, I would create a customize XML document with additional metadata (the code, in that case, would be able to handle the additional metadata).
So here are my questions:
1. What do you think of the idea itself? I'm sure that I'm not the only one who's thought of this, so are there any best-practices in this regard?
2. The reason I thought of using Spring is that it is XML-based (there are many reasons for me using Spring actually -- Security, ORM integration, etc), and it might facilitate my efforts. I'm thinking that even if reading through the Applications directory isn't such a good idea, I can somehow utilize Spring's dependency injection & AOS to create the appropriate solution. Have anybody tried this before and willing to share ideas, implementation approach, etc?
3. Other than Spring, what might help me accomplish this task?
4. Is this feasible (from a time and effort stand-point), or should I just do it the old-fashioned way?
Thanks in advance!
I'm including a sample XML document (very rough-draft) in this post:
OK, you lost me quickly in your solution, which means it is a bit overkill in my opinion.
Why not use Spring JMX, and create simple Pojo classes that do the management work. No need to read/write to xml. It is very simple to expose a POJO class as an MBean, then you can use any JMX console app that is out there. JConsole comes with Java 5+, to see how that looks, run jconsole from the command line and connect to itselt, you can see graphs and operations and values, and change values, fire operations.