GPRINT using wrong data source

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

Moderators: Developers, Moderators

Post Reply
bodgit
Posts: 8
Joined: Wed Aug 31, 2005 6:39 am

GPRINT using wrong data source

Post by bodgit »

I'm trying to create a graph template for displaying temperature readings from my servers. I have five data sources, one for the current reading, and four others for the critical and non-critical upper and lower thresholds.

I want to just have the current reading graphed as an AREA, and display the other threshold values as GPRINT items, except they appear to be using the current reading data source instead of the data source I've told them to use.

I've created the AREA graph component, as well as the standard three GPRINT components for 'Current', 'Average' & 'Maximum'. These all use the current reading data source and work correctly. I have then created four further GPRINT components, each using a different data source for the various threshold values.

All of the values polled are in degrees, multiplied by 10, so I have created a CDEF to divide by 10 and this is also applied to all graph components.

The problem is these last four GPRINT components are using the original data source, not the data source I assigned to them. I confirmed this by looking at the "rrdtool graph" debug, which looks like this:

Code: Select all

...
--vertical-label="degrees" \
DEF:a="/var/www/cacti/rra/server01_probe_reading_177.rrd":probe_reading:AVERAGE \
CDEF:cdefb=a,10,/ \
CDEF:cdeff=a,10,/ \
CDEF:cdefg=a,10,/ \
CDEF:cdefh=a,10,/ \
CDEF:cdefi=a,10,/ \
COMMENT:"Temperature\n"  \
AREA:cdefb#ED7600:"Current Reading"  \
GPRINT:cdefb:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefb:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefb:MAX:"Maximum\:%8.2lf %s\n"  \
GPRINT:cdeff:AVERAGE:"Maximum Failure%8.2lf %s\n"  \
GPRINT:cdefg:AVERAGE:"Maximum Warning%8.2lf %s\n"  \
GPRINT:cdefh:AVERAGE:"Minimum Warning%8.2lf %s\n"  \
GPRINT:cdefi:AVERAGE:"Minimum Failure%8.2lf %s" 
There should be four more DEF= compoments matching the four other data sources with each 'divide by 10' CDEF applying to each, not applying to the same DEF.

Any ideas? My guess is because they're not graphed they don't get included somehow.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um, can you post a screen shot of the graph editor for this graph?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
bodgit
Posts: 8
Joined: Wed Aug 31, 2005 6:39 am

Post by bodgit »

Presumably this bit?
Attachments
Screenshot
Screenshot
graph_editor.jpg (94.6 KiB) Viewed 1307 times
dmarshall
Posts: 2
Joined: Fri Sep 09, 2005 9:42 am

Seeing Similar issues with DEF generation

Post by dmarshall »

I'm seeing similar Issues with DEF generation for Datasources in cacti 0.8.6f .

I have found that to perform CDEF calculations using the datasources, I must use the datasources in a Area or Stack or Line graph. A GPRINT or COMMENT does not suffice.

In My case I want to perform a calculation using the 2 datasources and Graph a percentage between the 2 items. Ths should be pretty simple with a cdef=b,a,/,100,*

If I don't use the datasources for b and a in a Line, Area or Stack graph, then the DEF for a and b is not generated.

RRDTOOL will report "ERROR: invalid rpn expression in: b,a,/,100,*"
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Recently I've found some old post referring to a similar problem. The solutions seemed to be the following: To use a DS, you will either have to add an AREA od LINE using this DS. If you don't want to see this line on the graph, select COLOR=NONE.
But I don't know, whether this solution is still valid.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest