[rrd-users] graph from mysql
Martin Sperl
rrdtool at martin.sperl.org
Wed May 15 08:53:19 CEST 2013
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).
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)
Martin
On 14.05.2013, at 20:03, Shabbir Ahmed wrote:
> 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?
>
>
>
>
> On Tue, May 14, 2013 at 12:31 AM, Martin Sperl <rrdtool at martin.sperl.org> wrote:
> Did you try the /rrdfillmissing=1/ as mentioned below as a workaround for your "missing" data?
>
> Martin
>
>
>
> On 13.05.2013, at 18:27, Shabbir Ahmed wrote:
>
>> 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 ?
>>
>> 12:00 i queried db response recorded into mysql
>> 12:05 i queried but snmp get timeout, no entry into mysql
>> 12:06 i queried and got the response into mysql.
>>
>>
>>
>>
>> On Mon, May 13, 2013 at 11:36 AM, Martin Sperl <rrdtool at martin.sperl.org> wrote:
>> Hi!
>>
>> One observation: actually you should see 4 lines not 2 or 1.
>>
>> 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)
>>
>> For debugging purposes: can you please run rrdtool like this:
>> RRDDEBUGSQL=1 rrdtool graph test.png --imgformat=PNG --start=-1day --width=600 --height=80 -S=300 "DEF:min=$UP:min:AVERAGE" "LINE1:min#336600:value"
>>
>> 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...
>>
>> 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.
>>
>> So you may try to add it to your DEF like this: UP="sql//mysql/host=127.0.0.1/dbname=newdsl/username=root/password=nocb4enter/rrdfillmissing=1//g3412306061/time/up/idx=201409600"
>>
>> Ciao,
>> Martin
>>
>> On 12.05.2013, at 15:05, Shabbir Ahmed wrote:
>>
>>> Hi, i collect data from switches and save them into mysql, (snmpidx,time,up,down)
>>>
>>> now i want to draw graphs using
>>>
>>> DOWN="sql//mysql/host=127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/down/idx=201343232"
>>> UP="sql//mysql/host=127.0.0.1/dbname=newdsl/username=root/password=nocb4enter//g3412306061/time/up/idx=201409600"
>>>
>>> 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"
>>>
>>> 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.
>>>
>>> 2. it doesnt draw two lines.
>>>
>>> Kindly help,
>>>
>>> _______________________________________________
>>> rrd-users mailing list
>>> rrd-users at lists.oetiker.ch
>>> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>>
>>
>
>
> <test.png>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130515/ee86fa82/attachment.htm
More information about the rrd-users
mailing list