GPRINT and CDEF issues

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

Moderators: Developers, Moderators

User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

GPRINT and CDEF issues

Post by TFC »

Hi,
I wanna show my link bandwith (or speed)
Now I can use : |query_ifSpeed|. But this query shows "1024000" value.
I want to show it "1024 Kbit/sec". So I have to divide to 1000 and add Kbit/sec.
I tried CDEF :
Item #1 Custom String: |query_ifSpeed|
Item #2 Operator: /
Item #3 Custom String: 1000
And Normal as GPINT. But i couldn't achieve this.
Is there any way?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Unfortunately, no.
CDEFs are not supported for use with TITLE or LEGEND
Reinhard
mgeni
Cacti User
Posts: 65
Joined: Fri Mar 25, 2005 8:12 am

Bandwidth %

Post by mgeni »

Can someone please walk me through a step by step process starting with creating a CDEF and adding it to the Graph Template. Unfortunately, I have plain old graphs with traffic info (2000 Graphs). I have to add %Utilization to each graph. I would like to add it to the graph template without importing any templates.

I have read some comment where I have to modify rrd.php. Is that still the case with version 0.8.7a.

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

Post by gandalf »

Do you have a test system to deal with?
Be warned! The Traffic Template is a most central one. Destroying it would not make you happy. So it would be best to learn on a second test system. I will guide you through it, no problem
Reinhard
mgeni
Cacti User
Posts: 65
Joined: Fri Mar 25, 2005 8:12 am

Post by mgeni »

Yes I have a test system. I don't mind following the steps on it and if it works try to implement it on production
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please read attached docs. They will be part of next release of the cacti manual. You may add questions at your will to improve the manual. It's quite generic, though. But we may discuss your special problem as a new example, if you agree
Reinhard
Attachments
CDEFs.pdf
Manual Chapter on CDEF usage
(57.96 KiB) Downloaded 375 times
mgeni
Cacti User
Posts: 65
Joined: Fri Mar 25, 2005 8:12 am

Post by mgeni »

Ok Gandalf, this documenation really helped. I guess I am ok to add an example except that my CdEF is not really correct values or I'm confused. Most probably the latter.

Percentage Bandwidth CDEF:

cdef=CURRENT_DATA_SOURCE,CURRENT_DS_MAXIMUM_VALUE,/,100,*

To Present it as a percentage, the GPRINT = (%3.2lf%%)

However after doing that, my interfaces have (nan%) represented. So I am kinda lost there. However Maybe I could be missing a piece due to the bytes from networking. Could you guide me along?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

mgeni wrote:Percentage Bandwidth CDEF:

cdef=CURRENT_DATA_SOURCE,CURRENT_DS_MAXIMUM_VALUE,/,100,*
That's what the manual currently does not explain: use |query_ifSpeed| instead of CURRENT_DS_MAXIMUM_VALUE.
But pay attention: This variable is updated only when a reindex event occurs. So if you're using auto-negotiation, cacti may miss a changed ifSpeed
Reinhard
mgeni
Cacti User
Posts: 65
Joined: Fri Mar 25, 2005 8:12 am

Post by mgeni »

Gandalf,

Thanks for the Assistance, Now that My percentage values are back, I was trying to verify if they are correct, however I am seeing something strange even if i hit the Green Circle on the snmp interface query of the device.

In my graph management, I have added an Item with
Graph item type: Gprint
Consolidation:AVG
CDEF:Bytes to Bits
Value - HRule or Vrule: |query_Ifspeed|
Gprint:Normal
Text: Max interface Value.

However, it is Displaying Random AvG Value. If you change Consolidation function to MAX, it will pick the Max Value on the graph and the Max Interface Value. I have a %Value is now provided by the Max Value on the graph and Not the IFSPEED Values. Any comments/suggestions are appreciated.

In Addition, Question does my CDEF require a "* 8"at the end?

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

Post by gandalf »

Please visit graph at Graph Mangementen and switch to DEBUG. Please post a screenshot of all, graph and rrdtool graph statement
Reinhard
mgeni
Cacti User
Posts: 65
Joined: Fri Mar 25, 2005 8:12 am

Post by mgeni »

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Traffic Ca3/1-downstream" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/html/rra/central_ubr-1_traffic_in_2890.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefc=a,30341646,/,100,*,8,* \
AREA:cdefa#002A97FF:"Outbound" \
GPRINT:cdefa:LAST:"Current\:%8.2lf%s" \
GPRINT:cdefc:LAST:"%3.2lf%%" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf%s" \
GPRINT:cdefc:AVERAGE:"Average\:%8.2lf %%" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf%s" \
GPRINT:cdefc:MAX:"Maximum%8.2lf %%\n" \
COMMENT:"****************************************************************************\n" \
GPRINT:cdefa:MAX:"Maximum Interface Speed%8.2lf%s"
RRDTool Says:

OK

[/url]
    mgeni
    Cacti User
    Posts: 65
    Joined: Fri Mar 25, 2005 8:12 am

    Post by mgeni »

    Attach is the Pic

    Can't attacah Pic, Can you allow permissons?

    However, i do see in the RRD Debug where it is using CdefA instead of C? I do not know how to change it .

    Thanks,
    Attachments
    Downstream.png
    Downstream.png (27.2 KiB) Viewed 7409 times
    Last edited by mgeni on Tue Mar 25, 2008 6:53 am, edited 1 time in total.
    User avatar
    gandalf
    Developer
    Posts: 22383
    Joined: Thu Dec 02, 2004 2:46 am
    Location: Muenster, Germany
    Contact:

    Post by gandalf »

    No image found, sorry
    mgeni
    Cacti User
    Posts: 65
    Joined: Fri Mar 25, 2005 8:12 am

    Post by mgeni »

    Was able attach i t. Please review above.
    mgeni
    Cacti User
    Posts: 65
    Joined: Fri Mar 25, 2005 8:12 am

    Post by mgeni »

    Gandalf, Any thoughts on this? I am still playing tweak.
    Post Reply

    Who is online

    Users browsing this forum: No registered users and 0 guests