CDEF : MAX - MIN ????

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

refractor
Posts: 8
Joined: Mon Apr 16, 2012 6:11 am
Location: Vienna/Austria

Re: CDEF : MAX - MIN ????

Post by refractor »

thanks for your reply. I've tested it, but I it seems so it wouldn't work:

Code: Select all

$ /usr/bin/rrdtool graph - \
> --imgformat=PNG \
> --start=1335305197 \
> --end=1335391597 \
> --title='WBB3 - Posts' \
> --base=1000 \
> --height=120 \
> --width=500 \
> --alt-autoscale-min \
> --upper-limit=100 \
> COMMENT:"From 25/04/2012 00\:06\:37 To 26/04/2012 00\:06\:37\c" \
> COMMENT:"  \n" \
> --vertical-label='Posts' \
> --slope-mode \
> --font TITLE:12: \
> --font AXIS:8: \
> --font LEGEND:9: \
> --font UNIT:8: \
> DEF:a="/var/www/html/cacti/rra/wbb3_topics_298.rrd":"posts":AVERAGE \
> CDEF:cdefc='a,a,-,U,0,-,+' \
> CDEF:cdefd='LTIME,604800,%,172800,GT,LTIME,604800,%,345600,LT,INF,UNKN,a,*,IF,UNKN,a,*,IF' \
> LINE2:a#DE0056FF:"Posts\:"  \
> GPRINT:a:LAST:"%8.0lf"  \
> GPRINT:cdefc:LAST:"Trend\:%8.0lf\n"  \
> LINE2:cdefd#750F7DFF:"" 
ERROR: invalid rpn expression in: a,a,-,U,0,-,+
Regards,
Thomas
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: CDEF : MAX - MIN ????

Post by gandalf »

Wow, at least the error message has changed. So the operator was indeed required. What worries me is, that in the previous case the Cacti variables have been repleaced by a "0" in both cases and now we have a "U(nknown)" and a "0".
And you're sure to have a data source associated with this graph item?
Well, I won't say there's no bug, but I appreciate if you would export the related graph template (including dependencies) and either attach it here or post it to my email account
R.
refractor
Posts: 8
Joined: Mon Apr 16, 2012 6:11 am
Location: Vienna/Austria

Re: CDEF : MAX - MIN ????

Post by refractor »

Ah, I've seen at his time. I've 3 templates wich I want to use with this CDEF ... I've tried another One because I thought the result will be the same on an other one.
BUT It's not!

These three Templates are showing Posts, Topics and Registered Members from an Online Board.

So when I apply this on the "Registered members" template, the Graph will appear, but it show's "0".
If I run the command at the Shell, no error message appears.

But if I apply this on the "Posts" Graph, the graph doesn't appear, and the error message above coud be read from the shell.

It seems so, that CURRENT_DS_MAX_VALUE and CURRENT_DS_MIN_VALUE are pointing to my data surce "Minium" and "Maximum" Value and NOT to the Maximum peak of the graph. (see att)
(... but normally there should be a "U" on the topics template too ... it seems so that I've forgotten that)

I've attached the relevant XMLs and the Script ... i know that Isn't very "great code" ... but it works :D If there is something missing, please tell.
Thanks a lot!
Attachments
graph image
graph image
graph_image.png (15.74 KiB) Viewed 1461 times
WBB-statistics-template.zip
template files
(7.78 KiB) Downloaded 67 times
data source
data source
Bildschirmfoto 2012-04-26 um 22.14.53.png (130.72 KiB) Viewed 1461 times
data source
data source
Bildschirmfoto 2012-04-26 um 22.13.32.png (131.01 KiB) Viewed 1461 times
Regards,
Thomas
refractor
Posts: 8
Joined: Mon Apr 16, 2012 6:11 am
Location: Vienna/Austria

Re: CDEF : MAX - MIN ????

Post by refractor »

I just wanted to ask if you have any new experiences about that? :)
Regards,
Thomas
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: CDEF : MAX - MIN ????

Post by gandalf »

Code: Select all

			/* data source item variables */
			$cdef_string = str_replace("CURRENT_DS_MINIMUM_VALUE", (empty($graph_item["rrd_minimum"]) ? "0" : $graph_item["rrd_minimum"]), $cdef_string);
			$cdef_string = str_replace("CURRENT_DS_MAXIMUM_VALUE", (empty($graph_item["rrd_maximum"]) ? "0" : $graph_item["rrd_maximum"]), $cdef_string);
			$cdef_string = str_replace("CURRENT_GRAPH_MINIMUM_VALUE", (empty($graph["lower_limit"]) ? "0" : $graph["lower_limit"]), $cdef_string);
			$cdef_string = str_replace("CURRENT_GRAPH_MAXIMUM_VALUE", (empty($graph["upper_limit"]) ? "0" : $graph["upper_limit"]), $cdef_string);
Sorry, skipped your issue last time. The above shows the replacement of the variables in question. And you're right (and I was wrong): We use the static value of the limits defined for graph/data source.
If I remember correctly, using a VDEF=CURRENT_DATA_SOURCE, MAXIMUM should provide what you requested. This will be introduced with 089 which is what I'm working upon right now
R.
steph33
Posts: 4
Joined: Mon Nov 19, 2012 5:58 am

Re: CDEF : MAX - MIN ????

Post by steph33 »

Hi, without surprise, I face the same problem. Unfortunately, I'm stuck in 0.8.6i and I wonder if there's is quick (but not too dirty :D ) way to update rrd.php so that CURRENT_DS_MAX_VALUE and CURRENT_DS_MIN_VALUE would be bound to the correct values (instead of min/max declared in the Data template).
Thanks in advance.
Regards,
Steph.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: CDEF : MAX - MIN ????

Post by gandalf »

I do NOT recommend playing around with rrd.php. Very likely to break things. Why not upgrade to latest?
R.
steph33
Posts: 4
Joined: Mon Nov 19, 2012 5:58 am

Re: CDEF : MAX - MIN ????

Post by steph33 »

Hi, I've finally upgraded to the latest version (0.8.8 a) but the problem seems to remain. Am I missing sth ?

Regards,
Steph
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: CDEF : MAX - MIN ????

Post by gandalf »

gandalf wrote:I do NOT recommend playing around with rrd.php. Very likely to break things. Why not upgrade to latest?
R.
Sorry, my comment was not helpful. Even in 088a, you can't use VDEFs as required per older posts to this thread. I was not reading this whole thread again, so my answer was misleading. Sorry for that.
VDEF support will not be available until next Cacti release
R.
steph33
Posts: 4
Joined: Mon Nov 19, 2012 5:58 am

Re: CDEF : MAX - MIN ????

Post by steph33 »

Hi, don't worry. It was a good opportinuty to update my cacti :)

Do you have any informations about the date of the next release ? Will it be the 1.0.0 or will there be a 0.8.9 (cacti.net only mention the 1.0.0)

Regards
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: CDEF : MAX - MIN ????

Post by gandalf »

Currently, the branch I'm working on is 0.8.9. The requested features are all in. We are at alpha test stage, but, to be honest, I'm still adding fixes for bugs found in previous versions to 0.8.9. We won't push out more patches or functional improvements to the 0.8.8 branch.
See 0.8.9 thread at unstable forum for discussions related to 0.8.9
R.
steph33
Posts: 4
Joined: Mon Nov 19, 2012 5:58 am

Re: CDEF : MAX - MIN ????

Post by steph33 »

Hi, thanks for your replies. Is there any release date planed for the 0.8.9 ?

Regards,
Steph
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: CDEF : MAX - MIN ????

Post by gandalf »

I was trained not to answer those questions.
But in fact, by increasing the testing base _you_ will make the difference! The more we get this tested the earlier it will be published
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests