<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Targetmaker creating lots of entries in options_table</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Good afternoon,</FONT>

<BR><FONT SIZE=2 FACE="Arial">I recently found an oddity that I am hard pressed to explain. I have been porting the targetmaker.php found on Google Code to use the new rtgplot executable ($newrtgplot = 1). To my surprise, I got a hundred or so graphs for the same data. A little further investigation showed the options_table seems to have multiple entries for the same graph options:</FONT></P>

<P><FONT SIZE=2 FACE="Arial">mysql&gt; select * from options_table where class=&quot;cpu&quot;;</FONT>

<BR><FONT SIZE=2 FACE="Arial">+-------------------+---------------------------------------+-------+</FONT>

<BR><FONT SIZE=2 FACE="Arial">| graphname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | class |</FONT>

<BR><FONT SIZE=2 FACE="Arial">+-------------------+---------------------------------------+-------+</FONT>

<BR><FONT SIZE=2 FACE="Arial">| Bluecoat-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | scaley=on gauge=on units=%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| CISCOSNMP-cpu&nbsp;&nbsp;&nbsp;&nbsp; | gauge=on units=%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| CPQSNMP-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | gauge=on units=% scaley=on borderb=90 | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| ExtremeSNMP-cpu&nbsp;&nbsp; | scaley=on gauge=on units=CPU%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| HOSTRESOURCES-cpu | gauge=on units=% scaley=on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| NetApp-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | gauge=on units=CPU%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| NetSNMP-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | scaley=on gauge=on units=CPU%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| SNMPInformant-cpu | gauge=on units=% scaley=on borderb=90 | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| Bluecoat-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | scaley=on gauge=on units=%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| CISCOSNMP-cpu&nbsp;&nbsp;&nbsp;&nbsp; | gauge=on units=%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| CPQSNMP-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | gauge=on units=% scaley=on borderb=90 | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| ExtremeSNMP-cpu&nbsp;&nbsp; | scaley=on gauge=on units=CPU%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| HOSTRESOURCES-cpu | gauge=on units=% scaley=on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| NetApp-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | gauge=on units=CPU%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| NetSNMP-cpu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | scaley=on gauge=on units=CPU%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">| SNMPInformant-cpu | gauge=on units=% scaley=on borderb=90 | cpu&nbsp;&nbsp; |</FONT>

<BR><FONT SIZE=2 FACE="Arial">&#8230;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">A closer look at targetmaker shows:</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unless ( $#row == 0 ) {</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql = &quot;INSERT INTO options_table VALUES ('$graph','@{$table_options{$graph}}','$table_class{$graph}')&quot;;</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;sql_insert($sql);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($row[1] ne join(@{$table_options{$graph}}) || $row[2] ne $table_class{$graph}) {</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql = &quot;UPDATE options_table SET options='&quot;.join(&quot; &quot;,@{$table_options{$graph}}).&quot;',class='$table_class{$graph}' WHERE graphname='$graph'&quot;;</FONT></P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;sql_insert($sql);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Shouldn't that &quot;unless&quot; be an &quot;if&quot;? If so, I'm left with the challenge that my table_options has many, many duplicate entries (one for each targetmaker run). Cleanup is my next challenge.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Anyone else care to comment?</FONT>

<BR><FONT SIZE=2 FACE="Arial">Thanks,</FONT>

<BR><FONT SIZE=2 FACE="Arial">Mark</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Mark Quigley</FONT>

<BR><FONT SIZE=2 FACE="Arial">Network Planning Analyst, IRM Data Communications</FONT>

<BR><FONT SIZE=2 FACE="Arial">(509) 252-6728 desk</FONT>

<BR><FONT SIZE=2 FACE="Arial">(509) 768-5845 cell</FONT>

<BR><A HREF="http://www.inhs.org/"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://www.inhs.org/</FONT></U></A>
</P>

</BODY>
</HTML>