Showing interface speed in Mbps/Gbps as comment on graph

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
evilzardoz
Cacti User
Posts: 55
Joined: Sun Dec 04, 2005 10:59 pm

Showing interface speed in Mbps/Gbps as comment on graph

Post by evilzardoz »

Hi all,

As per subject, I've tried to get this thing going but have had no success.

At present, I have added a comment to my Interface graph:

Item # 9 COMMENT: Port Speed: |query_ifSpeed|

Unfortunately counting zeroes doesn't give me as much enjoyment as it once did when I was in primary school and would like to present the port speed in Mbps or Gbps.

Is there an easy way to do so? I tried creating a CDEF but I obviously wasn't doing things right.

If anyone's got this working, I'd *really* appreciate a quick how-to on how this is done.

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

Post by gandalf »

CDEFs cannot (AFAIK) be used on titles. But you may insert a GPRINT below the graph that uses a CDEF. cacti does support |query_*| variables within CDEFs...
Reinhard
evilzardoz
Cacti User
Posts: 55
Joined: Sun Dec 04, 2005 10:59 pm

Post by evilzardoz »

Still having trouble trying to get my head around this one.

Has anyone actually managed to get something like this to work?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please define a CDEF like "cdef=|query_ifSpeed|,1000000,/" that will divide the ifSpeed by 1 million to get Speed in Mbps Units.
You may then introduce a GPRINT to your Graph Template. Text = "Mbit/sec" and refer to the CDEF above. Did not check this on live system, but it should go approximately this way. If not, please let me know (-> weekend)
Reinhard
li0n
Posts: 10
Joined: Tue Oct 18, 2005 4:38 pm

Post by li0n »

The right CDEF :

CURRENT_DATA_SOURCE,0,*,|query_ifSpeed|,1000000,/,+

because rrdtool refuse a cdef without a rrd variable !

(this is a trick to add one)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest