Multiply Values in Graph?

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

Moderators: Moderators, Developers

Post Reply
Author
Message
farnk
Posts: 1
Joined: Fri Feb 08, 2019 3:49 am

Multiply Values in Graph?

#1 Post by farnk » Fri Feb 08, 2019 3:54 am

Hi all,
I'm new to write templates for cacti.
I'm wondering if it is possible to multiply different values in a graph template.
E.g. I have a sensor-reading for voltage and a sensor-reading for current and want to multiply them to get the power.
Thanks for any help,
Frank

User avatar
Osiris
Cacti Pro User
Posts: 883
Joined: Mon Jan 05, 2015 10:10 am

Re: Multiply Values in Graph?

#2 Post by Osiris » Sun Feb 10, 2019 2:44 pm

Yes, learn how to use a cdef.
Before history, there was a paradise, now dust.

netniV
Cacti Guru User
Posts: 3018
Joined: Sun Aug 27, 2017 12:05 am

Re: Multiply Values in Graph?

#3 Post by netniV » Fri Mar 01, 2019 6:14 pm

Yes, Osiris is technically correct, you should look at CDEF's.

The longer version of that answer requires a bit of learning on your part which you can by looking at the interface graph templates for Bytes you'll see the items use a CDEF to convert the values. When you have multiple values in a single datasource, they will show as different DEF's on the Graph Debug (usually first data source is normally a, the second b etc)

see also the docs : https://github.com/Cacti/documentation/ ... through.md

Post Reply