Graph variables and CDEF's

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

Moderators: Developers, Moderators

Post Reply
anoebis
Posts: 4
Joined: Wed Sep 12, 2012 8:49 am

Graph variables and CDEF's

Post by anoebis »

Hello,

I'm using Cacti to monitor the energy consumption of some devices (using Z-Wave energy meters) and this works fine to track the actual power usage at any point in time (e.g. 400W at 8:00 AM). However, I'd like to add the cumulative energy consumption to my graphs as well (e.g. 0.4kWh during the last hour or 1.6kWh during the last 4 hours).

I first tried to achieve this using a COMMENT item with the bandwidth summation graph variable, so I used following variable ("Total energy consumption" in my graph):
|sum:6:current:2:auto|

The only problem with this approach is that the values reported by this variable should be divided by 3.6 in order to be correct. But it seems to be impossible to apply a CDEF-function to the output of this variable?

Then I tried with a GPRINT item and custom CDEF ("Daily energy consumption in kWh" in my graph):
CURRENT_DATA_SOURCE,24,*,1000,/

Now the reported value is correct, at least for the Daily graph. For all other graph types, it shows the daily cumulative energy consumption, while I would like a weekly total in the Weekly graph, a monthly total in the Monthly graph, ...

Is there any way to get this kind of totals in a Cacti graph?
Attachments
zwave.png
zwave.png (80.74 KiB) Viewed 833 times
jkrah
Posts: 1
Joined: Fri Apr 14, 2017 12:39 am

Re: Graph variables and CDEF's

Post by jkrah »

(apols for bring back an old post - but this is exactly the same issue / requirement as I have)..
I'm wanting to apply a cdef to a "|sum:" variable..

I assume to due to the lack of replies this is not possible :-(
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Graph variables and CDEF's

Post by Osiris »

Look into vdef's.
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests