From: Boniforti F. <fl...@pi...> - 2009-11-20 08:47:35
|
Hello everybody. I'm pretty new at gnuplot, but I already achieved my first result... (see: http://yfrog.com/j8polti200911p ) Now, what I'm doing is to grab every night the total amount of traffic being sent/received via SSH between my server and a couple of different remote hosts. I achieved this via iptables, but I don't want to bother you all... The result of this data collection is like: 2009-11-16 4296994550 155016994 2009-11-17 6458167774 228657538 2009-11-18 8776045950 424622670 The columns represent date, bytes received, bytes sent. I now would like to schedule a daily update of the graph you can see at the above URL, but also: A) the graph should be generated *new* when the actual month is over (I'd like to have different PNGs for each month); B) it should be schedulable, but I don't know how to put or pass variables to the plot script Here the plot script I'm using: set term png set output 'polti-2009-11.png' set timestamp 'Ultimo aggiornamento: %d.%m.%Y' top set xdata time set timefmt '%Y-%m-%d' set xrange ['2009-11-01':'2009-11-30'] set xlabel 'Data' set format x '%d.%m' set ylabel 'Bytes' set format y '%.0s %cb' set title 'Traffico' set key off set boxwidth 0.8 relative set style fill solid 1.0 plot '2009-11-213.200.254.141.dat' using 1:2 with boxes fs solid,\ '2009-11-213.200.254.141.dat' using 1:3 with boxes fs solid Any help will be appreciated, thanks in advance! Flavio Boniforti PIRAMIDE INFORMATICA SAGL Via Ballerini 21 6600 Locarno Switzerland Phone: +41 91 751 68 81 Fax: +41 91 751 69 14 URL: http://www.piramide.ch E-mail: fl...@pi... |
From: Hans-Bernhard B. <HBB...@t-...> - 2009-11-21 22:33:40
|
Boniforti Flavio wrote: > A) the graph should be generated *new* when the actual month is over > (I'd like to have different PNGs for each month); That's mainly between you and your data generation scripts to handle. > B) it should be schedulable, but I don't know how to put or pass > variables to the plot script There are several approaches. The basic choice is between parametrizing a canned gnuplot script from the outside using environment variables (`echo $VARIABLE` style), and modifying the script on the fly (HERE script or piping individual commands from another scripting language to gnuplot). |
From: Boniforti F. <fl...@pi...> - 2009-11-23 10:29:07
|
Hallo Hans-Bernhard, > > A) the graph should be generated *new* when the actual > month is over > > (I'd like to have different PNGs for each month); > > That's mainly between you and your data generation scripts to handle. OK, I'll go for it after I have my gnuplot script working... > > B) it should be schedulable, but I don't know how to put or pass > > variables to the plot script > > There are several approaches. The basic choice is between > parametrizing > a canned gnuplot script from the outside using environment > variables (`echo $VARIABLE` style), and modifying the script > on the fly (HERE script or piping individual commands from > another scripting language to gnuplot). Well, actually I have played a bit with setting variables inside gnuplot and trying to concatenate them. I succeeded in concatenating *string* variables: gnuplot> VAR='polti'.'-'.`date +%Y` gnuplot> print VAR polti-2009 gnuplot> VAR=VAR.'-'.`date +%m` gnuplot> print VAR polti-2009-11 I think playing with these sort of variable definitions, also will lead me to success... What do you think of this? Thanks, Flavio Boniforti PIRAMIDE INFORMATICA SAGL Via Ballerini 21 6600 Locarno Switzerland Phone: +41 91 751 68 81 Fax: +41 91 751 69 14 URL: http://www.piramide.ch E-mail: fl...@pi... |