Ok I am begging for pecentage :)

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

Ok I am begging for pecentage :)

Post by TFC »

Hi,
I want to see link utilization of my interfaces as percetage, like MRTG.
So I know that:

Code: Select all

[(Inbound DS + Outbound DS)/Link Speed] * 100%
First I have to ask that how can I retrieve link speed automatically?
Let's say this is not possible.I can give my line speed...

Then, have to tell what I did step by step:
I create a CDEF, called "Percentage"
Item #1 Special Data Source: ALL_DATA_SOURCES_NODUPS
Item #2 Custom String: 100000000 (as line max speed.. fast ethernet)
Item #3 Operator: /
Then I go to Hraph templates page and I select Interface - Traffic (bits/sec)
I create new Graph Template Item, called Item # 9, at the bototm of other Graph template Items.
Values of Item # 9 are;
Data source : Traffic (traffic_out)
Color : None
Graph Item Type : COMMENT
CDEF Function : AVERAGE
Value : (empty)
GPRINT Type : Normal
Text Format : %
Hard Return : (not selected)
Seuence : 9(already exist)
Then I save my configuration.
And I trun to my graph page, I see graph in my attachement seen below. I see only "%"
You can see my graph config. here:

What did I mistake?

Code: Select all

/usr/local/rrdtool-1.0.35/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=1072706233 \
COMMENT:"From 2003-12-28 15:57:13 to 2003-12-29 15:57:13\c" \
COMMENT:"Graph Generated at 2003-12-29 15:57:13\c" \
--title="3rd Party Router 2 - Akbank_64k - 64000 - 192.168.114.173" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="bits per second" \
DEF:a="/www/htdocs/cacti_83/rra/3rd_party_router_2_traffic_in_2376.rrd":traffic_in:AVERAGE \
DEF:b="/www/htdocs/cacti_83/rra/3rd_party_router_2_traffic_out_2356.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefb=a,8,* \
CDEF:cdefe=b,8,* \
CDEF:cdefi=a,b,+,100000000,/ \
AREA:cdefa#00CF00:"Inbound"  \
GPRINT:cdefb:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefb:AVERAGE:" Average\:%8.2lf %s"  \
GPRINT:cdefb:MAX:" Maximum\:%8.2lf %s\n"  \
LINE1:cdefe#002A97:"Outbound"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n"  \
COMMENT:"%" 
 
Bisonlux
Cacti User
Posts: 79
Joined: Wed Jul 23, 2003 4:35 pm
Location: Luxembourg

Post by Bisonlux »

Try this...

In your CDEF Percentage add this:
Item #4 Custom String: 100
Item #5 Operator: *
In your Graph Template Item select this:
CDEF Function : Percentage
and post your result...

If you use "Text Format : % " it display only a comment and in this case %

Code: Select all

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

Post by TFC »

Hi,
after your advice config. files become like this:
CDEF percentage:
Item #1 Special Data Source : ALL_DATA_SOURCES_NODUPS
Item #2 Custom String : 100000000
Item #3 Operator : /
Item #4 Custom String : 100
Item #5 Operator : *
Graph Item Data source:
Item # 1 (traffic_in) : Inbound AREA AVERAGE 00CF00
Item # 2 (No Task) : Current: GPRINT LAST
Item # 3 (No Task) : Average: GPRINT AVERAGE
Item # 4 (No Task) : Maximum:<HR> GPRINT MAX
Item # 5 (traffic_out) : Outbound LINE1 AVERAGE 002A97
Item # 6 (traffic_out) : Current: GPRINT LAST
Item # 7 (traffic_out) : Average: GPRINT AVERAGE
Item # 8 (traffic_out) : Maximum:<HR> GPRINT MAX
Item # 9 COMMENT : "%" COMMENT AVERAGE
Graph config.:
/usr/local/rrdtool-1.0.35/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=1072765589 \
COMMENT:"From 2003-12-29 08:26:29 to 2003-12-30 08:26:29\c" \
COMMENT:"Graph Generated at 2003-12-30 08:26:29\c" \
--title="3rd Party Router 2 - Garanti_64k - 64000 - 192.168.114.161" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="bits per second" \
DEF:a="/www/htdocs/cacti_83/rra/3rd_party_router_2_traffic_in_2375.rrd":traffic_in:AVERAGE \
DEF:b="/www/htdocs/cacti_83/rra/3rd_party_router_2_traffic_out_2355.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefb=a,8,* \
CDEF:cdefe=b,8,* \
CDEF:cdefi=a,b,+,100000000,/,100,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefb:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefb:AVERAGE:" Average\:%8.2lf %s" \
GPRINT:cdefb:MAX:" Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:""%""
But my graph is still same. No percentage value..
Lux
Cacti User
Posts: 195
Joined: Tue Nov 11, 2003 10:57 am
Location: Luxembourg

Post by Lux »

I see one possible problem in your firmula. If your fast ethernet is connected full duplex, the theoretical total througput is 200 Mbps (100 up and 100 down). Thus, you could see something like 200% utilization. Unfortunately, you are seeing 235% at times.

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

Post by TFC »

Actually line never saturated...
But my problem is calculating speed of line automatically..
For example for 64K ISDN, Max value must be 64000 automatically.
I mean , [(Inbound+Outbound)/64000]*100%
But main problem still exist, I cannot se any percentage value...
Bisonlux
Cacti User
Posts: 79
Joined: Wed Jul 23, 2003 4:35 pm
Location: Luxembourg

Post by Bisonlux »

TFC,

Is that what you are looking for? (Bits_sec.png & Percent.png)

The CDEF.png shows you the CDEF I use

Item #1 CURRENT_DATA_SOURCE represented in bytes/minute
Item #2 & 3 convert it to bits/minute
Item #4 & 5 convert it to bits/second
Item #6 represents the speed of my network link 100Mbits/sec
Item #8 & 9 show the result in %

In the Bits_sec.png you can see that I have a maximum throughput (reception only) near 2k55 bits/second (2550 bits/sec)

It represent 2.55 m% (0.000255 %) for a link with a speed of 100Mbits/sec

I think there is a little problem with your rrdtool graph command. Look my command
/opt/RRDtool1045/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--title="Localhost - Netload Percent" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="%" \
DEF:a="/opt/cacti084/rra/localhost_rx_26.rrd":rx:MAX \
DEF:b="/opt/cacti084/rra/localhost_rx_26.rrd":tx:MAX \
CDEF:cdefa=a,8,*,60,/,100000000,/,100,* \
CDEF:cdefc=b,8,*,60,/,100000000,/,100,* \
LINE2:cdefa#FFC73B:"RX" \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n" \
LINE2:cdefc#74C366:"TX" \
GPRINT:cdefc:MAX:"Max\:%8.2lf %s"
2 CDEF are defined "cdefa" and "cdefc"
CDEF:cdefa=a,8,*,60,/,100000000,/,100,* \
CDEF:cdefc=b,8,*,60,/,100000000,/,100,* \
and both are used to display the lines and GPRINT
LINE2:cdefa#FFC73B:"RX" \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n" \
LINE2:cdefc#74C366:"TX" \
GPRINT:cdefc:MAX:"Max\:%8.2lf %s"
But if you look at your command
/usr/local/rrdtool-1.0.35/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=1072765589 \
COMMENT:"From 2003-12-29 08:26:29 to 2003-12-30 08:26:29\c" \
COMMENT:"Graph Generated at 2003-12-30 08:26:29\c" \
--title="3rd Party Router 2 - Garanti_64k - 64000 - 192.168.114.161" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="bits per second" \
DEF:a="/www/htdocs/cacti_83/rra/3rd_party_router_2_traffic_in_2375.rrd":traffic_in:AVERAGE \
DEF:b="/www/htdocs/cacti_83/rra/3rd_party_router_2_traffic_out_2355.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefb=a,8,* \
CDEF:cdefe=b,8,* \
CDEF:cdefi=a,b,+,100000000,/,100,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefb:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefb:AVERAGE:" Average\:%8.2lf %s" \
GPRINT:cdefb:MAX:" Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:""%""
4 CDEF are defined "cdefa", "cdefb", "cdefe" and "cdefi"
CDEF:cdefa=a,8,* \
CDEF:cdefb=a,8,* \
CDEF:cdefe=b,8,* \
CDEF:cdefi=a,b,+,100000000,/,100,* \
But only 3 are used a,b and e
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefb:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefb:AVERAGE:" Average\:%8.2lf %s" \
GPRINT:cdefb:MAX:" Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
Try to recreate your graph.

Last remark, in my example the received and transmitted are not added together and I hope I didn’t make mistakes with bits, bytes, per minute, per second...
Attachments
Bits_sec.png
Bits_sec.png (7.37 KiB) Viewed 10519 times
Percent.png
Percent.png (7.09 KiB) Viewed 10518 times
CDEF.png
CDEF.png (34.62 KiB) Viewed 10517 times
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

I am looking for this, shown below :)
As you see in graph, there are min, max an average values and its percentage.
I mean,
Max In: 641.681k/160M=%41...
etc..
Do I want lots of things:)
Attachments
denika-wug.jpg
denika-wug.jpg (60.9 KiB) Viewed 10504 times
Bisonlux
Cacti User
Posts: 79
Joined: Wed Jul 23, 2003 4:35 pm
Location: Luxembourg

Percent and a little bug

Post by Bisonlux »

Create a new GPRINT Presets:
Name < As you like>
GPRINT Text: (%8.6lf %%)
Add a second GPRINT to your graph and select as CDEF FUNCTION the CDEF function you have created to convert it in % (in your case percentage), and as GPRINT TYPE the GPRINT Presets you have just created.

Here the result...

As you can see the percentage for the TX value is wrong but it seems there is a bug in the code.
Attachments
Bits_sec.png
Bits_sec.png (8.31 KiB) Viewed 10485 times
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

Hi again,
Thanks Bisonlux for your assistances but, I think I need to summarize my problem
I dont want a graph about percentage. I need just GPINT that shows
1) Inbound Average/Bandwidth
2) Outbound Average/Bandwidth
and
3) (Inbound Average+Outbound Average)/Bandwidth
I mean, I need to see my interface utiliy.
So,
I did your instruction.
I create new GPRINT preset called "percentage"
Then, I create a new Graph Template Item in Graph Template/Interface-
Traffic (bits/sec) section
My data source: traffic_in
My graph item type :GPRINT
My Consodilation function : AVERAGE
My CDEF : Turn bytes into bits
My GPRINT Type: Percentage (I created)
And I create same things for traffic_in data source.
Result is shown below.
As you see,
Inbound average: 172,67 K
Outbound average: 478,99 K
Bandwidth : 100 Megabit
So,I expect that:
Inbound utility: (172,67 K / 100 M)*100 = 0,17%
Outbound utility : (478,99 K / 100 M)*100 =0,47 %
Total Utility : {( 172,67 K + 478,99 K)/100M}*100=0,65 %
But in graph, I see values are different..
Attachments
traffic.jpg
traffic.jpg (77.01 KiB) Viewed 10454 times
Bisonlux
Cacti User
Posts: 79
Joined: Wed Jul 23, 2003 4:35 pm
Location: Luxembourg

Post by Bisonlux »

TFT,

Can you post the rrdtool graph command. I want to check something.

As you see your percentage is 1 000 000 times to big. Perhaps your GPRINT type “Percentage” is wrong (post your values).

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

Post by TFC »

I don't know how can I take rrdtool graph command fowm cacti. But I use cacti's standard config. plus cactistoric.
And my percentage values are :
Gprint Text : (%8.6lf %%)
And, in Graph Items I use "Turn Bytes into bits" as CDEF, Consolidation function is AVERAGE.
Turn Bytes into bits:
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 8
Item #3 Operator: *
Another thing;
In other graph, I write the values:
Line speed: 512000 Kbit
Inbound current: 27,94K
Outbound current: 92,08K
Inbount utility: 27937,783209 %
Outbound utility: 27937,783209 %
As you see this values are wrong according to utility calculation...

I expect that ;
Inbound utility: 5,45%
Outbound Utility: 17,98 %
Bisonlux
Cacti User
Posts: 79
Joined: Wed Jul 23, 2003 4:35 pm
Location: Luxembourg

Post by Bisonlux »

Click on the graph tab, click the concerned graph and follow the “Source” link. The header of the page shows you the rrdtool graph command.
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

/usr/local/rrdtool-1.0.35/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=1073373092 \
COMMENT:"From 2004-01-05 09:11:32 to 2004-01-06 09:11:32\c" \
COMMENT:"Graph Generated at 2004-01-06 09:11:32\c" \
--title="BRV-GPRS-2600 - vlan-Gn-Gp - 100000000 - 192.168.143.161" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="bits per second" \
DEF:a="/www/htdocs/cacti_83/rra/brvgprs2600_traffic_in_4712.rrd":traffic_in:AVERAGE \
DEF:b="/www/htdocs/cacti_83/rra/brvgprs2600_traffic_out_4709.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefb=a,8,* \
CDEF:cdefe=b,8,* \
CDEF:cdefi=a,8,* \
CDEF:cdefj=a,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefb:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefb:AVERAGE:" Average\:%8.2lf %s" \
GPRINT:cdefb:MAX:" Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
GPRINT:cdefi:LAST:"Inbound Utility (Test Amaclidir Dikkate almayiniz) \:%8.6lf %%" \
GPRINT:cdefj:LAST:"Outbound Utility (Test Amaclidir Dikkate almayiniz) \:%8.6lf %%"
Bisonlux
Cacti User
Posts: 79
Joined: Wed Jul 23, 2003 4:35 pm
Location: Luxembourg

Post by Bisonlux »

TFC,

The zip file contains all the definitions/configurations to display the graph as you post in the last days.

Give me a feedback with your result.

Good luck !
Attachments
Network_Graph_Definitions.zip
(100.43 KiB) Downloaded 345 times
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

Thank you. This file is really perfect to help us. But I still have some problems.
1. I see same percentage for inbound and outbound. But your graph shows different values.(Seen graph2,100M.jpeg)
2. We give max. values in CDEF(like 100M). But, we have different type interfaces like 10M, 256K or 64K. So, we must create new template for each speed I think. To prevent this, line speed can be calcutated automatically but how? Have you and idea?(Seen graph1,64K.jpeg)
I publish two graph for these problems.
P.S. can you give me your e-mail for communicate about this problem. Because we send many graph and forum size is getting bigger:) Maybe raX need new HDD :)
Attachments
This graph shows that, Inbound and outbound percentage values are same.
This graph shows that, Inbound and outbound percentage values are same.
100M.jpg (60.31 KiB) Viewed 10375 times
This graph shows that, due to CDEF created for 100M, percentage is very small, like 0%
This graph shows that, due to CDEF created for 100M, percentage is very small, like 0%
64K.jpg (59.15 KiB) Viewed 10374 times
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests