[SOLVED] Allow |query_ifSpeed| for upper limit

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
ariesgeek
Posts: 19
Joined: Mon Nov 27, 2006 1:24 pm

[SOLVED] Allow |query_ifSpeed| for upper limit

Post by ariesgeek »

If |query_ifSpeed| is used as the upper limit on a graph, it is not replaced with the appropriate number, rather the following error is given:

Code: Select all

CMDPHP: Poller[0] ERROR: SQL Exec Failed "update graph_templates_graph set Upper Limit='|query_ifSpeed|' where local_graph_id=5"
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

What happens if the upper limit changes when the device is re-quered?

It's not a simple answer, hence we haven't implemented it yet.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
ariesgeek
Posts: 19
Joined: Mon Nov 27, 2006 1:24 pm

Post by ariesgeek »

Aha! I see your point. Thanks for explaining. I just assumed it was an oversight.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Btw, I must admit I like the idea...

Just hard to track it, and do you update the data source as well? If so, we need to update the rrdtool file, which currently does not happen.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
ariesgeek
Posts: 19
Joined: Mon Nov 27, 2006 1:24 pm

Post by ariesgeek »

rony wrote:Btw, I must admit I like the idea...

Just hard to track it, and do you update the data source as well? If so, we need to update the rrdtool file, which currently does not happen.
Ok, since you're interested, let's think about this.

So, we allow |query_ifSpeed| as an upper limit. We add a second option, a checkbox, "Upper Limit Never Changes". If checked, that addresses all the above and we ignore a new upper limit if it changes. There are practical reasons for this.

If that box is unchecked, then we will have a few choices.

1) If the ifSpeed decreases, we may want to consider keeping upper limit where it is for historical graphing purposes. We can give the user this option somewhere in a configuration.
2) If the ifSpeed increases, we can increase the upper limit. Yeah, you'd have to change it in the RRD. It's been a while so I'm not sure if this can be done or not. If not, your workaround is to dump to XML, make changes to the XML file, then pull your XML file into a "new" RRD. I used to have an algorithm to accomplish the above, albeit in perl, but it's long-gone. It's simple enough to do though.
3) Maybe go a step further and note that if the ifSpeed changes X times in Y amount of time (3 changes in 2 months maybe), we just dump the upper limit altogether. Of course, make this user-configurable.

I dunno, I'm just thinking of things off the top of my head at this point.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Support for |query_*| variables for upper/lower limit is impleneted in SVN. Targeted release is 088. Awaiting code verification
Reinhard
deu439356
Cacti User
Posts: 73
Joined: Wed Aug 13, 2008 8:08 am

Post by deu439356 »

gandalf,
Support for |query_*| variables for upper/lower limit is impleneted in SVN. Targeted release is 088.
I would like to be able to use the |query_ifSpeed| for my upper limit, do you know when 8.8 will be released? Or do you know of a way to do this in 8.7b?

Thanks!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

expect 088 in the first half of this year (btw: Happy New Year to all of you!), at least as a beta. If I remember correctly, backporting would be time cinsuming. It is not planned for 087c
Reinhard
llow
Cacti User
Posts: 170
Joined: Fri Oct 05, 2007 5:34 pm

Post by llow »

I made a patch for 0.8.7 beta 4 a while ago that I am still using today. If you can't wait for 0.8.8.

http://bugs.cacti.net/view.php?id=1030
deu439356
Cacti User
Posts: 73
Joined: Wed Aug 13, 2008 8:08 am

Post by deu439356 »

I made a patch for 0.8.7 beta 4 a while ago that I am still using today. If you can't wait for 0.8.8.
Thank you! I am very excited to try this out. I should have some time within the next week to apply it.

B
tcprado
Posts: 23
Joined: Fri Apr 12, 2013 7:25 am

Re: [SOLVED] Allow |query_ifSpeed| for upper limit

Post by tcprado »

graph_image.png
graph_image.png (8.22 KiB) Viewed 7296 times
Capturar.PNG
Capturar.PNG (36.23 KiB) Viewed 7296 times
So, ifSpeed is detected correctly, but when using it as upper limit, I just get 1 on the graph.
tcprado
Posts: 23
Joined: Fri Apr 12, 2013 7:25 am

Re: [SOLVED] Allow |query_ifSpeed| for upper limit

Post by tcprado »

RRDTool Command:
C:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Switch 9-6 - Traffic - GigabitEthernet1/0/1" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit="|query_ifSpeed|" \
--lower-limit="0" \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="C\:/inetpub/wwwroot/cacti/rra/108/3925.rrd":"traffic_in":MAX \
DEF:b="C\:/inetpub/wwwroot/cacti/rra/108/3925.rrd":"traffic_out":MAX \
CDEF:cdefa="a,8,*" \
CDEF:cdefe="b,8,*" \
AREA:cdefa#00CF00FF:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97FF:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
Attachments
Capturar.PNG
Capturar.PNG (70.87 KiB) Viewed 7291 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest