|
|
| Author |
Message |
Tulan
Joined: 15 Apr 2010 Posts: 3
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Thu Apr 15, 2010 1:19 pm Post subject: |
|
|
Primarily, you are not asking for a Cacti feature but an RRDTool Feature.
Do you see a wrench next to the graph? Then, please hit it and post the rrdtool garph statement found. Else, please see http://docs.cacti.net/manual:087:6_reference.2_cdef#cdefs to learn how to solve similar approaches. Be prepared for some hard work ahead
R.
|
|
| Back to top |
|
 |
Tulan
Joined: 15 Apr 2010 Posts: 3
|
Posted: Fri Apr 16, 2010 11:27 am Post subject: |
|
|
You are right it is a RRDTOOL problem. After reading the RRDTOOL manual, I have discovered the solution is very simple ... after understanding the RPN notation
- Create a new CDEF (called "Unknown Data" for me) with content: CURRENT_DATA_SOURCE,UN,INF,UNKN,IF
- 1st step: CURRENT_DATA_SOURCE,UN test if the current data value is Unknown. Result is 1 if yes, 0 if not
After this step the function is 1,INF,UNKN,IF or 0,INF,UNKN,IF
- 2nd step: the IF statement test if the previous result is 1 or 0. If yes it return INF (infinity), UNKN (unknown) if not
- In the graph template, create a new "Graph Template Item" with the datasource in input, type AREA and the new created CDEF as CDEF function. If the result of the CDEF function is INF, the grapher fill the area to maximum, but don't draw anything if the result is UNKN
The final RRDTOOL command for the attached graph
| Code: | /usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="xxxxxxx - Exchange Connections" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Connections" \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/xxxxx_count_active_users_1800.rrd":count_active_users:AVERAGE \
DEF:b="/var/www/cacti/rra/xxxxx_count_active_users_1800.rrd":active_connections:AVERAGE \
CDEF:cdefi=a,UN,INF,UNKN,IF \
AREA:a#FF7D00FF:"Active Users" \
GPRINT:a:LAST:" Cur\:%8.0lf" \
GPRINT:a:AVERAGE:"Avg\:%8.0lf" \
GPRINT:a:MAX:"Max\:%8.0lf\n" \
LINE2:b#00FF00FF:"Active Connections" \
GPRINT:b:LAST:"Cur\:%8.0lf" \
GPRINT:b:AVERAGE:"Avg\:%8.0lf" \
GPRINT:b:MAX:"Max\:%8.0lf\n" \
AREA:cdefi#797C6EFF:"" |
| Description: |
|
| Filesize: |
25.84 KB |
| Viewed: |
304 Time(s) |

|
|
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 13135 Location: MI, USA
|
Posted: Fri Apr 16, 2010 11:39 am Post subject: |
|
|
Pretty cool
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Fri Apr 16, 2010 4:12 pm Post subject: |
|
|
| Tulan wrote: | ...I have discovered the solution is very simple ... after understanding the RPN notation  | SIMPLE, RPN? I quite never seen anybody understanding RPN that fast and, that has to be noted, CORRECT. We should hire you as a CDEF Designer
R.
|
|
| Back to top |
|
 |
Tulan
Joined: 15 Apr 2010 Posts: 3
|
Posted: Sat Apr 17, 2010 4:26 am Post subject: |
|
|
| gandalf wrote: | SIMPLE, RPN? I quite never seen anybody understanding RPN that fast and, that has to be noted, CORRECT. We should hire you as a CDEF Designer
R. |
No, I would to say the solution for my problem is a simple CDEF function, RPN is totally awful
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|