Graph templates why not GPRINT:MAX

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
dcs
Posts: 3
Joined: Fri Feb 18, 2022 10:10 am

Graph templates why not GPRINT:MAX

Post by dcs »

Hi:
I'm wondering why the GPRINT entry for the maximum value in the graph templates does not use the GPRINT:MAX option?
For example the 'Interface - Unicast Packets' graph template has the Maximum defined as type GPRINT with function MAX as follows:
packet-in_template.png
packet-in_template.png (41.55 KiB) Viewed 5382 times

Which results in a graph such as this, where the Maximum printed is not the max as viewed on the graph:
packets_no_max.png
packets_no_max.png (21.35 KiB) Viewed 5380 times

Code: Select all

RRDtool Command:
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start="1671974763" \
--end="1674586385" \
--pango-markup  \
--title="Unicast Packets - nic1.2002" \
--vertical-label="packets/sec" \
--slope-mode \
--base=1000 \
--height=200 \
--width=700 \
--rigid \
--alt-autoscale-max \
--lower-limit="0" \
COMMENT:"From 2022-12-25 13\:26\:03 To 2023-01-24 18\:53\:05\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 \
DEF:a="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_in":AVERAGE \
DEF:b="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_out":AVERAGE \
DEF:c="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_in":MAX \
DEF:d="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_out":MAX \
AREA:a#FFD8017F:"Unicast Packets In "  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:b#8065177F:"Unicast Packets Out"  \
GPRINT:b:LAST:"Current\:%8.2lf %s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:c#FFD801FF:  \
LINE1:d#806517FF: 
Here
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" is the maximum of the RRA 'in' average DEF:a.
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" is the maximum of the RRA 'out' average DEF:b
not the maximum of the MAX.

If I change the Type to GPRINT:MAX I get the expected results, the printed value and graph indicate the same.
packets_with_max.png
packets_with_max.png (21.61 KiB) Viewed 5380 times

Code: Select all

RRDtool Command:
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start="1671974763" \
--end="1674586385" \
--pango-markup  \
--title="Unicast Packets - nic1.2002" \
--vertical-label="packets/sec" \
--slope-mode \
--base=1000 \
--height=200 \
--width=700 \
--rigid \
--alt-autoscale-max \
--lower-limit="0" \
COMMENT:"From 2022-12-25 13\:26\:03 To 2023-01-24 18\:53\:05\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 \
DEF:a="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_in":AVERAGE \
DEF:b="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_in":MAX \
DEF:c="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_out":AVERAGE \
DEF:d="C\:/inetpub/wwwroot/cacti/rra/host0109_-_unicast_in_193.rrd":"unicast_out":MAX \
AREA:a#FFD8017F:"Unicast Packets In "  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:c#8065177F:"Unicast Packets Out"  \
GPRINT:c:LAST:"Current\:%8.2lf %s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:d:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:b#FFD801FF:  \
LINE1:d#806517FF:
Here
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" is the maximum of the RRA 'in' max DEF:b.
GPRINT:d:MAX:"Maximum\:%8.2lf %s\n" is the maximum of the RRA 'out' max DEF:d
which is what I expect.

Is this intended, an oversight or is the Function MAX not working as expected?
If this is an issue I can log it on GitHub.

Thanks
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Graph templates why not GPRINT:MAX

Post by TheWitness »

What's in the UI is by design. Some of it deals with legacy. But if you want MAX of MAX, you use GRPINT:MAX + MAX, MAX of AVERAGE is GPRINT + MAX.
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?
dcs
Posts: 3
Joined: Fri Feb 18, 2022 10:10 am

Re: Graph templates why not GPRINT:MAX

Post by dcs »

Thanks for the info. I'll adjust my templates as needed (I'm used to the MRTG format).
xmp65535
Posts: 2
Joined: Thu Mar 21, 2024 3:12 am

Re: Graph templates why not GPRINT:MAX

Post by xmp65535 »

I also encountered this problem, please tell me how to fix it.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest