[root]# cat traffic-24hr-small.cgi #!/usr/bin/perl #環境変数セット # my $rrddir="/usr/local/HotSaNIC/modules/traffic/rrd"; my $rrdbin="/usr/local/rrdtool/bin/rrdtool"; print "Content-type: image/png\n\n"; # <== 後書き1 #graph出力 # system "$rrdbin", "graph", "-", "--imgformat","PNG", "-o", "-w","150","-h","50", "-s -86400", "-x","HOUR:6:HOUR:6:HOUR:6:0:%H", "-y","none", "-c","BACK#000000", "-c","GRID#101010", "-c","MGRID#101010", "-c","CANVAS#222222", "-c","SHADEA#222222", "-c","SHADEB#222222", "-c","FRAME#101010", "-c","FONT#FFFFFF", "-c","ARROW#000000", "DEF:dbavgout=$rrddir/ppp0.rrd:out:AVERAGE", "CDEF:avgout=dbavgout,8,*", "CDEF:totout=avgout,10800,*", "LINE1:avgout#FF0000:", "GPRINT:totout:AVERAGE: %2.2lf %sbyte out/24hr"; |
[root]# cat traffic-graph-day.sh #!/bin/bash # #環境変数セット # rrddir="/usr/local/HotSaNIC/modules/traffic/rrd" rrdbin="/usr/local/rrdtool/bin/rrdtool" websensor="/home/localhost/HotSaNIC/" #graph出力 # $rrdbin graph $websensor/traffic-total-day.png \ --imgformat PNG \ -o \ -w 150 -h 50 \ -s -86400 \ -x HOUR:6:HOUR:6:HOUR:6:0:%H \ -y none \ -c BACK#000000 \ -c GRID#101010 \ -c MGRID#101010 \ -c CANVAS#222222 \ -c SHADEA#222222 \ -c SHADEB#222222 \ -c FRAME#101010 \ -c FONT#FFFFFF \ -c ARROW#000000 \ DEF:dbavgout=$rrddir/ppp0.rrd:out:AVERAGE \ CDEF:avgout=dbavgout,8,* \ CDEF:totout=avgout,10800,* \ LINE1:avgout#FF0000: \ GPRINT:totout:AVERAGE:" %2.2lf %sbyte out/24hr" |
[Sat Aug 14 15:11:50 2004] [error] [client xxx.xxx.xxx.xxx] malformed header from script. Bad header=230x105: traffic-24hr-small.cgi, referer: http://miya0.dyndns.org/douga/index.html |