<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>&nbsp;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&#8217;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'>&lt;?</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'>&quot;c:\\inetpub\\wwwroot\\rrds&quot;</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'>&quot;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:\&quot; Current\: %%5.2lf %%Sbps\&quot; <br>
GPRINT:inbits:MAX:\&quot; Maximum\: %%5.2lf %%Sbps \&quot;<br>
GPRINT:inbits:AVERAGE:\&quot; Average\: %%5.2lf %%Sbps\&quot;<br>
LINE1:outoctets#990000:Out_traffic<br>
GPRINT:outbits:MAX:\&quot;Maximal\: %%5.2lf %%Sbps\&quot; <br>
GPRINT:outbits:AVERAGE:\&quot;Average\: %%5.2lf %%Sbps\&quot; <br>
GPRINT:outbits:LAST:\&quot;Current\: %%5.2lf %%Sbps\&quot;&quot;</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'>&quot;10.1.142.1_1.rrd&quot;</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'>&quot;c:\\gifday.png&quot;</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'>&quot;c:</span></font><font color=navy><span
style='color:navy'>\</span></font><font color=green><span style='color:green'>\gifweek.png&quot;</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'>&quot;c:\\gifmonth.png&quot;</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'>&quot;c:\\gifyear.png&quot;</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'>&quot;-1d&quot;</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'>&quot;-1w&quot;</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'>&quot;-1m&quot;</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'>&quot;-1y&quot;</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'>&quot;</span></font>&lt;p
align='center'&gt;&lt;font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'&gt;&lt;b&gt;<font color=green><span
style='color:green'>Daily graph</span></font>&lt;/b&gt;&lt;/font&gt;<font
color=green><span style='color:green'>&quot;</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>&quot;</span></font>&lt;center&gt;<font
color=maroon><span style='color:maroon'>&lt;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&gt;</span></font>&lt;/center&gt;&lt;p&gt;<font
color=green><span style='color:green'>&quot;</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'>&quot;</span></font>&lt;p
align='center'&gt;&lt;font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'&gt;&lt;b&gt;<font color=green><span
style='color:green'>Weekly graph</span></font>&lt;/b&gt;&lt;/font&gt;<font
color=green><span style='color:green'>&quot;</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>&quot;</span></font>&lt;center&gt;<font
color=maroon><span style='color:maroon'>&lt;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&gt;</span></font>&lt;/center&gt;&lt;p&gt;<font
color=green><span style='color:green'>&quot;</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'>&quot;</span></font>&lt;p
align='center'&gt;&lt;font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'&gt;&lt;b&gt;<font color=green><span
style='color:green'>Monthly graph</span></font>&lt;/b&gt;&lt;/font&gt;<font
color=green><span style='color:green'>&quot;</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>&quot;</span></font>&lt;center&gt;<font
color=maroon><span style='color:maroon'>&lt;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&gt;</span></font>&lt;/center&gt;&lt;p&gt;<font
color=green><span style='color:green'>&quot;</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'>&quot;</span></font>&lt;p
align='center'&gt;&lt;font face='verdana' size='<font color="#0000f0"><span
style='color:#0000F0'>2</span></font>'&gt;&lt;b&gt;<font color=green><span
style='color:green'>Yearly graph</span></font>&lt;/b&gt;&lt;/font&gt;<font
color=green><span style='color:green'>&quot;</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
echo <font color=green><span style='color:green'>&quot;</span></font>&lt;center&gt;<font
color=maroon><span style='color:maroon'>&lt;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&gt;</span></font>&lt;/center&gt;&lt;p&gt;<font
color=green><span style='color:green'>&quot;</span></font><b><span
style='font-weight:bold'>;</span></b> <br>
<br>
<br>
<b><span style='font-weight:bold'>?</span></b>&gt;<o:p></o:p></span></font></p>

</div>

</body>

</html>