<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>/derive does essentially take the "difference" of 2 consecutive "bins" - say 5 minute intervals - and if the value is way off (>2^31) , then it assumes it is a wraparound and "corrects" for that.</div><div><br></div><div>as for SNMP V2: you need to use a different OID to get the corresponding 64 bit values - really: look on the internet to get those OID numbers in question.</div><div>(a quick look shows: <span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">snmpget -v 2c -c public 14.32.5.18 ifHCInOctets.1 could do the trick for you - maybe you need to modify it for your needs)</span></div><div><br></div><div>Martin</div><br><div><div>On 15.05.2013, at 17:34, Shabbir Ahmed wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div>thanks for your email, before ur msg i tried my self /derive and the graphs are normal. kindly look at attachment.<br><br></div>actually i fetch data from switches and i have tried option -v 2c but the result is same, 32 bit counter. can u explain it to me wat derive does and i dont have to worry about other thigns like calculating data etc my self, if you dont mind.<br>
<br></div>can u also look at my graph generating cmd to verify if im not doing any thing wrong,<br><br>rrdtool graph test.png --imgformat=PNG --start=-2day --end=-1day -S=300 "DEF:up=$UP:min:AVERAGE" "DEF:down=$DOWN:min:AVERAGE" AREA:down#2ECCFA:"Out traffic" AREA:up#013ADF:"Download" --vertical-label=bytes/sec --title="ADSL bandwidth graphs" GPRINT:up:LAST:"Current\:%8.2lf %s\n" GPRINT:up:AVERAGE:"Average\:%8.2lf %s\n" GPRINT:up:MAX:"Maximum\:%8.2lf %s\n" --font TITLE:12: --font AXIS:8: --font LEGEND:10: --font UNIT:8: AREA:up#013ADF:"In traffic"<br>
<br><br></div>I am sorry if im teasing you,<br></div>Shabbir.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 15, 2013 at 7:36 PM, Martin Sperl <span dir="ltr"><<a href="mailto:rrdtool@martin.sperl.org" target="_blank">rrdtool@martin.sperl.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>so you are using the 32bit counter.</div><div><br></div><div>Then if you insert into the database, you:</div>
<div>either have to do the "wraparound" logic yourself prior to inserting the values</div><div>or you insert the "absolute" counter values and use /derive (as explained before)</div><div>if you use the rrd flatfile database via rrdcreate and update, then (depending on the definition of the rrd-file) rrd will try to do the "overflow" detection...</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>Martin</div></font></span><div><br></div><div>P.s: the 64bit counter are typically only available if you use snmp V2C - google for "64 bit counter SNMP" and you should find enough information on how to use it.</div>
<div><div class="h5"><div><br></div><br><div><div>On 15.05.2013, at 10:07, Shabbir Ahmed wrote:</div><br><blockquote type="cite"><div dir="ltr"><div>quering the device snmpbulkget -c public <a href="tel:119.156.203.217" value="+19156203217" target="_blank">119.156.203.217</a> .<a href="tel:1.3.6.1.2.1.2.2.1.10" value="+13612122110" target="_blank">1.3.6.1.2.1.2.2.1.10</a> -v 2c<br>
returns 32bit integers<br>IF-MIB::ifInOctets.20971520 = Counter32: 0<br>IF-MIB::ifInOctets.20972032 = Counter32: 0<br>
IF-MIB::ifInOctets.20972544 = Counter32: 1295822366<br>IF-MIB::ifInOctets.20973056 = Counter32: 1295822366<br>IF-MIB::ifInOctets.20973568 = Counter32: 1295822366<br>IF-MIB::ifInOctets.20974080 = Counter32: 1295822366<br>
<br>
<br>2nd question is most of the values are always same is it the reason port is down?<br><br></div><div>3rd question what if counter reaches its up limit and starts from 0 again, how rrd tool manages it? or should we have to manage our self?<br>
<br>kindly help further with this issue.<br><br>thanks,<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 15, 2013 at 11:53 AM, Martin Sperl <span dir="ltr"><<a href="mailto:rrdtool@martin.sperl.org" target="_blank">rrdtool@martin.sperl.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Seems as if you are having "integer overflow" issues reading the 32bit SNMP values (or when calculating the delta of the counters in your program).<div>
<br></div><div>These rollovers is something your application will need to figure out prior to inserting into the database - either by detecting a "rollover" (the "rrdtool update" command for rrd files - not used with the dbi backend - has a provision for that) or by querying the 64bit values on the router instead and then inserting those values. Alternatively the dbi backend can also "try" to do the calculations for you on the fly if you insert the absolute counter values - see the man-page for details of which option to use... (/derive after the data column)</div>
<div><br></div><div>Martin</div><div><br></div><div><br></div><div><br><div><div><div><div><div>On 14.05.2013, at 20:03, Shabbir Ahmed wrote:</div><br></div></div><blockquote type="cite"><div><div><div dir="ltr">
yes i used, this time i made graphs for my dsl router at home and they are doing better, but the connection is 4mb and the graph shows 1.5G, i hv checked database has large values, but these are ported from device, what i do i need to do now devid the values on something to get the desired value?<br>
<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 14, 2013 at 12:31 AM, Martin Sperl <span dir="ltr"><<a href="mailto:rrdtool@martin.sperl.org" target="_blank">rrdtool@martin.sperl.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Did you try the /rrdfillmissing=1/ as mentioned below as a workaround for your "missing" data?<span><font color="#888888"><div>
<br></div></font></span><div><span><font color="#888888">Martin</font></span><div><div><br><div><br></div><div><br><div><div>On 13.05.2013, at 18:27, Shabbir Ahmed wrote:</div><br><blockquote type="cite">
<div dir="ltr"><div><div><div>some time when i query for snmp the get times out so i cant fill in the table at that time, to fix this wat should i do ?<br><br></div>12:00 i queried db response recorded into mysql<br></div>
12:05 i queried but snmp get timeout, no entry into mysql<br></div>12:06 i queried and got the response into mysql.<br><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 13, 2013 at 11:36 AM, Martin Sperl <span dir="ltr"><<a href="mailto:rrdtool@martin.sperl.org" target="_blank">rrdtool@martin.sperl.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi!<div><br></div><div>One observation: actually you should see 4 lines not 2 or 1.</div>
<div><br></div><div>The other is that your data is possibly not stored "equidistant", so that there are slight "gaps" of say 302 seconds between consecutive datapoints, which would mean that you are producing times like this: 0,302,603,...,3298,3601,... (so there would be a gap at time 3300 to 3599)</div>
<div><br></div><div>For debugging purposes: can you please run rrdtool like this:</div><div>RRDDEBUGSQL=1 <b>rrdtool graph test.png --imgformat=PNG --start=-1day --width=600 --height=80 -S=300 "DEF:min=$UP:min:AVERAGE" "LINE1:min#336600:value"</b></div>
<div><br></div><div>Then you will see the SQL that gets executed and then you can run the SQL on your own to understand how this "gaps" are generated from the database...</div><div><br></div><div>But there is also an option to "fill in" "missing" gaps in rrd via the "/rrdfillmissing=" option. The idea here is similar to the "xff" argument to rrdcreate for the RRA definition.</div>
<div><br></div><div>So you may try to add it to your DEF like this: UP="sql//mysql/host=<a href="http://127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/up/idx=201409600" target="_blank">127.0.0.1/dbname=newdsl/username=root/password=nocb4enter</a>/rrdfillmissing=1<a href="http://127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/up/idx=201409600" target="_blank">//g3412306061/time/up/idx=201409600</a>"</div>
<div><br></div><div>Ciao,</div><div><span style="white-space:pre-wrap">        </span>Martin</div><div><br></div><div><div><div><div><div>On 12.05.2013, at 15:05, Shabbir Ahmed wrote:</div><br></div></div><blockquote type="cite">
<div><div><div dir="ltr"><div><div><div><div>Hi, i collect data from switches and save them into mysql, (snmpidx,time,up,down)<br><br></div>now i want to draw graphs using <br><br>DOWN="sql//mysql/host=<a href="http://127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/down/idx=201343232" target="_blank">127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/down/idx=201343232</a>"<br>
</div><div>UP="sql//mysql/host=<a href="http://127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/up/idx=201409600" target="_blank">127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/up/idx=201409600</a>"<br>
</div><div><br><b>rrdtool graph test.png --imgformat=PNG --start=-1day --width=600 --height=80 -S=300 "DEF:min=$UP:min:AVERAGE" "LINE1:min#336600:value" "DEF:avg=$UP:avg:AVERAGE" "LINE1:avg#00FF11:average" "DEF:max=$UP:max:AVERAGE" "LINE1:max#FF0000:max" "DEF:dw=$DOWN:min:AVERAGE" "LINE1:dw#0033CC:value" <br>
<br></b></div><b>1. the graphs drawn has gaps (i collect data every five mins) and draw them with 5 mins step but still the gape bw two occurences are empty.<br><br></b></div><b>2. it doesnt draw two lines.<br><br></b></div>
<div><b>Kindly help,<br></b></div><b><br></b></div></div></div>
_______________________________________________<br>rrd-users mailing list<br><a href="mailto:rrd-users@lists.oetiker.ch" target="_blank">rrd-users@lists.oetiker.ch</a><br><a href="https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users</a><br>
</blockquote></div><br></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>
</div></div><span><test.png></span></blockquote></div><br></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>
<span><test.png></span></blockquote></div><br></body></html>