Update of /export/home/ntop/ntop/plugins
In directory jabber:/tmp/cvs-serv7026/plugins

Modified Files:
        icmpPlugin.c rrdPlugin.c 
Log Message:

This patch is cleanup to rrd and the collateral damage from it.

1. Cleaned up debug, with the usual flag, RRD_DEBUG, in ntop.h with
   all the others.

2. Added a new constant, SHOW_NTOP_HEARTBEAT, to control the output of various
   time-interval log messages.  Right now it's only affecting RRD, but I will
   take the same constant and put it in the other appropriate places.

   The default is OFF.  If it's enabled (via a #define in ntop.h), then every
   cycle of the timed processes (idle purge, rrd, etc.), a start and stop
   message with some minimal statistics will be logged.  E.g.:

     RRD: %lu RRDs updated (%lu total updates)

3. Adds rrdPath to myGlobals, vs. using myGlobals.dbPath.  This value is picked
   up from the plugin's web configuration page and stored in the persistent
   values. It was displayed, this change makes "rrdPath" on the plugin menu
   into an editable field.

   Logic is present to initialize myGlobals.rrdPath from myGlobals.dbPath/rrd
   as a last resort (i.e. the 1st run of ntop, when nothing is found in the
   persistent values in the database).  Thus rrd will behave today as it did
   yesterday.

   Accordingly, I removed the hard coded dbPath + "rrd" logic.

4. Added logic to automatically create the subdirectories of "rrd" during
   PLUGIN startup if they don't already exist.  This way, you can use inactive
   setup to define the directory and then they'll automatically be created
   with the proper permissions. (I use mode 0700 - ntop user ONLY).

   Note that the ntop -u user must still have read/write/execute access to
   the BASE directory you defined via the plugin.

   If create fails, messages will be logged.  If create works, messages
   will be logged.

5. Fixed the timing so that we don't miss intervals.  The change is to make
   the expiration of the 1st interval at +15s and then every other one at
   300s after the prior one, regardless of how long it actually takes to
   output the counters.  Recompute the sleep constant as end-of-interval
   minus NOW just before the sleep, vs. before we do all the work.

   Remember, the 1st one is a throw-away -- we define a -10s value of NaN
   (not a number).  This way, we throw-away less data (15s vs 300s).

6. The interval is (correctly) picked up from the web configuration page
   and used in all the relevant places (I'm 99.94% sure).  The #define
   of 300 in ntop.h is the default if nothing is set yet.

7. Enhanced naming of graphics files to include the ip address they refer
   to.  This is prep for #8, below.

8. Added --reuse-rrd-graphics option.  When we're asked to display a graphic,
   we check the last modified time for an on-disk file (if one exists).  If
   it was created AFTER the expiration of the prior interval and before the
   next interval should have expired, then no rrd data will have changed and
   we can reuse it.

   This required a change to sendGraphFile() to add a doNotUnlink parameter.
   This was the most extensive change to files outside of plugins/rrdPlugin.c

9. Added a periodic purge (every 5th interval of the rrd loop).  This will
   scan the rrd graphics directory and delete any file which is older than
   the last rrd update.

-----Burton (ref 157)

Thanks to Tony Nelson ([EMAIL PROTECTED]) for providing preliminary
patches, design ideas, development resources and testing for this patch.



_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to