bandwidth usage as string

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

Moderators: Moderators, Developers

Post Reply
Author
Message
amr922
Posts: 6
Joined: Thu Feb 25, 2010 8:13 pm

bandwidth usage as string

#1 Post by amr922 » Thu May 20, 2010 2:37 am

Hello !
i would get bandwidth usage "Interface - Traffic (bytes/sec,Total Bandwidth) " as text string not as graph

how can i do that !?
Regards,

User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

#2 Post by Sirup » Thu May 20, 2010 2:45 am

Could you explain your issue in more than one sentence? I have actually no idea what you want. :-?
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]

amr922
Posts: 6
Joined: Thu Feb 25, 2010 8:13 pm

#3 Post by amr922 » Thu May 20, 2010 2:59 am

thanks Sirup and sorry for my English

i would like to get bandwidth usage in text mode instead of graph mode
Regards,

User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

#4 Post by Sirup » Thu May 20, 2010 3:07 am

Mhm.. How about clicking on the blue button with the white arrow next to the graphs? Then you can export the data into CSV.
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]

amr922
Posts: 6
Joined: Thu Feb 25, 2010 8:13 pm

#5 Post by amr922 » Thu May 20, 2010 3:32 am

thanks a lot
do you can help me to do it through mysql query ?
Regards,

User avatar
Howie
Cacti Guru User
Posts: 5352
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

#6 Post by Howie » Thu May 20, 2010 3:35 am

Take a look at the rrdtool manual.

You can use the PRINT option of the rrdtool graph command to get text output (use /dev/null as the graph filename).

Here's an example from Weathermap:

Code: Select all

rrdtool graph /dev/null -f "" -s now-30d -e now DEF:in=../rra/atm-sl_traffic_in_5498.rrd:traffic_in:AVERAGE DEF:out=../rra/atm-sl_traffic_in_5498.rrd:traffic_out:AVERAGE VDEF:avg_in=in,AVERAGE VDEF:avg_out=out,AVERAGE PRINT:avg_in:%lf PRINT:avg_out:%lf
Cacti won't really help you with this job, but you can use the graph debug option to copy some of the DEF and CDEF parts.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

amr922
Posts: 6
Joined: Thu Feb 25, 2010 8:13 pm

#7 Post by amr922 » Thu May 20, 2010 4:22 am

thanks Howie

i tried that but i got

Code: Select all

rrdtool graph /dev/null -f "" -s now-30d -e now DEF:in=/var/www/html/rra/public_network_traffic_in_37.rrd:AVERAGE DEF:out=/var/www/html/rra/public_network_traffic_in_37.rrd:traffic_out:AVERAGE VDEF:avg_in=in,AVERAGE VDEF:avg_out=out,AVERAGE PRINT:avg_in:%lf PRINT:avg_out:%lf
ERROR: Cannot parse DS in 'DEF:in=/var/www/html/rra/public_network_traffic_in_37.rrd:AVERAGE'

debug from cacti

Code: Select all

  	 RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="public network - Traffic - GbE_18/18" \
--rigid \
--base=1000 \
--height=100 \
--width=480 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/html/rra/public_network_traffic_in_47.rrd":traffic_in:AVERAGE \
DEF:b="/var/www/html/rra/public_network_traffic_in_47.rrd":traffic_out:AVERAGE \
AREA:a#00CF00FF:"Inbound"  \
GPRINT:a:LAST:" Cur\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Avg\:%8.2lf %s"  \
GPRINT:a:MAX:"Max\:%8.2lf %s"  \
COMMENT:"Total In\:  15.36 GB\n"  \
LINE1:b#002A97FF:"Outbound"  \
GPRINT:b:LAST:"Cur\:%8.2lf %s"  \
GPRINT:b:AVERAGE:"Avg\:%8.2lf %s"  \
GPRINT:b:MAX:"Max\:%8.2lf %s"  \
COMMENT:"Total Out\: 2.23 GB" 
Regards,

User avatar
Howie
Cacti Guru User
Posts: 5352
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

#8 Post by Howie » Thu May 20, 2010 4:32 am

DEF:in=/var/www/html/rra/public_network_traffic_in_37.rrd:AVERAGE

should be

DEF:in=/var/www/html/rra/public_network_traffic_in_37.rrd:traffic_in:AVERAGE

(you missed out the DS name)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

amr922
Posts: 6
Joined: Thu Feb 25, 2010 8:13 pm

#9 Post by amr922 » Thu May 20, 2010 4:45 am

thanks a lot

last thing
how can i do it for specific period (from first of the month to now )

Regards,

User avatar
Howie
Cacti Guru User
Posts: 5352
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

#10 Post by Howie » Thu May 20, 2010 4:49 am

amr922 wrote:thanks a lot

last thing
how can i do it for specific period (from first of the month to now )

Regards,
There are command-line options for the start and end times. I think they are -s and -e, but they are in the rrdtool manual. You can specify dates in a lot of formats, including now-30d.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

amr922
Posts: 6
Joined: Thu Feb 25, 2010 8:13 pm

#11 Post by amr922 » Thu May 20, 2010 6:04 am

thanks a lot
output like
245664.840987
86962.878551


its with mbit ? or bytes or what ?

Post Reply