CDEF convert Bits into MBPS

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
abdulcc
Cacti User
Posts: 52
Joined: Fri Jul 14, 2006 7:06 am

CDEF convert Bits into MBPS

Post by abdulcc »

Hello All


I have a cdef defined cdef=CURRENT_DATA_SOURCE,1000000,/ such as to convert bits/second into megabits /second

I cannot get it to display on my graph and I would really apreciate if someone could show me how to do it!!!


Thanks,
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Post your resulting graph syntax using debug under graph management.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
abdulcc
Cacti User
Posts: 52
Joined: Fri Jul 14, 2006 7:06 am

Here it is Thanks

Post by abdulcc »

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
DEF:a="/var/www/cacti/rra/sample_traffic_in_134.rrd":traffic_in:AVERAGE \
DEF:b="/var/www/cacti/rra/sample_traffic_in_134.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdeff=b,8,* \
CDEF:cdefbc=b,1000000,/ \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total In\: 17.98 MB\n" \
LINE1:cdeff#002A97:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdeff:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total Out\: 187.79 MB" \
COMMENT:"Port Speed 100000000 Bits/sec" \
COMMENT:"" \
GPRINT:cdefbc:AVERAGE:"%8.2lf %s"

RRDTool Says:

OK

I guess my cdef troubles comes from where it is highlithed in red
abdulcc
Cacti User
Posts: 52
Joined: Fri Jul 14, 2006 7:06 am

a template that will do the conversion

Post by abdulcc »

Doesnt someone have a template that will convert bits per second into megabits per second Thanks. This is the template I am using.

Interface - Traffic (bits/sec, Total Bandwidth)
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It's more a querkynees in the interface. The cdefbc likely does not work right?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
abdulcc
Cacti User
Posts: 52
Joined: Fri Jul 14, 2006 7:06 am

Yes thats what I am guessing

Post by abdulcc »

Damn cdefbc lol
utdrmac
Posts: 11
Joined: Wed Dec 19, 2007 12:31 pm

Post by utdrmac »

Hi all,

trying to use the following to convert to megabits/sec (Mbps):

Code: Select all

cdef=CURRENT_DATA_SOURCE,8,*,1048576,/
I'm ending up with graphs like this:

Image

Why is it showing 50m ? It should be showing like 1Mbps or .253 Mbps or 8.34Mbps.

TIA!
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

50m means 0.050

What GPRINT type are you using in your graph template ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
utdrmac
Posts: 11
Joined: Wed Dec 19, 2007 12:31 pm

Post by utdrmac »

Hi. I am using the 'Normal' GPRINT. Something I fooled around with is the 'unit-exponent' value for the graph. I changed it to 0 and now it shows on the Y-axis, 0.1.

Is that the correct location to change this?

I changed the GPRINT to 'Exact Numbers' and everything now shows 0 where in the graph above, it shows 457.29m and 554.13u etc.

Thanks for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests