This is a discussion on [rrd-users] Little trouble with rrd_create_r within the RRD Users forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --===============0793325220== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C7ADAE.EE1FBA80" This ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a multi-part message in MIME format.
--===============0793325220== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C7ADAE.EE1FBA80" This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C7ADAE.EE1FBA80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello List, I've written an application which collects bandwidth stats from a bunch of switches and then takes those stats and is supposed to insert them into an RRD for each switch port. I've been having some trouble both creating RRDs and inserting data into them. The errors I am getting when creating the RRDs is "expected 2 data source readings (got 1) from 0:". I've got my code printing out the equivalent `rrdtool create` command from the same arguments passed to the `rrd_create_r` function and it prints out the following rrdtool create /path/to/rrds/b4_switch_port_47.rrd --step 300 --start 1181726796 \ "DS:input:COUNTER:600:0:U" \ "DS:output:COUNTER:600:U:U" \ "RRA:AVERAGE:0.5:1:600" \ "RRA:LAST:0.5:1:600" \ "RRA:MAX:0.5:1:600" \ "RRA:AVERAGE:0.5:6:700" \ "RRA:LAST:0.5:6:700" \ "RRA:MAX:0.5:6:700" \ "RRA:AVERAGE:0.5:24:775" \ "RRA:LAST:0.5:24:775" \ "RRA:MAX:0.5:24:775" \ "RRA:AVERAGE:0.5:288:797" \ "RRA:LAST:0.5:288:797" \ "RRA:MAX:0.5:288:797" <line breaks added for readability> The function which is used to create the RRD is as follows int sc_rrd_create(const char *filename) { time_t start = time(NULL) - 600; unsigned long step = 300; int argc = 14; char *argv[] = { "DS:input:COUNTER:600:0:U", "DS:output:COUNTER:600:U:U", "RRA:AVERAGE:0.5:1:600", "RRA:LAST:0.5:1:600", "RRA:MAX:0.5:1:600", "RRA:AVERAGE:0.5:6:700", "RRA:LAST:0.5:6:700", "RRA:MAX:0.5:6:700", "RRA:AVERAGE:0.5:24:775", "RRA:LAST:0.5:24:775", "RRA:MAX:0.5:24:775", "RRA:AVERAGE:0.5:288:797", "RRA:LAST:0.5:288:797", "RRA:MAX:0.5:288:797", (char*)NULL }; sc_replay_rrd_create(filename, step, start, argc, (const char **)argv); return rrd_create_r(filename, step, start, argc, (const char **)argv); } The `sc_replay_rrd_create` function is what prints out the above `rrdtool create` command. Out of all the switches I am working with and all their ports, this function correctly creates the RRD for about 10 - 15% of them. The rest have the "expected 2 data source readings (got 1) from 0:" error. Am I missing something glaringly obvious in my RRD definition which is causing this problem? Linking against librrd and using `-O0 -g` when compiling. RRDtool version 1.2.23. Regards, Geoff Garside Open Hosting Ltd ------=_NextPart_000_0001_01C7ADAE.EE1FBA80 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; 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;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style> </head> <body lang=3DEN-GB link=3Dblue vlink=3Dpurple> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Hello List,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I’ve written an application which collects = bandwidth stats from a bunch of switches and then takes those stats and is = supposed to insert them into an RRD for each switch port. I’ve been having = some trouble both creating RRDs and inserting data into them. = <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>The errors I am getting when creating the RRDs is "expected 2 data source readings (got 1) from 0:". I’ve = got my code printing out the equivalent `rrdtool create` command from the same arguments passed to the `rrd_create_r` function and it prints out the = following<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = rrdtool create /path/to/rrds/b4_switch_port_47.rrd --step 300 --start 1181726796 = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; "DS:input:COUNTER:600:0:U" &n bsp; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; "DS:output:COUNTER:600:U:U" = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:AVERAGE:0.5:1:600"   ; &nbs= p; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:LAST:0.5:1:600" &n bsp; &= nbsp; \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:MAX:0.5:1:600" &nb sp; &n= bsp; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:AVERAGE:0.5:6:700"   ; &nbs= p; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:LAST:0.5:6:700" &n bsp; &= nbsp; \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:MAX:0.5:6:700" &nb sp; &n= bsp; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:AVERAGE:0.5:24:775" &nbs p; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:LAST:0.5:24:775" & nbsp; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:MAX:0.5:24:775" &n bsp; &= nbsp; \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; "RRA:AVERAGE:0.5:288:797" &nb sp; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; = "RRA:LAST:0.5:288:797"  = ; & nbsp; = \<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; "RRA:MAX:0.5:288:797"<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><line breaks added for = readability><o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>The function which is used to create the RRD is as = follows<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = int<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = sc_rrd_create(const char *filename)<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = {<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = time_t start =3D time(NULL) - 600;<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = unsigned long step =3D 300;<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = int argc =3D 14;<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = char *argv[] =3D {<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "DS:input:COUNTER:600:0:U",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "DS:output:COUNTER:600:U:U",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:AVERAGE:0.5:1:600",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:LAST:0.5:1:600",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:MAX:0.5:1:600",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:AVERAGE:0.5:6:700",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:LAST:0.5:6:700",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:MAX:0.5:6:700",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:AVERAGE:0.5:24:775",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:LAST:0.5:24:775",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:MAX:0.5:24:775",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:AVERAGE:0.5:288:797",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:LAST:0.5:288:797",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = "RRA:MAX:0.5:288:797",<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = (char*)NULL<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = };<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = sc_replay_rrd_create(filename, step, start, argc, (const char = **)argv);<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = return rrd_create_r(filename, step, start, argc, (const char = **)argv);<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = }<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>The `sc_replay_rrd_create` function is what prints = out the above `rrdtool create` command. Out of all the switches I am working = with and all their ports, this function correctly creates the RRD for about 10 - = 15% of them. The rest have the "expected 2 data source readings (got 1) = from 0:" error.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Am I missing something glaringly obvious in my RRD definition which is causing this problem?<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Linking against librrd and using `-O0 -g` when = compiling. RRDtool version 1.2.23.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Regards,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Geoff Garside<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Open Hosting Ltd<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> </div> </body> </html> ------=_NextPart_000_0001_01C7ADAE.EE1FBA80-- --===============0793325220== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users --===============0793325220==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|