Multiply Values in Graph?

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

Moderators: Developers, Moderators

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

Multiply Values in Graph?

Post by farnk »

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 Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Multiply Values in Graph?

Post by Osiris »

Yes, learn how to use a cdef.
Before history, there was a paradise, now dust.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Multiply Values in Graph?

Post by netniV »

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
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests