If no graph functions are called, the graph will not be created.
The x-axis label is configured, using the following format:
GTM:GST:MTM:MST:LTM:LST:LPR:LFM
You have to configure three elements making up the x-axis labels and grid. The base grid (G??), the major grid (M??) and the labels (L??). The configuration is based on the idea that you first specify a well known amount of time (?TM) and then say how many times it has to pass between each grid line or label (?ST). For the label you have to define two additional items: The precision of the label in seconds (LPR) and the strftime format used to generate the text of the label (LFM).
The ?TM elements must be one of the following keywords: SECOND, MINUTE, HOUR, DAY, WEEK, MONTH or YEAR.
If you wanted a graph with a base grid every 10 minutes and a major one every hour, with labels every hour you would use the following x-axis definition.
MINUTE:10:HOUR:1:HOUR:1:0:%X
The precision in this example is 0 because the %X
format is
exact. If the label was the name of the day, we would have had a precision
of 24 hours, because when you say something like 'Monday' you mean the
whole day and not Monday morning 00:00. Thus the label should be positioned
at noon. By defining a precision of 24 hours or rather 86400 seconds, you
make sure that this happens.
If this is all a big load of incomprehensible words for you, maybe an example helps (a more complete explanation is given in [1]): The expression vname+3/2 becomes vname,3,2,/,+ in RPN. First the three values get pushed onto the stack (which now contains (the current value of) vname, a 3 and a 2). Then the / operator pops two values from the stack (3 and 2), divides the first argument by the second (3/2) and pushes the result (1.5) back onto the stack. Then the + operator pops two values (vname and 1.5) from the stack; both values are added up and the result gets pushes back onto the stack. In the end there is only one value left on the stack: The result of the expression.
The rpn-expression in the CDEF function takes both, constant values as well as vname variables. The following operators can be used on these values:
If the stack contains the values A, B, C, D, E are presently on the stack, the IF operator will pop the values E D and C of the stack. It will look at C and if it is not 0 it will push D back onto the stack, otherwise E will be sent back to the stack.
printf
the result to stdout using format.
Valid characters are: j for justified, l for left aligned, r for right aligned and c for centered. In the next section there is an example showing how to use centered formating.
A special case is COMMENT:\s this inserts some additional vertical space before placing the next row of legends.
rrdtool graph demo.gif --title="Demo Graph" \ DEF:cel=demo.rrd:exhaust:AVERAGE \ "CDEF:far=cel,32,-,0.55555,*" \ LINE2:cel#00a000:"D. Celsius" \ LINE2:far#ff0000:"D. Fahrenheit\c"