Iptotal - Missing Archives ?

Support section for FREESCO v0.3.x 3rd Party Packages

Postby bob selby » Sat Mar 22, 2008 7:42 am

I've been running IPTotal for a few days now and have noticed that archives are not always made.

Is this because the archive script is run at midnight ?? because it is possible that the firewall was shutdown at midnight on those days.

Is it possible to retrospectively generate an archive snapshot the next time the box is powered up?? If so - how??

Or does the database only hold data for 24 hours??

TIA
Bob
bob selby
Advanced Member
 
Posts: 302
Joined: Wed Nov 21, 2001 8:18 am
Location: London, UK

Postby dingetje » Sat Mar 22, 2008 10:30 am

The iptotal archives are created around midnight by the /usr/local/iptotal/bin/iptotald script (yes, that's right the iptotal daemon is a script!) by the do_archive function.

Basically it generates a PNG image of the current RRD database by calling the archive.sh script just before midnight. The code that actually does that is:

Code: Select all
rrdtool graph $1 \
    --title "Total data throughput ($2)" \
    --imgformat PNG \
    --width 600 \
    --height 150 \
    --end 'now-60s' \
    --start 'end-24h' \
    DEF:in=/usr/local/iptotal/dbase/iptotal.rrd:input:AVERAGE \
    DEF:out=/usr/local/iptotal/dbase/iptotal.rrd:output:AVERAGE \
    DEF:maxin=/usr/local/iptotal/dbase/iptotal.rrd:input:MAX \
    DEF:maxout=/usr/local/iptotal/dbase/iptotal.rrd:output:MAX \
    AREA:in#009828:"In kByte/s" \
    LINE2:out#ff0000:"Out kByte/s" \
    LINE2:maxin#0030ff:"Max In" \
    LINE2:maxout#ff8040:"Max Out"


Where $1 is replaced with the archive PNG file name and $2 with the current date.
As you can see it uses a 'hard coded' end based on 'now'. So in order to generate a snapshot image at a later time you need to provide the correct and end time in an 'rrdtool graph' command from the command line (or better yet, copy/paste the above code in a temp shell script and edit the --end time stamp).

The iptotal database hold aprox. one year of data if my (fading) memory serves me right ;)

HTH
GreetZ
http://dingetje.hopto.org

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1010
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Postby bob selby » Sun Mar 23, 2008 7:53 am

Many thanks :-)
bob selby
Advanced Member
 
Posts: 302
Joined: Wed Nov 21, 2001 8:18 am
Location: London, UK

Postby bob selby » Mon Mar 24, 2008 2:24 pm

Dingetje - I got that working :-) I now have a script that gets run just after startup that checks to see if an archive exists for the previous day and if not then creates one --- works a treat :-)

Is it possible to extract a total number of bytes downloaded in a given 24 hour period?? and perhaps add that into the picture generated?? or append to a separate report file??

I'm sure RRD is a doddle when you are used to it but it has me scratching my head :-)

Bob
bob selby
Advanced Member
 
Posts: 302
Joined: Wed Nov 21, 2001 8:18 am
Location: London, UK

Postby bob selby » Wed Apr 16, 2008 2:11 pm

Does the IPTotal package not support the "TOTAL" "consolidation function"??

I've been playing about with RDDTOOL but this function doesnt seem to be supported :-(

Is there a later version of the package ??

TIA
Bob
bob selby
Advanced Member
 
Posts: 302
Joined: Wed Nov 21, 2001 8:18 am
Location: London, UK

Postby dingetje » Wed Apr 16, 2008 5:10 pm

No and No, sorry.

This is actually a FAQ about the package. Shouldn't be too hard to add something like that now you've played with RRDTOOL a lot ;)

You probably need to add another data member to the initial RRD database, created in iptotald when not found.

IPTOTAL is really a very simple package (one of my first), the actual measurement is a simple package sniffer (iptotal binary) that measures for a certain period and then outputs bytes in and bytes out. The rest is implemented with scripting.

Actually when I would redesign the package with what I know now, I'd write a daemon process and run the measurement in a separate thread. Now (on a very very busy network) you risk loosing some bytes during each measurement cycle.

I have currently no plans to work on that package, but its open source and GPL-ed, so feel free to have a go at it.
GreetZ
http://dingetje.hopto.org

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1010
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands


Return to 3rd Party Package Support for FREESCO v0.3.x

Who is online

Users browsing this forum: No registered users and 2 guests

cron