| Cheshire Cat Computing http://steveshipway.org/forum/ |
|
| routers.cgi*LowerLimit http://steveshipway.org/forum/viewtopic.php?f=2&t=754 |
Page 1 of 1 |
| Author: | bpoyner [ Wed Nov 23, 2005 5:38 am ] |
| Post subject: | routers.cgi*LowerLimit |
I am attempting to set the lower-limit for a farhenheit temperature graph. Currently the lower-limit is 0 and I would like it to be 50, I don't expect that room to get colder than 50. Here is my config: Title[netbotz-temperature]: DRS Temperature PageTop[netbotz-temperature]: <H1>DRS Temperature</H1> MaxBytes[netbotz-temperature]: 200 Target[netbotz-temperature]: .1.3.6.1.4.1.5528.100.4.1.1.1.7.1095346743&.1.3.6.1.4.1.5528.100.4.1.1.1.7.1095346743:public@192.168.0.20 * 9 / 5 + 32 SetEnv[netbotz-temperature]: MRTG_INT_DESCR="Temperature" Options[netbotz-temperature]: gauge, absolute, nopercent Kilo[netbotz-temperature]: 1000 ShortLegend[netbotz-temperature]: YLegend[netbotz-temperature]: Temperature Legend1[netbotz-temperature]: Temperature Legend2[netbotz-temperature]: Temperature Legend3[netbotz-temperature]: Temperature Legend4[netbotz-temperature]: Temperature LegendI[netbotz-temperature]: Temperature: LegendO[netbotz-temperature]: Temperature: routers.cgi*Options[netbotz-temperature]: fixunit, nomax, noo routers.cgi*Mode[netbotz-temperature]: general routers.cgi*LowerLimit[netbotz-temperature]: 50 I turned on debugging and got this result: rrdtool graph /mnt/mrtg/www/graphs/netbotz.cfg-netbotz-temperature-d-l2.png --imgformat PNG --base 1024 --lazy -l 0 --interlaced --units-exponent 0 -F -s end-2000m -u 1 --lower-limit 50 -w 530 -h 200 --x-grid HOUR:1:HOUR:24:HOUR:2:0:%k --title DRS Temperature --vertical-label Temperature DEF:in=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds0:AVERAGE DEF:out=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds1:AVERAGE DEF:min=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds0:MAX DEF:mout=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds1:MAX CDEF:pcin=in,100,*,200,/ CDEF:mpcin=min,100,*,200,/ CDEF:pcout=out,100,*,200,/ CDEF:mpcout=mout,100,*,200,/ AREA:in#00cc00:Temperature\l CDEF:down=in,UN,out,UN,+,2,EQ,INF,0,IF AREA:down#d0d0d0 GPRINT:min:MAX:Max Temperature\:%7.2lf \g GPRINT:in:AVERAGE: Avg Temperature\:%7.2lf \g GPRINT:in:LAST: Cur Temperature\:%7.2lf \g COMMENT:\l --> I can see both a "-l 0" and a "--lower-limit 50" which may or may not be the issue. I'm using rrdtool 1.2.11 and routers.cgi v2.16. Any ideas on what I'm doing wrong? |
|
| Author: | bpoyner [ Wed Nov 23, 2005 5:55 am ] |
| Post subject: | |
I saw a post about perhaps needing to set rigid, so I did so. For some reason that makes 1.0 the maximum value on the graph. routers.cgi*Options[netbotz-temperature]: fixunit, nomax, noo, rigid |
|
| Author: | bpoyner [ Wed Nov 23, 2005 9:30 am ] |
| Post subject: | |
Just a little bit of experimentation and this is close to what I want. It it still graphing 40-50 degrees for some reason. I was using this command line, the major difference is in the CDEF:down. ./rrdtool graph /mnt/mrtg/www/test.png --imgformat PNG --base 1024 --lazy -l 0 --interlaced --units-exponent 0 -F -s end-2000m -u 1 --lower-limit 50 -w 530 -h 200 --x-grid HOUR:1:HOUR:24:HOUR:2:0:%k --title "DRS Temperature" --vertical-label Temperature DEF:in=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds0:AVERAGE DEF:out=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds1:AVERAGE DEF:min=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds0:MAX DEF:mout=/mnt/mrtg/www/rrd/netbotz-temperature.rrd:ds1:MAX CDEF:pcin=in,100,*,200,/ CDEF:mpcin=min,100,*,200,/ CDEF:pcout=out,100,*,200,/ CDEF:mpcout=mout,100,*,200,/ AREA:in#00cc00:Temperature\l CDEF:down=in,UN,out,UN,+,2,EQ,INF,50,IF AREA:down#d0d0d0 |
|
| Author: | stevesh [ Wed Nov 23, 2005 12:36 pm ] |
| Post subject: | |
Okay.... First of, the 'rigid' option wont work unless you give an upper-limit to make rigid. Because you have your 'maxbytes' before the 'target' line it is ignored by routers2 (this is an old problem that requires a complete parser rewrite to correct) and so it defaults to 1. When you add rigid, this result happens. If you put your Target line at the top of the definitions, it should be that 'rigid' will give you a graph from 50 (the lowerlimit) to 200 (the maxbytes). If you define a routers.cgi*UpperLimit[]: as well, then 'rigid' should force the graph to be between these values. The -l 0 --lower-limit 50 is a bug in routers2 that seems not to affect things (the 50 seems to override the 0 on our system). However I'll correct it. The place to remove it is around line 4806 in the script (look for --lazy -l 0 and remove the -l 0). Because of the way RRDTool works, you cannot have the lower limit rigid and the upper limit not. Therefore, if you specify a lower limit (which necessitates the graph being rigid, since the background wont work otherwise) then you MUST specify an upperlimit, either implicitly via maxbytes[] or explicitly via routers.cgi*UpperLimit[] You win a cookie for finding the first bug since release (the -l0 one). |
|
| Author: | bpoyner [ Thu Nov 24, 2005 3:30 am ] |
| Post subject: | |
Thanks for the clear explanation Steve. I wasn't aware that MaxBytes needed to come after Target and that I'd also need UpperLimit. Here is my config and resulting graph. Title[netbotz-temperature]: DRS Temperature PageTop[netbotz-temperature]: <H1>DRS Temperature</H1> Target[netbotz-temperature]: .1.3.6.1.4.1.5528.100.4.1.1.1.7.1095346743&.1.3.6.1.4.1.5528.100.4.1.1.1.7.1095346743:public@192.168.0.20 * 9 / 5 + 32 SetEnv[netbotz-temperature]: MRTG_INT_DESCR="Temperature" Options[netbotz-temperature]: gauge, absolute, nopercent MaxBytes[netbotz-temperature]: 200 Kilo[netbotz-temperature]: 1000 ShortLegend[netbotz-temperature]: YLegend[netbotz-temperature]: Temperature Legend1[netbotz-temperature]: Temperature Legend2[netbotz-temperature]: Temperature Legend3[netbotz-temperature]: Temperature Legend4[netbotz-temperature]: Temperature LegendI[netbotz-temperature]: Temperature: LegendO[netbotz-temperature]: Temperature: routers.cgi*Options[netbotz-temperature]: fixunit, nomax, noo, rigid routers.cgi*LowerLimit[netbotz-temperature]: 60 routers.cgi*UpperLimit[netbotz-temperature]: 90 We had, er, a bit of a problem with the HVAC system dumping hot air into the room. Would there be any way (or feature request) to automatically determine the high and low values and create a graph with a bit of a Y-axis buffer? For example the NetBotz itself creates graphs like this: Thanks again. |
|
| Author: | stevesh [ Thu Nov 24, 2005 11:48 am ] |
| Post subject: | |
The script already pulls out the Max value, but a min value would be a bit harder since the standard RRD format does not save this. Also, I'm currently using the automatic code in the RRD library to set the Y-axis. To do what you are suggesting would mean I'd have to bypass all of this and do the calculations myself - not necessarily too bad (the rescale button does something similar) but it would make life a bit more awkward and of course slow things down. The new graph looks good - but isn't 80F approx 26C? Your operations staff will be going to work in beachwear if you don't sort out your AC unit Incidentally, the latest version added a new option for Americans - c2f. This will allow you to store the temperatures in your RRD in centigrade, but display them in farenheit. Just have 'routers.cgi*Options[xxx]: c2f' and this calculation is performed on display - so you can actually have the same data displayed on two different graphs, one as degC and one as degF. |
|
| Author: | bpoyner [ Tue Nov 29, 2005 9:28 am ] |
| Post subject: | |
Back from the yank Thanksgiving holiday. Ah, now that you point it out I do recall seeing a max value when doing an 'rrdtool dump' but no min value. I see where that would get tricky and slow things down. Yep, 80F that would be about 26C. The room is our disaster recovery site at a remote campus which is rarely accessed, so nobody knew it was cooking our gear. We have nagios set to alarm if reaches and maintains 80F, but the temp was all over the place and merely spiked at 80F. Thanks for the tip on c2f. |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|