2 Graph with same template didn't show the same (title & vertical scale)

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

2 Graph with same template didn't show the same (title & vertical scale)

Post by Rno »

Hello,
I create a template to display how many named process I got.

so here is the cacti/scripts:

Code: Select all

#!/usr/bin/env perl

delete @ENV{qw(PATH)};
$ENV{PATH} = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin';

open(PROCESS, "ps ax | grep -v grep | grep -c $ARGV[0] |");
$output = <PROCESS>;
close(PROCESS);
chomp($output);
print $output;
When I call him in CLI it always show me 1 process even if none are running, like Perl doesn't do the 'grep -v grep' part. But that's not the current point.

Then I have source template who look like that:
unix_named_DS_template.png
unix_named_DS_template.png (30.28 KiB) Viewed 2191 times
Has for the graphe template it's looke like that:
unix_named_Graph_template-1.png
unix_named_Graph_template-1.png (68.42 KiB) Viewed 2191 times
unix_named_Graph_template-2.png
unix_named_Graph_template-2.png (44.83 KiB) Viewed 2191 times
But when I look a graph how i expecting to look like:
pool_mac_graph.png
pool_mac_graph.png (194.96 KiB) Viewed 2191 times
And the latest graph I add it's not correct: Title and scale:
process_graph.png
process_graph.png (123.38 KiB) Viewed 2191 times
And displaying the Graph debug mode doesn't show any difference, excpect for the title, it's look like that:

Code: Select all

/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-60' \
--pango-markup  \
--title='Local Linux Machine -  pool_mac.php  - Process' \
--vertical-label='processes' \
--slope-mode \
--base=1000 \
--height=200 \
--width=700 \
--tabwidth '40' \
--alt-autoscale-max \
--lower-limit='0' \
COMMENT:"From 01/10/2023 11\:14\:21 To 02/10/2023 11\:13\:21\c" \
COMMENT:"  \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border 1 \
--font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
--watermark 'Generated by Cacti®' \
DEF:a='/usr/share/cacti/rra/local_linux_machine_process_25614.rrd':'process':MAX \
DEF:b='/usr/share/cacti/rra/local_linux_machine_process_25614.rrd':'process':LAST \
LINE1:a#F70D1AFF: \
AREA:b#00A0C1B2:'pool_mac.php'  \
GPRINT:b:MIN:'Minimum\:%8.0lf'  \
GPRINT:b:AVERAGE:'Average\:%8.0lf'  \
GPRINT:b:MAX:'Maximum\:%8.0lf\n' 
Any clue why is that ?
What I'm doing wrong ?

thanks for your input
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: 2 Graph with same template didn't show the same (title & vertical scale)

Post by TheWitness »

Go to the Graph Templates page, select the Graph Template in question, and from the drop down, select Sync Graphs and press the Go button.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: 2 Graph with same template didn't show the same (title & vertical scale)

Post by Rno »

Hello,
NO luck it didn't change!
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: 2 Graph with same template didn't show the same (title & vertical scale)

Post by TheWitness »

There must be a bug then. I'm a bit disappointed though. When you search by template from the Graph Management page, do you see both Graphs? One option would be to delete the old graph, save the RRDfile, create it anew, and then rename the old RRDfile to be the same as the new one.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: 2 Graph with same template didn't show the same (title & vertical scale)

Post by Rno »

The problem is not on old graph, it's on new graph.
But don't ask what I change, I'm remember messing arround with the title only.

As for a bug, I can't argue with that, but it will be odd to have one like that now!
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: 2 Graph with same template didn't show the same (title & vertical scale)

Post by Rno »

Hmm interesting.

I select my 2 grpah who where having a bad name, and I chose the action 'reapply suggested name'
and, the first next popup give me the right name:

Code: Select all

Click 'Continue' to re-apply suggested naming to the following Graph(s).

    Local Linux Machine - findhost - Process
    Local Linux Machine - php - Process
Then when I click OK, the name appear correctly.
So one thnik resolved, then I have to find why the scale is not the same.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: 2 Graph with same template didn't show the same (title & vertical scale)

Post by Rno »

I try to make some trace to see where is the glitch, so far, nothing.

here is the step I did:
Click on create new graph for the Unix Named Process,
enter the name httpd as process, then click create:

This it the post seen on my browser

Code: Select all

{
	"c_0_109_122_113": "httpd",
	"host_template_id": "4",
	"host_id": "1",
	"save_component_new_graphs": "1",
	"selected_graphs_array": "a:1:{s:2:\"cg\";a:1:{i:109;a:1:{i:109;b:1;}}}",
	"action": "save",
	"__csrf_magic": "sid:044801c49736e3830406bf26d12981675f7fbedd,1696584126"
}
And on the popup:

Code: Select all

The Operation was successful. Details are below.

Created: Local Linux Machine - httpd - Process
So, so far the name of the process (as |input_process|) is correct.
The DS has the correct name:

Code: Select all

Local Linux Machine - httpd - Process
The graph name is wrong:

Code: Select all

Local Linux Machine - |input_process| - Process
the gprint on the graph is correct.

I was not able to dig through the 'html_graph_new_graphs' and 'html_graph_custom_data' to clearly understand what is going on.

The only way for me to fix the name issue it to do a 'reapply suggested name'
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests