<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<title>[rrd-users] Correct CDEF to get the spam count right?</title>
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>Hi,<br>
<br>
I'm trying to generate my own graphs<font color=navy><span style='color:navy'> by
</span></font> using php, but I get nothing<font color=navy><span
style='color:navy'> generated</span></font>. can anyone shed a light. Here goe
the code. <font color=navy><span style='color:navy'>I’M Using Windows
IIS.</span></font><o:p></o:p></span></font></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Luis Alegria<o:p></o:p></span></font></p>
<p><font size=2 color=red face="Times New Roman"><span style='font-size:10.0pt;
color:red'><?</span></font><font size=2><span style='font-size:10.0pt'> <br>
<br>
<b><font color="#0000f0"><span style='color:#0000F0;font-weight:bold'>function</span></font></b>
gambar<b><span style='font-weight:bold'>($gif,$rrd,$start)</span></b> <br>
<b><span style='font-weight:bold'>{</span></b> <br>
<br>
<br>
<b><span style='font-weight:bold'>$path_rrdbase_dir</span></b> <b><span
style='font-weight:bold'>=</span></b> <font color=green><span style='color:
green'>"c:\\inetpub\\wwwroot\\rrds"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<br>
<b><span style='font-weight:bold'>$command=</span></b><font color=green><span
style='color:green'>"c:\\rrdtool\\rrdtool.exe graph test.png -s -6h -a PNG
-A -M -L 4 -z -E -N -F --base=1000<br>
-w 600 -h 250 <br>
DEF:inoctets=/inetpub/wwwroot/rrds/x.x.x.x.rrd:ds0:AVERAGE <br>
DEF:outoctets=/inetpub/wwwroot/rrds/x.x.x.x.rrd:ds1:AVERAGE <br>
TICK:inoctets#ffffa0:1.0: <br>
TICK:outoctets#ffffa0:1.0: <br>
LINE1:inoctets#0000FF:In_traffic CDEF:inbits=inoctets,8,*
CDEF:outbits=outoctets,8,* <br>
GPRINT:inbits:LAST:\" Current\: %%5.2lf %%Sbps\" <br>
GPRINT:inbits:MAX:\" Maximum\: %%5.2lf %%Sbps \"<br>
GPRINT:inbits:AVERAGE:\" Average\: %%5.2lf %%Sbps\"<br>
LINE1:outoctets#990000:Out_traffic<br>
GPRINT:outbits:MAX:\"Maximal\: %%5.2lf %%Sbps\" <br>
GPRINT:outbits:AVERAGE:\"Average\: %%5.2lf %%Sbps\" <br>
GPRINT:outbits:LAST:\"Current\: %%5.2lf %%Sbps\""</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
exec<b><span style='font-weight:bold'>($command);</span></b><br>
<br>
<b><font color="#0000f0"><span style='color:#0000F0;font-weight:bold'>return</span></font></b>
<b><span style='font-weight:bold'>$gif;</span></b><br>
<b><span style='font-weight:bold'>}</span></b> <br>
<br>
<font color=green><span style='color:green'>/////////////////////////////////////////////////////////<br>
////////////////////MAIN PROGRAM/////////////////////////<br>
/////////////////////////////////////////////////////////<br>
</span></font>error_reporting<b><span style='font-weight:bold'>(</span></b>E_ALL<b><span
style='font-weight:bold'>);</span></b><br>
<br>
<br>
<b><span style='font-weight:bold'>$rrdname=</span></b><font color=green><span
style='color:green'>"10.1.142.1_1.rrd"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$daygraph=</span></b><font color=green><span
style='color:green'>"c:\\gifday.png"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$weekgraph=</span></b><font color=green><span
style='color:green'>"c:</span></font><font color=navy><span
style='color:navy'>\</span></font><font color=green><span style='color:green'>\gifweek.png"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$monthgraph=</span></b><font color=green><span
style='color:green'>"c:\\gifmonth.png"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$yeargraph=</span></b><font color=green><span
style='color:green'>"c:\\gifyear.png"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<br>
<font color=green><span style='color:green'>/* I don't suggest you to modify
listing code below. */</span></font> <br>
<b><span style='font-weight:bold'>$daystart=</span></b> <font color=green><span
style='color:green'>"-1d"</span></font><b><span style='font-weight:
bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$weekstart=</span></b><font color=green><span
style='color:green'>"-1w"</span></font><b><span style='font-weight:
bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$monthstart=</span></b><font color=green><span
style='color:green'>"-1m"</span></font><b><span style='font-weight:
bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$yearstart=</span></b><font color=green><span
style='color:green'>"-1y"</span></font><b><span style='font-weight:
bold'>;</span></b> <br>
<br>
<b><span style='font-weight:bold'>$daygraph=</span></b>gambar<b><span
style='font-weight:bold'>($daygraph,</span></b> <b><span style='font-weight:
bold'>$rrdname,</span></b> <b><span style='font-weight:bold'>$daystart);</span></b>
<br>
echo <font color=green><span style='color:green'>"</span></font><p
align='center'><font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'><b><font color=green><span
style='color:green'>Daily graph</span></font></b></font><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>"</span></font><center><font
color=maroon><span style='color:maroon'><img</span></font> <font
color=maroon><span style='color:maroon'>src</span></font>=<font color=maroon><span
style='color:maroon'>images</span></font>/$<font color=maroon><span
style='color:maroon'>daygraph></span></font></center><p><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$weekgraph=</span></b>gambar<b><span
style='font-weight:bold'>($weekgraph,</span></b> <b><span style='font-weight:
bold'>$rrdname,</span></b> <b><span style='font-weight:bold'>$weekstart);</span></b>
<br>
echo <font color=green><span style='color:green'>"</span></font><p
align='center'><font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'><b><font color=green><span
style='color:green'>Weekly graph</span></font></b></font><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>"</span></font><center><font
color=maroon><span style='color:maroon'><img</span></font> <font
color=maroon><span style='color:maroon'>src</span></font>=<font color=maroon><span
style='color:maroon'>images</span></font>/$<font color=maroon><span
style='color:maroon'>weekgraph></span></font></center><p><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$monthgraph=</span></b>gambar<b><span
style='font-weight:bold'>($monthgraph,</span></b> <b><span style='font-weight:
bold'>$rrdname,</span></b> <b><span style='font-weight:bold'>$monthstart);</span></b>
<br>
echo <font color=green><span style='color:green'>"</span></font><p
align='center'><font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'><b><font color=green><span
style='color:green'>Monthly graph</span></font></b></font><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>"</span></font><center><font
color=maroon><span style='color:maroon'><img</span></font> <font
color=maroon><span style='color:maroon'>src</span></font>=<font color=maroon><span
style='color:maroon'>images</span></font>/$<font color=maroon><span
style='color:maroon'>monthgraph></span></font></center><p><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<b><span style='font-weight:bold'>$yeargraph=</span></b>gambar<b><span
style='font-weight:bold'>($yeargraph,$rrdname,$yearstart);</span></b> <br>
echo <font color=green><span style='color:green'>"</span></font><p
align='center'><font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'><b><font color=green><span
style='color:green'>Yearly graph</span></font></b></font><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>"</span></font><center><font
color=maroon><span style='color:maroon'><img</span></font> <font
color=maroon><span style='color:maroon'>src</span></font>=<font color=maroon><span
style='color:maroon'>images</span></font>/$<font color=maroon><span
style='color:maroon'>yeargraph></span></font></center><p><font
color=green><span style='color:green'>"</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<br>
<br>
<b><span style='font-weight:bold'>?</span></b>><o:p></o:p></span></font></p>
</div>
</body>
</html>