Cricket - how to show minimal values

Jindrich Fucik <[email protected]> Sun, 06 Dec 2009 15:28:00 +0100 (CET)
Newsgroups gmane.network.cricket.user
Message-ID <[email protected]>
--MessagePart:325666011.0-10299-158964888-1260106381
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="us-ascii"

Hi Lists, 

Sorry if my theme is not actual for you, but I must write it to somebody, otherwise I will forget it :o) 

I'm using cricket at home for measuring various environment values. 
One of more interested measurements are measuring of heat pump. The heat pump producing set of values, including outdoor temperature, indoor temperature, temperature of cold and heat fluid. So, it mean, there are few values, where I'm more interested on "min" values instead of "max". 

Because cricket by default presenting only max, and default rrd parameters are oriented to max, i must in my config change these parameters. Here is an example of my RRD parameters. (be careful, that I'm measuring every 2 mins (120sec)) 

You can found, that I must add RRA for mins and also must change number of samples used per RRA. 

[... cut of target parameters from Defaults ...] 
target --default-- 
rrd-poll-interval = 120 
summary-loc = bottom 
# one point per 2 minutes, spanning 50 hours (rrd-pool-interval = 120sec) 
rra 2minAg AVERAGE:0.5:1:1500 
##rra 5minAve AVERAGE:0.5:1:600 
# one point per 30 minutes, spanning 12 days 
rra 30minAg AVERAGE:0.5:15:600 
rra 30minMn MIN:0.5:15:600 
##rra 30minAve AVERAGE:0.5:6:600 
# one point every 2 hours, spanning 50 days 
rra 2hrAg AVERAGE:0.5:60:600 
rra 2hrMn MIN:0.5:60:600 
rra 2hrMx MAX:0.5:60:600 
##rra 2hrAve AVERAGE:0.5:24:600 
##rra 2hrMax MAX:0.5:24:600 
# one point every day, spanning 600 days 
rra 1dayAg AVERAGE:0.5:720:600 
rra 1dayMn MIN:0.5:720:600 
rra 1dayMx MAX:0.5:720:600 
##rra 1dayAve AVERAGE:0.5:288:600 
##rra 1dayMax MAX:0.5:288:600 
[... cut end ...] 

OK, now I have all data in my rrd file. Problem is, how to display it. I have used presented graph parameter "show-max", but for deciding, that I'm interested into "min" i have added parameter "show-min". The configuration values (color, line style) I'm using original parameters max-color etc. 

[... cut of graph parameters from Defaults ...] 

graph outdoor 
legend = "Outdoor temperature [GT2](20C)" 
color = dark-green 
draw-as = LINE0 
max-color = dark-green 
show-min = true 
[... cut end ...] 


So, it sounds like logical - problem is, that grapher not understand that new parameter. I must patch grapher to add show-min parameter. Patch in FreeBSD notation is included as a attachment of email. 

There are example of my graphs: 
http://wifi.nekropolis.cz/cgi-bin/grapher.cgi?target=%2FIVT_marked_mins%2Fuhrineves;view=All 

If anybody is interested by more details, I can send it. 

Jindra 

--MessagePart:325666011.0-10299-158964888-1260106381
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=utf8;
	name="=?us-ascii?Q?patch=2DxJFU=5Fshow=5Fmins=2Dgrapher=2Ecgi?="
Content-Disposition: attachment;
	filename="=?us-ascii?Q?patch=2DxJFU=5Fshow=5Fmins=2Dgrapher=2Ecgi?="

*** grapher.cgi.orig	Fri Sep 11 12:11:52 2009
--- grapher.cgi	Mon Sep 14 13:39:18 2009
***************
*** 1592,1598 ****
              # messy -- due to bad default RRA setup, etc.
              $mx = isTrue(graphParam($gRef, 'show-max', 0));
              # if hwParam, disable max, no matter what the config says
              $mx = 0 if (defined($hwParam));
!             if ($mx) {
                  $colormax = graphParam($gRef, 'max-color',
                                         nextColor($colorRef));
--- 1592,1600 ----
              # messy -- due to bad default RRA setup, etc.
              $mx = isTrue(graphParam($gRef, 'show-max', 0));
+             $mxmin = isTrue(graphParam($gRef, 'show-min', 0));
              # if hwParam, disable max, no matter what the config says
              $mx = 0 if (defined($hwParam));
!             $mxmin = 0 if (defined($hwParam));
!             if (($mx) || ($mxmin)){
                  $colormax = graphParam($gRef, 'max-color',
                                         nextColor($colorRef));
***************
*** 1608,1611 ****
--- 1610,1614 ----
              if (defined($dsidx)) {
                  push @defs, "DEF:mx$ct=$rrd:$dsidx:MAX" if ($mx);
+                 push @defs, "DEF:mn$ct=$rrd:$dsidx:MIN" if ($mxmin);
                  push @defs, "DEF:ds$ct=$rrd:$dsidx:AVERAGE";
                  if (defined($hwParam)) {
***************
*** 1648,1651 ****
--- 1651,1655 ----
                  if (defined($scale)) {
                      push @cdefs, "CDEF:smx$ct=mx$ct,$scale" if ($mx);
+                     push @cdefs, "CDEF:smn$ct=mn$ct,$scale" if ($mxmin);
                      push @cdefs, "CDEF:sds$ct=ds$ct,$scale";
                      if ($isMTargetsOps) {
***************
*** 1653,1656 ****
--- 1657,1662 ----
                              push @lines, "$drmxAs:totmx$mod#$clmxCode:" .
                                  "Max $legend" if ($mx);
+                             push @lines, "$drmxAs:totmn$mod#$clmxCode:" .
+                                 "Min $legend" if ($mxmin);
                              push @lines, "$drawAs:tot$mod#$colorCode:$legend";
                              $linePushed[$mod] = 1;
***************
*** 1659,1662 ****
--- 1665,1670 ----
                          push @lines, "$drmxAs:smx$ct#$clmxCode:" .
                                       "Max $legend" if ($mx);
+                         push @lines, "$drmxAs:smn$ct#$clmxCode:" .
+                                      "Min $legend" if ($mxmin);
                          push @lines, "$drawAs:sds$ct#$colorCode:$legend";
                      }
***************
*** 1681,1684 ****
--- 1689,1694 ----
                              push @lines, "$drmxAs:totmx$mod#$clmxCode:" .
                                           "Max $legend" if ($mx);
+                             push @lines, "$drmxAs:totmn$mod#$clmxCode:" .
+                                          "Min $legend" if ($mxmin);
                              push @lines, "$drawAs:tot$mod#$colorCode:$legend";
                              $linePushed[$mod] = 1;
***************
*** 1687,1690 ****
--- 1697,1702 ----
                          push @lines, "$drmxAs:mx$ct#$clmxCode:" .
                                       "Max $legend" if ($mx);
+                         push @lines, "$drmxAs:mn$ct#$clmxCode:" .
+                                      "Min $legend" if ($mxmin);
                          push @lines, "$drawAs:ds$ct#$colorCode:$legend";
                      }
***************
*** 1728,1731 ****
--- 1740,1744 ----
              push @{$dsnames[$i % $numDSs]}, "${scalepre}ds$i";
              push @{$mxnames[$i % $numDSs]}, "${scalepre}mx$i";
+             push @{$mxnames[$i % $numDSs]}, "${scalepre}mxmin$i";
          }
  
***************
*** 1767,1770 ****
--- 1780,1790 ----
                                                                  if ($sum);
              }
+             if ($mxmin) {
+                 my($str2) = "CDEF:${sum}totmn$j=" .
+                     join(',', @g, convertOps($MTargetsOps, $#d+1));
+                 push @cdefs, $str2;
+                 push @cdefs, "CDEF:totmn$j=" .
+                     join(',', @n, "UNKN", ("${sum}totmn$j", "IF") x @f)
+             }
  
              $j++;
***************
*** 1908,1912 ****
      # won't accidentally display an old image.
  
!     Debug("RRDs::graph " . join(" ", @args));
      unlink($imageName);
      my($avg, $w, $h) = RRDs::graph(@args);
--- 1928,1933 ----
      # won't accidentally display an old image.
  
! #    Debug("RRDs::graph " . join(" ", @args));
!     Warn("RRDs::graph " . join(" ", @args));
      unlink($imageName);
      my($avg, $w, $h) = RRDs::graph(@args);

--MessagePart:325666011.0-10299-158964888-1260106381
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
--MessagePart:325666011.0-10299-158964888-1260106381
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
cricket-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cricket-users

--MessagePart:325666011.0-10299-158964888-1260106381--