I have a graph that displays all the percentage of available toner
colors for all color printers. 

First I set up Data Sources and Data Points for both the Toner Level and
Toner Max Level for all toner colors. So for cyan I have a
cyanTonerLevel_cyanTonerLevel and cyanTonerMax_cyanTonerMax data point.
I have similar data points for magenta, black and yellow. To make things
easier to understand, I have color-coded the data point HTML color to
match the Toner name.

I then create a new graph called TonerPercent. I select both the
TonelLevel and TonerLevelMax Data Sources for all the colors. In the
Custom section I have added the following RPN statements:

CDEF:blackpercent=blackTonerLevel_blackTonerLevel,blackTonerMax_blackTonerMax,/,100,*
CDEF:cyanpercent=cyanTonerLevel_cyanTonerLevel,cyanTonerMax_cyanTonerMax,/,100,*
CDEF:magentapercent=magentaTonerLevel_magentaTonerLevel,magentaTonerMax_magentaTonerMax,/,100,*
CDEF:yellowpercent=yellowTonerLevel_yellowTonerLevel,yellowTonerMax_yellowTonerMax,/,100,*
LINE1:blackpercent#000000:blackTonerPerc
LINE2:cyanpercent#00FFFF:cyanTonerPerc
LINE3:magentapercent#FF00FF:magentaTonerPerc
LINE4:yellowpercent#FFFF00:yellowTonerPerc

So what is going on here. The CDEF is basically a data definition that
performs a mathematical action. It follows the structure:

CDEF:var_name=RPN_expression

The RPN expression language may seem unusual at first. Essentially, you
identify your data values, and then the action that is performed on
them. A detailed description can be found here:
http://oss.oetiker.ch/rrdtool/tut/rpntutorial.en.html. Essentially, I am
generating my percentage dividing the TonerLevel by TonerLevelMax and
multiplying it by 100 to get a percentage. I then create a graph with
lines for all four percentages. 

LINE:label_name#hexcolor:var_name


On Fri, 2007-06-08 at 16:40 +0000, dctrvenkman wrote:
> How would I go about creating a custom graph using multiple data sources?  
> For instance if I wanted to add two data sources values and divide that value 
> by another data sources value and graph the resulting value.
> 
> thanks
> 
> ------------------------
>  Ryan Mamone
> 
> 
> 
> 
> -------------------- m2f --------------------
> 
> Read this topic online here:
> http://community.zenoss.com/forums/viewtopic.php?p=6931#6931
> 
> -------------------- m2f --------------------
> 
> 
> 
> _______________________________________________
> zenoss-users mailing list
> [email protected]
> http://lists.zenoss.org/mailman/listinfo/zenoss-users
-- 
James D. Roman
IT Network Administration

Terranet Inc.On contract to:
Science Systems and Applications, Inc.

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to