Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon May 29, 2017 8:20 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Tue Apr 08, 2008 2:34 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2581
Location: Kressbronn, Germany
Easy.

The following line is wrong:

Code:
..
CDEF:cdefa=g,e,-,c,-,a,-,1024,* \
...


Basically if you "translate" this the calculation is

Code:
mem_used (cdefa) = ( mem_cache(min) - mem_cache(average) - mem_buffers (min) - mem_buffers (average) ) * 1024


but it should be

Code:
mem_used (cdefa) = ( mem_total(average) - mem_free(average) - mem_cache(average) - mem_buffers(average) ) * 1024


which again "translates" into:

Code:
CDEF:cdefa=bc,i,-,e,-,a,-,1024,*

so you need to change the CDEf to that value for the mem used to show up correctly ...

( Go to Management -> Graph Management -> CDEFs
Select the Memory Used CDEF to change that )


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 4:37 pm 
Offline

Joined: Sat Feb 16, 2008 4:20 pm
Posts: 9
Thank you very much. I guess the one thing i don't understand is how the cdef gets writen versus the actual equation.

bc,i > doesn't really make sense to me. would you mind pointing me where i could read about it or tell me yourself?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 6:52 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2581
Location: Kressbronn, Germany
Note sure what you're after :-)

But I've rertieved those "letters" from the DEF section you posted:

Code:
DEF:a="/opt/cacti/rra/bobafett_mem_buffers_349.rrd":mem_buffers:AVERAGE \
DEF:b="/opt/cacti/rra/bobafett_mem_buffers_349.rrd":mem_buffers:LAST \
DEF:c="/opt/cacti/rra/bobafett_mem_buffers_349.rrd":mem_buffers:MIN \
DEF:d="/opt/cacti/rra/bobafett_mem_buffers_349.rrd":mem_buffers:MAX \
DEF:e="/opt/cacti/rra/bobafett_mem_cache_350.rrd":mem_cache:AVERAGE \
DEF:f="/opt/cacti/rra/bobafett_mem_cache_350.rrd":mem_cache:LAST \
DEF:g="/opt/cacti/rra/bobafett_mem_cache_350.rrd":mem_cache:MIN \
DEF:h="/opt/cacti/rra/bobafett_mem_cache_350.rrd":mem_cache:MAX \
DEF:i="/opt/cacti/rra/bobafett_mem_free_351.rrd":mem_free:AVERAGE \
DEF:j="/opt/cacti/rra/bobafett_mem_free_351.rrd":mem_free:LAST \
DEF:ba="/opt/cacti/rra/bobafett_mem_free_351.rrd":mem_free:MIN \
DEF:bb="/opt/cacti/rra/bobafett_mem_free_351.rrd":mem_free:MAX \
DEF:bc="/opt/cacti/rra/bobafett_mem_total_352.rrd":mem_total:AVERAGE \
DEF:bd="/opt/cacti/rra/bobafett_mem_total_352.rrd":mem_total:MAX \


bc is therefore mem_total:AVERAGE
i is mem_free:AVERAGE


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 18, 2008 12:05 pm 
Offline

Joined: Wed Feb 06, 2008 2:56 pm
Posts: 29
I just tried to update your templates and got Error:

Quote:
Error: XML: Hash version does not exist.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 19, 2008 7:53 am 
Offline
Cacti User
User avatar

Joined: Fri Jan 26, 2007 12:38 pm
Posts: 50
Thanks for those templates :)

_________________
Cacti: 0.8.7g | Spine: 0.8.7g
Plugins: RRDclean - Weathermap - Thold - Realtime
My Template: ApacheStats 0.8.2 (multiple RRD, Low disk usage, Script Server)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2008 1:11 pm 
Offline

Joined: Tue Jul 05, 2005 10:44 am
Posts: 20
Thanks phalek, your CDEF suggestion fixed the problem I was having with 'free memory' showing negative values.

The main template should be updated to reflect this fix.
Best Regards!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 7:56 am 
Offline
Cacti User
User avatar

Joined: Mon Apr 26, 2004 7:18 am
Posts: 68
Location: Switzerland
i followed the instruction of phalek and now i get the error

Code:
ERROR: invalid rpn expression in: bc,i,-,e,-,a,-,1024,*


debug :
Code:
  RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="automatix.dmd2.ch - Memory Usage" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:AVERAGE \
DEF:b="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:LAST \
DEF:c="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:MIN \
DEF:d="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:MAX \
DEF:e="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_total_206.rrd":mem_total:AVERAGE \
DEF:f="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_total_206.rrd":mem_total:LAST \
CDEF:cdefa=bc,i,-,e,-,a,-,1024,* \
CDEF:cdeff=a,1024,* \
CDEF:cdefg=b,1024,* \
CDEF:cdefi=c,1024,* \
CDEF:cdefj=d,1024,* \
CDEF:cdefba=e,1024,* \
CDEF:cdefbb=f,1024,* \
AREA:cdefa#DE0056FF:"Memory Used"  \
GPRINT:cdefa:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdeff#FFC3C0FF:"Memory Free":STACK \
GPRINT:cdefg:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefi:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefj:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefba#000000FF:"Memory Total"  \
GPRINT:cdefbb:LAST:"  Current\:%8.2lf %s"

RRDTool Says:

ERROR: invalid rpn expression in: bc,i,-,e,-,a,-,1024,*



did I missed something ?
regards
tom

_________________
http://www.lounge-radio.com/


Top
 Profile  
 
 Post subject: Re: SNMP based template for memory / swap usage on a Unix ho
PostPosted: Wed Jan 07, 2009 4:52 am 
Offline

Joined: Thu Dec 11, 2008 10:42 am
Posts: 24
fmangeant wrote:
Image

This template is awesome, thanks !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2009 2:28 pm 
Offline

Joined: Tue Feb 24, 2009 2:21 pm
Posts: 2
Hi,
I have few servers showing NAN for Swap value. and i also have hew server which is using same script and showing value for "SWAP" in the graph. I am totally new to this field. and no idea where to start.
If any of you direct me, it will be great help for me.

Thanks in advance.
I also have opened new forum also.
index name is below:
------------------------

Cacti grapg showing NAN for Swap Current in the Graph


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 17, 2009 12:01 am 
Offline

Joined: Mon Mar 16, 2009 11:56 pm
Posts: 2
Hello,

I'm having the same problem as sumsum had. If someone could point me in the right direction I'd be very grateful:

Code:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="dev-gw - Memory Usage" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/dev-gw_mem_buffers_74.rrd":mem_buffers:AVERAGE \
DEF:b="/var/www/cacti/rra/dev-gw_mem_cache_75.rrd":mem_cache:AVERAGE \
DEF:c="/var/www/cacti/rra/dev-gw_mem_free_76.rrd":mem_free:AVERAGE \
DEF:d="/var/www/cacti/rra/dev-gw_mem_total_77.rrd":mem_total:AVERAGE \
CDEF:cdefa=bc,i,-,e,-,a,-,1024,* \
CDEF:cdeff=a,1024,* \
CDEF:cdefba=b,1024,* \
CDEF:cdefbf=c,1024,* \
CDEF:cdefca=d,1024,* \
AREA:cdefa#FFF200FF:"Memory Used"  \
GPRINT:cdefa:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdeff#6EA100FF:"Memory Buffers":STACK \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdeff:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdeff:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdefba#942D0CFF:"Memory Cached":STACK \
GPRINT:cdefba:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefba:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefba:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefba:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdefbf#12B3B5FF:"Memory Free":STACK \
GPRINT:cdefbf:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefbf:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefbf:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefbf:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefca#000000FF:"Memory Total"  \
GPRINT:cdefca:MAX:"  Current\:%8.2lf %s"

RRDTool Says:

ERROR: invalid rpn expression in: bc,i,-,e,-,a,-,1024,*


Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 17, 2009 3:14 am 
Offline

Joined: Mon Mar 16, 2009 11:56 pm
Posts: 2
OK, I *think* I've worked it out. My CDEF was not referencing my DEFs. It was attempting to reference non-existent DEFs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 17, 2009 4:22 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2581
Location: Kressbronn, Germany
yes, your cdef should be:

Quote:
DEF:a="/var/www/cacti/rra/dev-gw_mem_buffers_74.rrd":mem_buffers:AVERAGE \
DEF:b="/var/www/cacti/rra/dev-gw_mem_cache_75.rrd":mem_cache:AVERAGE \
DEF:c="/var/www/cacti/rra/dev-gw_mem_free_76.rrd":mem_free:AVERAGE \
DEF:d="/var/www/cacti/rra/dev-gw_mem_total_77.rrd":mem_total:AVERAGE \
CDEF:cdefa=d,c,-,b,-,a,-,1024,* \


or translated:
mem_used (cdefa) = ( mem_total(d) - mem_free(c) -mem_cache(b) - mem_buffers(a) ) * 1024

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code:
CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 17, 2009 4:25 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2581
Location: Kressbronn, Germany
sumsum wrote:
i followed the instruction of phalek and now i get the error

Code:
ERROR: invalid rpn expression in: bc,i,-,e,-,a,-,1024,*


Code:
DEF:a="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:AVERAGE \
DEF:b="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:LAST \
DEF:c="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:MIN \
DEF:d="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_free_205.rrd":mem_free:MAX \
DEF:e="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_total_206.rrd":mem_total:AVERAGE \
DEF:f="/var/www/systemstats087b/rra/automatix_dmd2_ch_mem_total_206.rrd":mem_total:LAST \
CDEF:cdefa=bc,i,-,e,-,a,-,1024,* \



That's wrong, you don't have a DEF:i and the others reference wrong numbers.

You want :

Code:
CDEF:cdefa=e,a,-,1024,*


or translated:

mem_used (cdefa) = ( mem_total(e) - mem_free(a) ) * 1024


Please guys, don't just copy and paste , think about what you want, the letters represent the different DEF statements, and there's a nice human readable string behind all of these ...

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code:
CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061


Top
 Profile  
 
 Post subject: Template broke after upgrade to 0.8.7e
PostPosted: Thu Dec 17, 2009 2:20 am 
Offline

Joined: Thu Dec 17, 2009 1:46 am
Posts: 2
Location: India
I've just upgraded to Cacti 0.8.7e. The Swap / Memory usage for unix graphs are now reporting "invalid rpn" error messages.

From 0.8.7e instance

Code:
/usr/local/rrdtool-1.2.19/bin/rrdtool graph - \
--imgformat=PNG \
--start=1260987146 \
--end=1261030346 \
--title="XXXX - Memory Usage" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2009/12/16 23\:42\:26 To 2009/12/17 11\:42\:26\c" \
COMMENT:"  \n" \
--vertical-label="bytes" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="XXXX-mem_free_6074.rrd":mem_free:AVERAGE \
DEF:b="XXXX-mem_total_6075.rrd":mem_total:AVERAGE \
CDEF:cdefa=c,a,-,1024,* \
CDEF:cdeff=a,1024,* \
CDEF:cdefba=b,1024,* \
AREA:cdefa#DE0056FF:"Memory Used"  \
GPRINT:cdefa:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdeff#FFC3C0FF:"Memory Free":STACK \
GPRINT:cdeff:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdeff:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdeff:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefba#000000FF:"Memory Total"  \
GPRINT:cdefba:LAST:"  Current\:%8.2lf %s"



From 0.8.7b instance

Code:
/usr/local/rrdtool-1.2.19/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="XXXX - Memory Usage" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="XXXX_mem_free_2451.rrd":mem_free:AVERAGE \
DEF:b="XXXX_mem_free_2451.rrd":mem_free:LAST \
DEF:c="XXXX_mem_free_2451.rrd":mem_free:MAX \
DEF:d="XXXX_mem_total_2452.rrd":mem_total:AVERAGE \
DEF:e="XXXX_mem_total_2452.rrd":mem_total:LAST \
CDEF:cdefa=d,a,-,1024,* \
CDEF:cdeff=a,1024,* \
CDEF:cdefg=b,1024,* \
CDEF:cdefj=c,1024,* \
CDEF:cdefba=d,1024,* \
CDEF:cdefbb=e,1024,* \
AREA:cdefa#DE0056FF:"Memory Used"  \
GPRINT:cdefa:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdeff#FFC3C0FF:"Memory Free":STACK \
GPRINT:cdefg:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdeff:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefj:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefba#000000FF:"Memory Total"  \
GPRINT:cdefbb:LAST:"  Current\:%8.2lf %s"


Some of the DEFs vanished after the upgrade to 0.8.7e ..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 18, 2009 4:46 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2581
Location: Kressbronn, Germany
The following line
Code:
CDEF:cdefa=c,a,-,1024,* \


should be

Code:
CDEF:cdefa=b,a,-,1024,* \


other than that it looks like the two graps are from different templates

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code:
CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 6 guests


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