Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Sep 21, 2018 6:50 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: CDEF woes
PostPosted: Tue Sep 11, 2018 10:47 pm 
Offline

Joined: Tue Jul 29, 2008 9:33 pm
Posts: 5
Hi guys,

I'm making a RRD to view power usage information in our comms room. What I've got is a graph to display each phase for the power minus the amount of power our 2 solar system inverters are producing. The RRD is as follows:
phase1iac, phase2iac and phase3iac is the output current from solar inverter number 1 (eg values 10.60, 10.60, 10.40)
fron_phase1i, fron_phase2i and fron_phase3i is the output current from solar inverter number 2 (eg values 10.75, 10.69, 10.86)
phase1v, phase2v and phase3v is the voltage on each phase (eg values 241.85, 242.25, 245.42)
phase1_dc_usage, phase2_dc_usage and phase3_dcusage is how many amps is being used on each phase of power (eg values 20.55, 18.80, 13.12)

What I've got working at the moment is the wattage per phase which works good... I'd like to combine the values of all 3 and display it using another CDEF (current value, min and max). I tried creating a new CDEF and added the 3 existing CDEF's to it but that didn't work. I've attached a screenshot of the graph (values below 0 mean more solar is being generated than it's using).

RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--title='Watts usage less solar input' \
--base='1000' \
--height='150' \
--width='600' \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label='' \
--slope-mode \
--font TITLE:8: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a='/var/lib/cacti/rra/fron_phase2i_1322.rrd':'fron_phase1i':LAST \
DEF:b='/var/lib/cacti/rra/fron_phase2i_1322.rrd':'fron_phase2i':LAST \
DEF:c='/var/lib/cacti/rra/fron_phase2i_1322.rrd':'fron_phase3i':LAST \
DEF:d='/var/lib/cacti/rra/phase3iac_1323.rrd':'phase1iac':LAST \
DEF:e='/var/lib/cacti/rra/phase3iac_1323.rrd':'phase2iac':LAST \
DEF:f='/var/lib/cacti/rra/phase3iac_1323.rrd':'phase3iac':LAST \
DEF:g='/var/lib/cacti/rra/fron_phase2i_1322.rrd':'fron_phase1v':LAST \
DEF:h='/var/lib/cacti/rra/fron_phase2i_1322.rrd':'fron_phase2v':LAST \
DEF:i='/var/lib/cacti/rra/fron_phase2i_1322.rrd':'fron_phase3v':LAST \
DEF:j='/var/lib/cacti/rra/phase3_dc_usage_1324.rrd':'phase1_dc_usage':LAST \
DEF:ba='/var/lib/cacti/rra/phase3_dc_usage_1324.rrd':'phase2_dc_usage':LAST \
DEF:bb='/var/lib/cacti/rra/phase3_dc_usage_1324.rrd':'phase3_dc_usage':LAST \
CDEF:cdefj='g,j,a,d,+,-,*' \
CDEF:cdefbd='h,ba,b,e,+,-,*' \
CDEF:cdefbh='i,bb,c,f,+,-,*' \
LINE1:a#FFFFFF00:'' \
LINE1:b#FFFFFF00:'' \
LINE1:c#FFFFFF00:'' \
LINE1:d#FFFFFF00:'' \
LINE1:e#FFFFFF00:'' \
LINE1:f#FFFFFF00:'' \
LINE1:g#FFFFFF00:'' \
LINE1:h#FFFFFF00:'' \
LINE1:i#FFFFFF00:'' \
LINE3:cdefj#FFF200FF:'Phase 1 Current (W)' \
GPRINT:cdefj:LAST:'Current\:%8.2lf %s' \
GPRINT:cdefj:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefj:MAX:'Max\:%8.2lf %s\n' \
LINE3:cdefbd#FF7D00FF:'Phase 2 Current (W)' \
GPRINT:cdefbd:LAST:'Current\:%8.2lf %s' \
GPRINT:cdefbd:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefbd:MAX:'Max\:%8.2lf %s\n' \
LINE3:cdefbh#8D00BAFF:'Phase 3 Current (A)' \
GPRINT:cdefbh:LAST:'Current\:%8.2lf %s' \
GPRINT:cdefbh:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefbh:MAX:'Max\:%8.2lf %s\n'


Attachments:
File comment: Watts being used in the comms room per phase, less the solar power
solar.png
solar.png [ 26.41 KiB | Viewed 64 times ]


Last edited by weathermon on Wed Sep 12, 2018 7:46 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: CDEF woes
PostPosted: Wed Sep 12, 2018 7:33 pm 
Offline

Joined: Tue Jul 29, 2008 9:33 pm
Posts: 5
So basically what I want to know is how do I combine these 3 cdef's into one:

CDEF:cdefj='g,j,a,d,+,-,*' \
CDEF:cdefbd='h,ba,b,e,+,-,*' \
CDEF:cdefbh='i,bb,c,f,+,-,*' \

each cdef needs to be processed individually and then the total of all 3 added together. I've written what I want as a normal formula, just need to convert this into RPN:

(g*(j-(d+a))) + (h*(ba-(e+b))) + (i*(bb-(f+c)))


Top
 Profile  
 
 Post subject: Re: CDEF woes
PostPosted: Wed Sep 12, 2018 10:51 pm 
Offline

Joined: Tue Jul 29, 2008 9:33 pm
Posts: 5
I found a great website to convert standard formulas to RPN: https://www.mathblog.dk/tools/infix-postfix-converter/

(g*(j-(d+a))) + (h*(ba-(e+b))) + (i*(bb-(f+c)))
became
g j d a + - * h ba e b + - * + i bb f c + - * +

Then just replace the spaces with commas.. perfect!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group