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

Modified Files:
        ntop.h globals-core.h globals.h webInterface.c util.c main.c 
        ntop.8 ntop.txt ntop.html 
Log Message:

Add the ability to specify ntop parameters via a file, e.g.:

    /usr/bin/ntop ... @filename ...

The text of 'filename', is copied - ignoring line breaks and 
comments (anything following a #) - into the command line.

ntop behaves as if all of the text had simply been typed directly 
on the command line.  Multiple @s are permitted in the command 
line, nesting is not (@s in the file will cause an error).

Both are displayed on the info.html report, the "Started as"
shows the actual command line ntop was given and the 
"Resolved to" shows what ntop processed, for example:

Started as /usr/bin/ntop -i eth0,eth1 @/root/ntop_parms -d -L

with /root/ntop_parms containing:

-p /usr/share/ntop/protocol.list 
-P /usr/share/ntop 
--throughput-bar-chart 
-w 192.168.42.38:3000 
# -W 192.168.42.38:3001 
-u ntop 
--trace-level 3 
-m 12.239.0.0/16,10.113.0.0/16 
-E 
-K 
--reuse-rrd-graphics 

becomes:

Resolved to /usr/bin/ntop -i eth0,eth1 -p /usr/share/ntop/protocol.list 
            -P /usr/share/ntop --throughput-bar-chart -w 192.168.42.38 
            -u ntop --trace-level 3 -m 12.239.0.0/16,10.113.0.0/16 -E 
            -K --reuse-rrd-graphics -d -L 

Remember, most ntop options are "sticky", that is they just set an
internal flag. Invoking them multiple times doesn't change ntop's
behavior. However, options that set a value, such as --trace-level, 
will use the LAST value given: --trace-level 2 --trace-level 3 will 
run as --trace-level 3.

It is recommended that you use FULL pathnames for @filename, since
ntop may have different effective directories when run in different
ways.  However, you may wish to use relative pathnames to take
advantage of the different effective directories (say cron vs.
command line).  Just know where you're starting from.

Also, added a FATAL ERROR if there are unprocessed command line parameters.
This should trap the common errors, specifically 
     --use-syslog facility         (missing =s) 
and
     -B net 10.0.0.0/24            (should be in "s)

Technical notes:

Functions buildargv and freeargv were copied from Gnu's gcc libiberty and
are active (in util.c) if the glibc versions don't exist.

myGlobals.startedAs added to hold the ORIGINAL command line.  myGlobals.argv
and myGlobals.argc now hold the effective command line (after @ processing).
Both are reported in info.html and textinfo.html.

PARAM_DEBUG added to ntop.h - shows the processing of the command line
parameters, especially @filename.

Tweaked the --use-syslog and --set-admin-password messages to remind the
user if s/he should have specified the =.


-----Burton (ref 160)



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

Reply via email to