[rrd-users] rrd graph problem - flat areas only visible, no skew areas

Monjurul Hasan monjurul.hasan at mango.com.bd
Sat Jun 14 06:50:55 CEST 2008


Hi,
        
        I have tried this php code to create rrd graph from mrtg rrd
        file(which is created from log file by mrtg itself).I have found
        the weekly graph but there is only flat areas,no skew part is
        there(no curved part is present which is present in original
        graph) .
         
        My daily graph shows blank.I think that this is for same
        prblem ,
        because in original graph there is only skewed curve areas.
        
        anyone has idea about it? Please help me.
        
         
        Thanks,
        hasan
        
        
        //////////////********source code***********////////////////
        
        <?php
            
          $opts = array( "--start",
        "-1w","--x-grid","HOUR:8:DAY:1:DAY:1:0:%
        A","--alt-y-grid",
                         "--vertical-label=B/s",
                         "--alt-y-mrtg","--alt-autoscale-max",
                         "--rigid","--title=weekly graph",
                         "DEF:inoctets=rra/appsrv1.rrd:ds0:AVERAGE",
                         "DEF:outoctets=rra/appsrv1.rrd:ds1:AVERAGE",
                         "AREA:inoctets#00FF00:In traffic",
                         "LINE1:outoctets#0000FF:Out traffic\\r",
                         "CDEF:inbits=inoctets,8,*",
                         "CDEF:outbits=outoctets,8,*",
                         "COMMENT:\\n",
                         "GPRINT:inbits:AVERAGE:Avg In traffic\: %6.2lf
        %Sbps",
                         "COMMENT:  ",
                         "GPRINT:inbits:MAX:Max In traffic\: %6.2lf %
        Sbps\\r",
                         "GPRINT:outbits:AVERAGE:Avg Out traffic\: %
        6.2lf %
        Sbps",
                         "COMMENT: ",
                         "GPRINT:outbits:MAX:Max Out traffic\: %6.2lf %
        Sbps\\r"
                       );
        
          $ret = rrd_graph("images/appsrv1.jpg", $opts, count($opts));
            echo "ok";
          if( !is_array($ret) )
          {
            $err = rrd_error();
            echo "rrd_graph() ERROR: $err\n";
          }
        ?>
        




More information about the rrd-users mailing list