title: RRDTOOL: How to sum multiple file using CDEF for MAX, MIN and LAST ouptut
body: <p>I have 3 rrd file (File1.rrd, File2.rdd and File3.rrd). I am getting MAX, MIN and LAST values from three files. To illustrate more on this, File1.rrd have 3 output (max, min &amp; current) similarly File2.rrd and File3.rrd will have 3 each total (9) variable as output. I am trying to sum all three min, max, and current values and store it into three separate variables but it's generating error every time. An error like, "invalid rpn expression in a variable name, RPN final stack size != 1, rpn expressions without DEF or CDEF variables are not supported. All the error generate in different scenarios when I tried to fix it.
  Below is code snippet for your reference. </p>
  
  <pre><code> rrdfile1  = file1.rrd
   rrdfile2 = file2.rrd
   rrdfile3 =  file3.rrd
  cmdline = cmdline + 'DEF:used_file1=file1:license_out:MAX:step=' + step_value + ' ' + \
  cmdline = cmdline + \
    VDEF: 'min_file1 = used_file1,MINIMUM' + \
    VDEF: 'max_file1 = used_file1,MAXIMUM' + \
    VDEF: 'cur_file1 = used_file1,LAST' + \
    VDEF: 'min_file2 = used_file2,MINIMUM' + \
    VDEF: 'max_file2 = used_file2,MAXIMUM' + \
    VDEF: 'cur_file2 = used_file2,LAST' + \
    VDEF: 'min_file3 = used_file3,MINIMUM' + \
    VDEF: 'max_file3 = used_file3,MAXIMUM' + \
    VDEF: 'cur_file3 = used_file3,LAST' + \  
  </code></pre>
  
  <p>I tried to sum like this : </p>
  
  <pre><code>cmdline = cmdline + 'CDEF:Total_min = min_file1,min_file2, min_file3, +, +, + ' '
  cmdline = cmdline + 'CDEF:Total_max = max_file1,max_file2, max_file3, +, +, + ' '
  cmdline = cmdline + 'CDEF:Total_cur = cur_file1,cur_file2, cur_file3, +, +, + ' '
  </code></pre>
  
  <p>Also, tired different method but nothing worked, I know that we cannot sum like this we should pass DEF variable in CDEF but not getting how to do that. Could you please help me out. The above mention code is not actual code just for your reference.</p>
  
  <p>Thank you in advance. </p>