Two Graph Item Inputs -> always identical in the graph

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

Moderators: Developers, Moderators

Post Reply
3XXFL3I
Posts: 11
Joined: Wed Jun 08, 2011 1:51 am

Two Graph Item Inputs -> always identical in the graph

Post by 3XXFL3I »

I created a graph template with two Items (a line and a gprint).
Both have the CDEF "a,b,/".

I also added two Graph Item Inputs and associated both with Item #1 and Item #2.

When I create a graph with this template and try to use two seperate data sources for the graph item fields, they will be changed to one of them when I click on save => both graph item fields show the same data source.
In the graph debug mode there is only one DEF afterwards.

Is cacti trying to be smarter than me or am I missing something obvious here?

EDIT: Cacti version is 0.8.7g
3XXFL3I
Posts: 11
Joined: Wed Jun 08, 2011 1:51 am

Re: Two Graph Item Inputs -> always identical in the graph

Post by 3XXFL3I »

If I use graph input item #1 only with graph item #1 and input item #2 only with item #2 it works.

But still I don't really understand why it is not working when I use both input items for both graph items.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Two Graph Item Inputs -> always identical in the graph

Post by gandalf »

Please post rrdtool graph output for both
R.
3XXFL3I
Posts: 11
Joined: Wed Jun 08, 2011 1:51 am

Re: Two Graph Item Inputs -> always identical in the graph

Post by 3XXFL3I »

gandalf wrote:Please post rrdtool graph output for both
RRDTool Command: wrote: /usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-900 \
--title='TestName' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/path/to/ds1.rrd":VALUE1:MAX \
CDEF:cdefa=a,b,/ \
LINE1:cdefa#FF0000FF:"" \
GPRINT:cdefa:MAX:"%8.3lf %s"

RRDTool Says:

ERROR: invalid rpn expression in: a,b,/
The second file ds2.rrd is just ignored.

This is the graph template exported as a xml file.

Code: Select all

<cacti>	
	<hash_00002195333ff9749e6b4606c9b99f90b5903f>
		<name>Test</name>
		<graph>
			<t_title>on</t_title>
			<title></title>
			<t_image_format_id></t_image_format_id>
			<image_format_id>1</image_format_id>
			<t_height></t_height>
			<height>120</height>
			<t_width></t_width>
			<width>500</width>
			<t_slope_mode></t_slope_mode>
			<slope_mode>on</slope_mode>
			<t_auto_scale></t_auto_scale>
			<auto_scale>on</auto_scale>
			<t_auto_scale_opts></t_auto_scale_opts>
			<auto_scale_opts>2</auto_scale_opts>
			<t_auto_scale_log></t_auto_scale_log>
			<auto_scale_log></auto_scale_log>
			<t_scale_log_units></t_scale_log_units>
			<scale_log_units></scale_log_units>
			<t_auto_scale_rigid></t_auto_scale_rigid>
			<auto_scale_rigid></auto_scale_rigid>
			<t_auto_padding></t_auto_padding>
			<auto_padding>on</auto_padding>
			<t_export></t_export>
			<export>on</export>
			<t_upper_limit></t_upper_limit>
			<upper_limit>100</upper_limit>
			<t_lower_limit></t_lower_limit>
			<lower_limit>0</lower_limit>
			<t_base_value></t_base_value>
			<base_value>1000</base_value>
			<t_unit_value></t_unit_value>
			<unit_value></unit_value>
			<t_unit_exponent_value></t_unit_exponent_value>
			<unit_exponent_value></unit_exponent_value>
			<t_vertical_label></t_vertical_label>
			<vertical_label></vertical_label>
		</graph>
		<items>
			<hash_1000216588fa17f2cbd4837eb062b034b639df>
				<task_item_id>0</task_item_id>
				<color_id>FF0000</color_id>
				<alpha>FF</alpha>
				<graph_type_id>4</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>hash_0500216a02e6384123ebffcc7fa0f51289c395</cdef_id>
				<value></value>
				<gprint_id>hash_060021e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format></text_format>
				<hard_return></hard_return>
				<sequence>1</sequence>
			</hash_1000216588fa17f2cbd4837eb062b034b639df>
			<hash_100021d9c959c1edab04b424426765a0ed9dca>
				<task_item_id>0</task_item_id>
				<color_id>FF0000</color_id>
				<alpha>FF</alpha>
				<graph_type_id>9</graph_type_id>
				<consolidation_function_id>3</consolidation_function_id>
				<cdef_id>hash_0500216a02e6384123ebffcc7fa0f51289c395</cdef_id>
				<value></value>
				<gprint_id>hash_060021e9c43831e54eca8069317a2ce8c6f751</gprint_id>
				<text_format></text_format>
				<hard_return></hard_return>
				<sequence>2</sequence>
			</hash_100021d9c959c1edab04b424426765a0ed9dca>
		</items>
		<inputs>
			<hash_090021ed8ed157a7f6841d1c1a55c13576861b>
				<name>DS b</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_0000216588fa17f2cbd4837eb062b034b639df|hash_000021d9c959c1edab04b424426765a0ed9dca</items>
			</hash_090021ed8ed157a7f6841d1c1a55c13576861b>
			<hash_090021603eac7c95b0cfcfcda9faa1713540a1>
				<name>DS a</name>
				<description></description>
				<column_name>task_item_id</column_name>
				<items>hash_0000216588fa17f2cbd4837eb062b034b639df|hash_000021d9c959c1edab04b424426765a0ed9dca</items>
			</hash_090021603eac7c95b0cfcfcda9faa1713540a1>
		</inputs>
	</hash_00002195333ff9749e6b4606c9b99f90b5903f>
	<hash_0500216a02e6384123ebffcc7fa0f51289c395>
		<name>a divide b</name>
		<items>
			<hash_14002199f58dd68d8c39c4fae497e32d3b8c2b>
				<sequence>1</sequence>
				<type>6</type>
				<value>a,b,/</value>
			</hash_14002199f58dd68d8c39c4fae497e32d3b8c2b>
		</items>
	</hash_0500216a02e6384123ebffcc7fa0f51289c395>
	<hash_060021e9c43831e54eca8069317a2ce8c6f751>
		<name>Normal</name>
		<gprint_text>%8.3lf %s</gprint_text>
	</hash_060021e9c43831e54eca8069317a2ce8c6f751>
</cacti>
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Two Graph Item Inputs -> always identical in the graph

Post by gandalf »

The rrdtool statement indeed misses the second data source, b.
So it can't compute the CDEF.
R.
3XXFL3I
Posts: 11
Joined: Wed Jun 08, 2011 1:51 am

Re: Two Graph Item Inputs -> always identical in the graph

Post by 3XXFL3I »

gandalf wrote:The rrdtool statement indeed misses the second data source, b.
So it can't compute the CDEF.
Yes, that is indeed my problem.

When I create a graph using this template and then choose two different data sources cacti resets one of them to be the other.
E.g. if I choose "ds a" and "ds b" they will be "ds a" and "ds a" (or "ds b" and "ds b", I think I have seen both versions) after clicking on save.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Two Graph Item Inputs -> always identical in the graph

Post by gandalf »

In case both data refer to the same data source, that's indeed correct. Cacti won't add a DEF for same data source twice. In this case, the given CDEF would make no sense, whatsoever.
R.
3XXFL3I
Posts: 11
Joined: Wed Jun 08, 2011 1:51 am

Re: Two Graph Item Inputs -> always identical in the graph

Post by 3XXFL3I »

gandalf wrote:In case both data refer to the same data source, that's indeed correct. Cacti won't add a DEF for same data source twice. In this case, the given CDEF would make no sense, whatsoever.
I will try to explain my example with other words:
I have two data sources and I want to graph the ratio and gprint the maximum of the ratio.
Therefore I created the CDEF "a,b,/".
Afterwards I created the graph template.
I added two graph items. One for the graph and one for the gprint.
In theses graph items I leave the Data Source as "None"!
Then I added two data sources and associated them with both graph items, because they are used in both.

If I then use the template to create a graph and add two DIFFERENT data sources cacti will reset them to one after hitting save.

I can post pictures of this "work flow" on Monday if that helps...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Two Graph Item Inputs -> always identical in the graph

Post by gandalf »

To force cacti defining both required DEFs, you need e.g. two data sources (e.g. drawing as LINEx) that refer to the data you want to use in the CDEF computation. Using a GPRINT does not force the creation of a DEF (yep, this might be called a lack of feature)
R.
3XXFL3I
Posts: 11
Joined: Wed Jun 08, 2011 1:51 am

Re: Two Graph Item Inputs -> always identical in the graph

Post by 3XXFL3I »

gandalf wrote:To force cacti defining both required DEFs, you need e.g. two data sources (e.g. drawing as LINEx) that refer to the data you want to use in the CDEF computation. Using a GPRINT does not force the creation of a DEF (yep, this might be called a lack of feature)
Interestingly it works if I associate one data source with the LINE1 and the other data source with the GPRINT.
Anyway, the workaround is working fine (that is what workarounds are there for, I guess), so thank you for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest