FPL_NMS
Joined: 21 Aug 2005 Posts: 37
|
Posted: Wed Sep 07, 2005 11:18 pm Post subject: [HOWTO] CDEF created for negative data in bits/s |
|
|
Hi Folks,
Not sure if this has been gone over or not but figured I should post this anyways. I personally like the option of having data on both sides of the X axis, looks great and gives a real fast comparison of data. I did notice a small glitch in my graphs though but was not really caused by Cacti, more a preference than anything else. OK, when using the standard CDEF for making traffic appear on the negative side of X the data appears in "Bytes per second" Why some may ask, the data is gathered from the interface in Bytes/second, stored and then displayed as such until a CDEF tells it otherwise, and in this case you can use the standard CDEF for bytes to bits, which simply multiplies current_data_in by 8.
The odd part is when you see the data on the bottom of the graph displaying one thing and actual data in the legend saying another it can be misleading. If you create a CDEF that multiplies the current_data_in by 8, and then multiply that value by a ( -1 ) this will give you negative data in bits/second. Appended is what CDEF looks like. Let me know if there is another idea of how to do this.
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Blanked. Router - Traffic - Se1/0:0.1" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="bits per second" \
--slope-mode \
DEF:a="c\:\Inetpub\wwwroot\cacti/rra/blank_nuc_router_traffic_in_340.rrd":traffic_in:AVERAGE \
DEF:b="c\:\Inetpub\wwwroot\cacti/rra/blank_nuc_router_traffic_in_340.rrd":traffic_in:MAX \
DEF:c="c\:\Inetpub\wwwroot\cacti/rra/blank_nuc_router_traffic_in_340.rrd":traffic_in:AVERAGE \
DEF:d="c\:\Inetpub\wwwroot\cacti/rra/blank_nuc_router_traffic_in_340.rrd":traffic_out:AVERAGE \
DEF:e="c\:\Inetpub\wwwroot\cacti/rra/blank_nuc_router_traffic_in_340.rrd":traffic_out:MAX \
DEF:f="c\:\Inetpub\wwwroot\cacti/rra/blank_nuc_router_traffic_in_340.rrd":traffic_out:AVERAGE \
CDEF:cdefa=c,8,* \
CDEF:cdefd=b,8,* \
CDEF:cdefg=f,8,*,-1,* \
CDEF:cdefh=f,8,* \
CDEF:cdefj=e,8,* \
CDEF:cdefba=e,8,*,-1,* \
CDEF:cdefbe=1536000,c,/ \
AREA:cdefa#99FF99:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf %s" \
AREA:b#7D0CCE:"\n":STACK \
LINE1:cdefa#000000:"" \
AREA:cdefg#FFFF00:"Outbound" \
GPRINT:cdefh:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefh:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefj:MAX:"Maximum\:%8.2lf %s" \
AREA:cdefba#FF0000:"\n":STACK \
LINE1:cdefg#000000:"" \
HRULE:1536000#1C0CCE:"Threshold for T-1 1.536 Mb/s (In)\n" \
HRULE:-1536000#1C0CCE:"Threshold for T-1 -1.536 Mb/s (Out)\n" \
GPRINT:cdefbe:AVERAGE:" %8.2lf %s" \
HRULE:0#000000:""
| Description: |
| I am using 5 colors for the graph, the shaded areas are for the average data, the black lines are for contrast and are set for the average data as well, and the red and purple colors are as follows for example purposes, purple is stacked with no CDEF func |
|
| Filesize: |
51.19 KB |
| Viewed: |
5181 Time(s) |

|
| Description: |
| Now for my question, back with MRTG you had the option to create 2 additional data views on the graph and they were for Maximal input and Maximal output, this provided an additional 2 colors for display. I have tried to do the same with Cacti by taking th |
|
| Filesize: |
81.03 KB |
| Viewed: |
5182 Time(s) |

|
|
|