#13 Have a daemon version of Insight to monitor logs

Insight UI (18)

[This item was moved over from OpenMind. Feature RQ# 60]

nsight needs to have a daemon version, where it monitors logs at scheduled intervals and sends out reports to specified email addresses if triggers are fired.

Date: 2005-11-28 16:22
Sender: Bindul Bhowmik

Hello Team,

All of us might know by now that there is a requirement to have a daemon version of Insight that would be scheduled and would monitor logs on a server (production server?) and generate reports out of those logs. Additionally it might need to send out emails
when certain trigger conditions are met. BTW, Regu, could you please open an enhancement tracker on this?

As I see it, there are multiple aspects to achieving this feature:
1. Ability to schedule log parsing at intervals
2. Ability to run Insight as a daemon
3. Have a receiver that would just analyze the logs (on certain filters) without appending it to the UI (there will not be any UI)
4. Report generation capabilities
5. Emailing capabilities.
- Anything else...

Regu and I had a discussion on this, and we thought we need to concentrate on the first three initially. Regarding the 4th and 5th points, we should be OK with just sending out plain text or XML reports, and then could work on generating more detailed and graphical reports. For emailing we could use JavaMail API
(http://java.sun.com/products/javamail/) or the Jakarta commons-email package (http://jakarta.apache.org/commons/email/) which provides for easier use and configuration.

With point #3, we have started work on enhancing the current filter capabilities in Insight. That done, the rest should be easy going.

For Scheduling (#1) I think we will go ahead and use quartz (http://www.opensymphony.com/quartz/) scheduler. Some of us have already seen it in action. But, we will have some work there implementing a new Job Store which can read schedules from the Insight Preferences, and also we have to see the way to implement it. ANY VOLUNTEERS FOR THIS?

Now to the problem at hand: #2. There are a few approaches that I have identified so far to have the daemon implementation. I have not done any detailed analysis on this yet, but it promises to be a lot of exciting work! Again, help is always welcome!
The way to go on this is getting to be very OS specific, the daemon has to run as a 'daemon' on *nix platforms and as a 'service' on Windows platforms. Unfortunately, the language modification that would have let Java applications run as daemons (JSR 96
- http://www.jcp.org/en/jsr/detail?id=96\) has been withdrawn.

I am listing the libraries I have identified so far:
1. Jakarta Commons Daemon
2. Apache Portable Runtime Project - APR
3. Java Service Wrapper (http://wrapper.tanukisoftware.org/doc/e
4. The Process class of JRE

I have not started looking in detail into any of these, and hope to do that this week, but again, the intent of this thread is to get more people involved in this process and also to start a discussion on this. So, please send in your remarks!

Bindul Bhowmik
MindTree Consulting Pvt. Ltd.

Date: 2005-11-28 17:09
Sender: Bindul Bhowmik


As first step to getting Insight out as a daemon, I have completed the implementation to have the preferences come up separately outside the Insight container.

Apart from this, there have been some associated changes in Insight:
- com.mindtree.insight.gui.Insight no longer has a main method.
- The main entry point of the application is now
com.mindtree.insight.Insight. This is a new class, and can read command line arguments. Without any arguments, it will bring up the Insight UI, with a parameter '-p' it will bring up the preferences dialog. For help pass in the command line argument - '-h'.
- Setting the look and feel and INSIGHT_HOME variable has been moved out of the old gui.Insight class to the new class, as these would be common functionality used by multiple invocations of Insight.
- A new class ShutdownHookManager has been introduced to handle shutdown events. Any class can register events to be executed on shutdown with the ShutdownHookManager, and it will execute the tasks. This has been extracted with the old gui.Insight class
because this functionality will be required by invocations other than the normal GUI 'avtar'.

Work still pending on this front:
- Update the build scripts to possibly generate multiple executables.
- Update the batch files, to point to the new location.
- Anything else?

Please review the code uploaded as a patch at . I will commit the code after your feedback.


Bindul Bhowmik
MindTree Consulting Pvt. Ltd.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks